-
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
adding a reader for ATMS level1b data #2187
Conversation
Codecov Report
@@ Coverage Diff @@
## main #2187 +/- ##
==========================================
+ Coverage 94.14% 94.16% +0.01%
==========================================
Files 294 296 +2
Lines 45183 45310 +127
==========================================
+ Hits 42539 42666 +127
Misses 2644 2644
Flags with carried forward coverage won't be shown. Click here to find out more.
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
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.
From a quick scan of this, this looks really well done. Thanks for adding it and making the pull request. I've made a few comments and suggestions. Let me know what you think. What still needs to be done for this to be not a draft?
satpy/readers/atms_l1b_nc.py
Outdated
try: | ||
dataset = ( | ||
self[param] if param not in self.channel_name_to_index | ||
else self._get_channel_data(param) | ||
) | ||
except KeyError: | ||
logger.warning(f'Could not find {param} in NetCDF file, no valid Dataset created') # noqa: E501 |
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.
Is this try/except needed? Is the error message that is generated by default (without this try/except) too confusing? I'm not sure this adds much to the log. Additionally, I'm not sure returning None
is the expected behavior when a dataset can't be loaded. I think KeyError
should be handled just fine.
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 checked and found out this try/except is not needed. The default error message is good enough, so I removed it.
satpy/readers/atms_l1b_nc.py
Outdated
ATMS_CHANNEL_NAME_TO_INDEX = { | ||
"1": 0, | ||
"2": 1, | ||
"3": 2, | ||
"4": 3, | ||
"5": 4, | ||
"6": 5, | ||
"7": 6, | ||
"8": 7, | ||
"9": 8, | ||
"10": 9, | ||
"11": 10, | ||
"12": 11, | ||
"13": 12, | ||
"14": 13, | ||
"15": 14, | ||
"16": 15, | ||
"17": 16, | ||
"18": 17, | ||
"19": 18, | ||
"20": 19, | ||
"21": 20, | ||
"22": 21, | ||
} |
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'm not sure I understand why this is needed. Isn't this just int(channel_name) - 1
? It might be cleaner and less code overall if in the data loading you did something like:
try:
channel_index = int(name) - 1
return self.antenna _temperature[:, :, channel_index]
except TypeError:
return self[name]
then you don't have to have this dictionary or the overridden __init__
.
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, your suggestion is much cleaner. Fixed it.
Reader for JPSS Advanced Technology Microwave Sounder Level 1B files in NetCDF4. | ||
status: Beta | ||
sensors: [atms] | ||
reader: !!python/name:satpy.readers.yaml_reader.FileYAMLReader |
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.
reader: !!python/name:satpy.readers.yaml_reader.FileYAMLReader | |
reader: !!python/name:satpy.readers.yaml_reader.FileYAMLReader | |
supports_fsspec: false |
This additional information was added recently and is described here: https://satpy.readthedocs.io/en/latest/dev_guide/custom_reader.html#the-reader-section
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 letting me know.
One reason this is a draft PR is that I wanted to include a |
Sounds good. Thanks for letting me know. I'm not sure I'm the right person to review something like that and it looks like Gerrit already got to it. Let me know if you need anything else from me until this PR is further along. |
Oh, this is great @BengtRydberg I had adding ATMS reader on my to-do-list! :-) |
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. Clean work, just two small comments inline. Regarding the failing test: it's being worked on, so we're waiting for it to be fixed before merging other PRs.
ok. |
@BengtRydberg the tests are fixed in main now, could you merge main into your branch? |
I have merged main into the branch, but note that I had to add an rtol in assert_allclose test that is not mine, in order to not fail unit tests in CI. This test seems to test details from another package (skyfield). Maybe I should not have done this? |
that's fine. |
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 PR adds a reader for the Advanced Technology Microwave Sounder (ATMS) Level 1B data.
The reason for this is that the nowcasting SAF intends to include a pipeline for processing ATMS within the PPS microwave package where satpy is used for reading of level1b data, and it seems that no existing reader for ATMS data is available within satpy.
AUTHORS.md
if not there already