-
Notifications
You must be signed in to change notification settings - Fork 307
Refactor MODIS readers to avoid extra dask tasks #3081
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
Conversation
946c377
to
8e5ee94
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3081 +/- ##
=======================================
Coverage 96.14% 96.15%
=======================================
Files 383 383
Lines 55798 55813 +15
=======================================
+ Hits 53649 53666 +17
+ Misses 2149 2147 -2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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 a suggestion for refactoring the interpolation function, but looks good otherwise
@@ -280,7 +280,8 @@ def calibrate_refl(array, attributes, index): | |||
offset = np.float32(attributes["reflectance_offsets"][index]) | |||
scale = np.float32(attributes["reflectance_scales"][index]) | |||
# convert to reflectance and convert from 1 to % | |||
array = (array - offset) * scale * 100 | |||
array = (array - offset) |
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.
array = (array - offset) | |
array = array - offset |
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.
Crap. I just realized I never did this.
Pull Request Test Coverage Report for Build 13972719479Warning: This coverage report may be inaccurate.This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.
Details
💛 - Coveralls |
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.
LGTM
I was using the
modis_l1b
reader for debugging something dask related and got annoyed at how many tasks were in the task graph for simple reading functionality. This PR rewrites some of these things to avoid the repetitive tasks (scaling and fill value checks) and the confusing tasks (angle offsets for lonlat2xyz compatibility). I was tempted to also apply changes like this to all the calibration and uncertainty checks, but overall these changes don't affect performance much so I plan to leave these other changes for a future where I (or someone else) is annoyed by all the tasks being shown by dask.Note: I did these while debugging other things so it is possible the code is not the cleanest and needs more cleanup, but the tests pass so I think that's a good start.
AUTHORS.md
if not there already