Skip to content

Commit

Permalink
Handle OB.DAAC files, which do not have time variables (#296)
Browse files Browse the repository at this point in the history
Co-authored-by: aynur <[email protected]>
  • Loading branch information
seadas and aynur authored Oct 23, 2024
1 parent f662f31 commit 3113b4e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions podaac/subsetter/subset.py
Original file line number Diff line number Diff line change
Expand Up @@ -560,6 +560,10 @@ def compute_time_variable_name(dataset: xr.Dataset, lat_var: xr.Variable, total_
if var_name not in total_time_vars and 'time' in var_name_time.lower() and dataset[var_name].squeeze().dims[0] in lat_var.squeeze().dims:
return var_name

# OB.DAAC data does not have a time variable. Returning the following field of a composite time value to avoid exceptions.
if '__scan_line_attributes__day' in dataset.data_vars:
return '__scan_line_attributes__day'

raise ValueError('Unable to determine time variable')


Expand Down

0 comments on commit 3113b4e

Please sign in to comment.