Skip to content

Commit

Permalink
expand mask_and_scale arg application to more time-related vars & f…
Browse files Browse the repository at this point in the history
…loat32
  • Loading branch information
danielfromearth committed Jan 24, 2024
1 parent 2fd6fb5 commit 3a2aac5
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions podaac/subsetter/subset.py
Original file line number Diff line number Diff line change
Expand Up @@ -1212,11 +1212,11 @@ def subset(file_to_subset: str, bbox: np.ndarray, output_file: str,

if min_time or max_time:
args['decode_times'] = True
# check fill value and dtype, we know that this will cause an integer Overflow with xarray
if 'time' in nc_dataset.variables.keys():
# check fill value and dtype; we know that this will cause an integer Overflow with xarray
for time_variable in [v for v in nc_dataset.variables.keys() if 'time' in v]:
try:
if nc_dataset['time'].getncattr('_FillValue') == nc.default_fillvals.get('f8') and \
nc_dataset['time'].dtype == 'float64':
if nc_dataset[time_variable].getncattr('_FillValue') == nc.default_fillvals.get('f8') and \
(nc_dataset[time_variable].dtype == 'float64') or (nc_dataset[time_variable].dtype == 'float32'):
args['mask_and_scale'] = True
except AttributeError:
pass
Expand Down

0 comments on commit 3a2aac5

Please sign in to comment.