Skip to content

Commit f0f30c8

Browse files
committed
script pp: Fix python 3.8 compatibility
For some reason `pd.Timestamp.utctimetuple()` raises a `TypeError` on python 3.8., see pandas-dev/pandas#32174. This functions is used internally by `pysolar`, which we use to (re-)calculate the solar zenith angles for level-2 post processing. Passing a `datetime.dateime` to the `pysolar` function fixes it for now.
1 parent 4861266 commit f0f30c8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

scripts/scia_post_process_l2.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -366,7 +366,7 @@ def _read_gm(fname):
366366
else:
367367
sdd.noem_no[i][:] = np.nan
368368
sdd.sza[i] = 90. - sun_alt_func(lat, sdd.lons[i],
369-
dt.timedelta(np.asscalar(sdd.utcdays[i])) + dtrefdate,
369+
(dt.timedelta(np.asscalar(sdd.utcdays[i])) + dtrefdate).to_pydatetime(),
370370
elevation=mean_alt_m)
371371
sdd.vmr = sdd.densities / sdd.dens_tot * 1.e9 # ppb
372372
return dts_retr_interp0, time0, lst0, lon0, sdd

0 commit comments

Comments
 (0)