Skip to content

Commit

Permalink
Decode time parameters to datetime
Browse files Browse the repository at this point in the history
  • Loading branch information
sfinkens committed Dec 13, 2023
1 parent 2948a6f commit 6ee3248
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion satpy/readers/satpy_cf_nc.py
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,12 @@ def get_dataset(self, ds_id, ds_info):
data.attrs.update(nc.attrs) # For now add global attributes to all datasets
if "orbital_parameters" in data.attrs:
data.attrs["orbital_parameters"] = _str2dict(data.attrs["orbital_parameters"])

if "time_parameters" in data.attrs:
time_params = _str2dict(data.attrs["time_parameters"])
from dateutil.parser import isoparse
for key, val in time_params.items():
time_params[key] = isoparse(val)
data.attrs["time_parameters"] = time_params
return data

def get_area_def(self, dataset_id):
Expand Down

0 comments on commit 6ee3248

Please sign in to comment.