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
Metop level 2 EUMETCAST BUFR reader #1079
Conversation
… up with one extra row
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.
Thanks for adding this new reader to satpy! Bufr isn't an easy format :)
I have a few comments, but please run flake8 with the flake8-docstring plugin on the code.
satpy/readers/iasi_l2_so2_bufr.py
Outdated
import eccodes as ec | ||
except ImportError: | ||
raise ImportError( | ||
"""Missing eccodes-python and/or eccodes C-library installation. Use conda to install eccodes""") |
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.
Just in case it's not eccodes itself missing but on of the requirements, you might want to append the original error message here.
satpy/readers/iasi_l2_so2_bufr.py
Outdated
data_center_dict = {3: {'name': 'METOP-1'}, 4: {'name': 'METOP-2'}, | ||
5: {'name': 'METOP-3'}} |
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.
Since you only have a name here, is it necessary to make it a nested dict ?
satpy/readers/iasi_l2_so2_bufr.py
Outdated
|
||
def __init__(self, filename, filename_info, filetype_info, **kwargs): | ||
"""Initialise the file handler for the IASI L2 SO2 BUFR data.""" | ||
|
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.
No blank line after a docstring.
satpy/readers/iasi_l2_so2_bufr.py
Outdated
self.properties = {} | ||
self.properties['start_time'] = start_time | ||
self.properties['end_time'] = end_time | ||
self.properties['SpacecraftName'] = data_center_dict[sc_id]['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.
For consistency: we usually call this metadata
or mda
for short, not `properties.
satpy/readers/iasi_l2_so2_bufr.py
Outdated
|
||
fh.close() | ||
|
||
return(start_time, end_time) |
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.
You don't need parenthesis here.
satpy/readers/iasi_l2_so2_bufr.py
Outdated
return(start_time, end_time) | ||
|
||
def get_attribute(self, key): | ||
''' Get BUFR attributes ''' |
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.
Please use double quotes ("
), and add a dot at then end.
SCAN_WIDTH = 120 | ||
|
||
def save_test_data(path): | ||
"""Save the test file to the indicated directory""" |
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.
.
at the end of the line.
Codecov Report
@@ Coverage Diff @@
## master #1079 +/- ##
=========================================
Coverage ? 88.93%
=========================================
Files ? 194
Lines ? 29826
Branches ? 0
=========================================
Hits ? 26525
Misses ? 3301
Partials ? 0
Continue to review full report at Codecov.
|
… a variable in the test
satpy/readers/iasi_l2_so2_bufr.py
Outdated
except ImportError as e: | ||
raise ImportError( | ||
"""Missing eccodes-python and/or eccodes C-library installation. Use conda to install eccodes. | ||
Error: """ , e) |
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.
E203 whitespace before ','
satpy/tests/reader_tests/__init__.py
Outdated
@@ -42,7 +42,8 @@ | |||
test_ami_l1b, test_viirs_compact, test_seviri_l2_bufr, | |||
test_geos_area, test_nwcsaf_msg, test_glm_l2, | |||
test_seviri_l1b_icare, test_mimic_TPW2_nc, | |||
test_slstr_l2, test_aapp_l1b, test_eps_l1b) | |||
test_slstr_l2, test_aapp_l1b, test_eps_l1b, |
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.
W291 trailing whitespace
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.
This looks good, I just have one last request I think.
LGTM then, @djhoese do you want to have a look or can I merge ? |
Merged, thanks for the contribution ! |
This PR provides a reader for IASI level 2 SO2 BUFR data distributed over EUMETCAST. Flake8 is still flagging some lines > 80 characters, but these are for test data which doesn't compromise readability of the code itself.
flake8 satpy
AUTHORS.md