Skip to content

Commit

Permalink
update with keyerror exception when getting sst_dtime
Browse files Browse the repository at this point in the history
  • Loading branch information
sliu008 committed Jul 15, 2024
1 parent 2b7b68c commit eb48451
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions podaac/subsetter/subset.py
Original file line number Diff line number Diff line change
Expand Up @@ -1162,7 +1162,7 @@ def test_access_sst_dtime_values(datafile):
# pylint: disable=pointless-statement
dataset['sst_dtime'].values
return True
except (TypeError, ValueError):
except (TypeError, ValueError, KeyError):
return False


Expand Down Expand Up @@ -1271,7 +1271,9 @@ def subset(file_to_subset: str, bbox: np.ndarray, output_file: str,

if (getattr(time_var, '_FillValue', None) == fill_value_f8 and time_var.dtype in float_dtypes) or \
(getattr(time_var, 'long_name', None) == "reference time of sst file"):
args['mask_and_scale'] = test_access_sst_dtime_values(file_to_subset)
args['mask_and_scale'] = True
if getattr(time_var, 'long_name', None) == "reference time of sst file":
args['mask_and_scale'] = test_access_sst_dtime_values(file_to_subset)
break

if hdf_type == 'GPM':
Expand Down

0 comments on commit eb48451

Please sign in to comment.