-
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
Fix mersi 2 angles reading #1407
Conversation
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.
Nice catch! Looks good, I just have one style comment.
satpy/readers/mersi2_l1b.py
Outdated
@@ -92,7 +92,7 @@ def get_dataset(self, dataset_id, ds_info): | |||
|
|||
fill_value = attrs.pop('FillValue', np.nan) # covered by valid_range | |||
valid_range = attrs.pop('valid_range', None) | |||
if dataset_id['calibration'] == 'counts': | |||
if 'calibration' in dataset_id and dataset_id['calibration'] == 'counts': |
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.
The more pythonic way to do this is:
if 'calibration' in dataset_id and dataset_id['calibration'] == 'counts': | |
if dataset_id.get('calibration') == 'counts': |
IIRC this should work with DataIDs too.
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.
Ok
Codecov Report
@@ Coverage Diff @@
## master #1407 +/- ##
==========================================
+ Coverage 90.56% 90.61% +0.05%
==========================================
Files 228 228
Lines 33406 34059 +653
==========================================
+ Hits 30254 30863 +609
- Misses 3152 3196 +44
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
The MERSI-2 reader could no longer read angles data due to that keyword 'calibration' was always expected.
The error message:
flake8 satpy