Skip to content

Commit

Permalink
fix netcdf test ingestion
Browse files Browse the repository at this point in the history
  • Loading branch information
BryonLewis committed Feb 13, 2025
1 parent fc8fcba commit 8120798
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions uvdat/core/tasks/netcdf.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,10 +115,9 @@ def create_netcdf_data_layer(file_item, metadata):
cftime.Datetime360Day,
cftime.DatetimeJulian,
)
if isinstance(variable.values[0], cftime_types):
if variable.size > 0 and variable.values.ndim > 0 and isinstance(variable.values[0], cftime_types):
vals = []
for item in variable.values:
print(item)
dt = item
dt_obj = datetime(dt.year, dt.month, dt.day, dt.hour, dt.minute, dt.second)
timeobj = convert_time(pd.Timestamp(dt_obj), 'datetime')
Expand Down

0 comments on commit 8120798

Please sign in to comment.