-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature/issue 189 #190
Feature/issue 189 #190
Conversation
|
||
# Check for the specific OverflowError message | ||
if "Python int too large to convert to C long" in traceback_str and "Failed to decode variable 'time': unable to decode time units" in traceback_str: | ||
args["mask_and_scale"] = True |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
By setting mask_and_scale to true, the resulting granule will have no scale/offset attributes because those will be applied to the data variables. Ideally we'd maintain the old behavior (where the subsetted granule has the same scale/offset attributes) -- would such a thing be possible? The hard way to do this would be to re-apply the scale/offset to each data variable, but maybe there's an easier way.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That is correct, im not sure if we can undo this, i haven't found any other way where i can open the file using xarray without the mask_and_scale options
traceback_str = traceback.format_exc() | ||
|
||
# Check for the specific OverflowError message | ||
if "Python int too large to convert to C long" in traceback_str and "Failed to decode variable 'time': unable to decode time units" in traceback_str: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hardcoded 'time' variable name
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i have the intention to only catch the "Python int too large to convert to C long" for the time variable, although i can change it catch for any.
Github Issue: #189 (replace NUM with Github issue number)
Description
Fix temporal subsetting for SWOT data
Overview of work done
Overview of verification done
Overview of integration done
PR checklist:
See Pull Request Review Checklist for pointers on reviewing this pull request