From 3113b4e164b51d0e366f418c014fdc5b40a4d84c Mon Sep 17 00:00:00 2001 From: SeaDAS Date: Wed, 23 Oct 2024 13:17:18 -0400 Subject: [PATCH] Handle OB.DAAC files, which do not have time variables (#296) Co-authored-by: aynur --- podaac/subsetter/subset.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/podaac/subsetter/subset.py b/podaac/subsetter/subset.py index d1b9e461..7124637e 100644 --- a/podaac/subsetter/subset.py +++ b/podaac/subsetter/subset.py @@ -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')