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
Fix VIIRS L1B reader sensor not matching VIIRS SDR reader #2083
Conversation
Codecov Report
@@ Coverage Diff @@
## main #2083 +/- ##
=======================================
Coverage 93.86% 93.87%
=======================================
Files 283 283
Lines 42379 42380 +1
=======================================
+ Hits 39781 39783 +2
+ Misses 2598 2597 -1
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.
LGTM, just one minor comment.
satpy/readers/viirs_l1b.py
Outdated
return str(res.astype(str)) | ||
else: | ||
return res | ||
res = str(res.astype(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.
Can you add a small test for this case?
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.
So I went to the work of converting the tests to pytest, created a whole subclass of tests that use numpy array versions of strings only to find that none of the other parts of the file handler use this astype
logic. That's because this logic at some point was moved to the base utility netcdf file handler. This branch of code was only meant for older versions of the HDF5 library anyway, but is handled by the np2str
usage inside the base class. I've removed these two lines.
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! It's a good thing you took the time to convert to pytest too :)
Feel free to merge when tests pass. |
The 'viirs_sdr' reader produces a lowercase sensor name. The 'viirs_l1b' reader produced whatever case was in the file which for the data I have is uppercase. This is inconsistent and doesn't follow the general standard practice in satpy to have lowercase sensor names.