-
Notifications
You must be signed in to change notification settings - Fork 303
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
Apply valid_range in MiRS reader when present #1655
Conversation
Merge branch 'master' of https://github.com/pytroll/satpy
Remove platform name from parameterize in last test for kwargs because they are not used in that test. Add a test for the NOAA-20 platform when the limb_correction assertions are tested and platform name is tested.
Merge remote-tracking branch 'upstream/master'
Fixes a bug in which valid range was ignored.
Codecov Report
@@ Coverage Diff @@
## master #1655 +/- ##
==========================================
+ Coverage 92.61% 92.65% +0.03%
==========================================
Files 258 258
Lines 37783 37948 +165
==========================================
+ Hits 34994 35161 +167
+ Misses 2789 2787 -2
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
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 had a couple questions. Also, how hard would it be to check the data in the tests to make sure the valid range was applied?
satpy/readers/mirs.py
Outdated
@@ -356,6 +356,17 @@ def _fill_data(self, data_arr, attrs): | |||
data_arr = data_arr.where(data_arr != fill_value, fill_out) | |||
return data_arr, attrs | |||
|
|||
def _get_valid_range(self, data_arr, attrs): |
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.
def _get_valid_range(self, data_arr, attrs): | |
def _apply_valid_range(self, data_arr, attrs): |
Really nitpicking here. Not necessary unless you make other changes.
Change get_valid_range=>apply_valid_range and check for case of valid_range not None
only read fake_data one time, not every time check_valid_range is called.
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
This fixes a bug in which the valid range was not used. Fix checks for a valid range in the attributes and applies the range if present. There is a new check in the test code which determines if valid_range is removed from the attributes after loading the data.