Skip to content
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

Add converter for Arctica-M N1 RSR data. #145

Merged
merged 8 commits into from
Oct 10, 2022

Conversation

simonrp84
Copy link
Member

@simonrp84 simonrp84 commented Feb 8, 2022

This adds spectral response functions for the MSU-GS/A instruments aboard the Arctica-M N1 satellite.
There are two instruments aboard the satellite, which have differing spectral response functions. Here I add them as det-1 and det-2.

To achieve this, I have also updated utils.py to add the ability to save HDF5 files by detector - which wasn't implemented before.

  • Tests passed: Passes pytest pyspectral
  • Passes flake8 pyspectral
  • Fully documented

@codecov
Copy link

codecov bot commented Feb 8, 2022

Codecov Report

Merging #145 (c45a914) into main (fd07153) will increase coverage by 0.91%.
The diff coverage is 92.00%.

@@            Coverage Diff             @@
##             main     #145      +/-   ##
==========================================
+ Coverage   88.03%   88.94%   +0.91%     
==========================================
  Files          22       22              
  Lines        2473     2515      +42     
==========================================
+ Hits         2177     2237      +60     
+ Misses        296      278      -18     
Flag Coverage Δ
unittests 88.94% <92.00%> (+0.91%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
pyspectral/tests/test_utils.py 97.88% <86.66%> (-2.12%) ⬇️
pyspectral/utils.py 90.00% <100.00%> (+10.64%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

pyspectral/utils.py Outdated Show resolved Hide resolved
@adybbroe
Copy link
Collaborator

adybbroe commented Feb 9, 2022

@simonrp84 You can update utils.py with this url and bump the version to 1.0.18:
https://zenodo.org/record/6026563/files/pyspectral_rsr_data.tgz

@simonrp84
Copy link
Member Author

Thanks for the comments @pnuu and @adybbroe! I think I've updated / addressed everything now. I also added Arctica-M-N1 to the INSTRUMENTS dict in utils.py.

pyspectral/utils.py Outdated Show resolved Hide resolved
Copy link
Collaborator

@adybbroe adybbroe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. But please fix the typo! Which is essential, and can only be tested via off-line testing

@adybbroe adybbroe self-requested a review February 10, 2022 14:10
Copy link
Collaborator

@adybbroe adybbroe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry @simonrp84 But could you please add some testing on your added code in utils.py? The coverage went down. I didn't pay attention to that previously....

@simonrp84
Copy link
Member Author

simonrp84 commented Mar 17, 2022

Sorry @simonrp84 But could you please add some testing on your added code in utils.py? The coverage went down. I didn't pay attention to that previously....

Looking at what's changed, it seems that the function I altered didn't have any tests before - so I would need to add them. This will probably not be a quick effort as I've not worked with mocking HDF5 before. Will see what I can do.

Copy link
Collaborator

@adybbroe adybbroe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are changes to utils.py which seems poorly covered by tests. Is it something you can try improve? Or do you need help?

@adybbroe
Copy link
Collaborator

@simonrp84 I will try see if I can help our here. Maybe as Arctica-M is kind of on hold as we have no real-time flow of data this PR is not urgent and we can see if we find some time improving the test coverage of the convert2hdf5 function before merging. Ok?

@simonrp84
Copy link
Member Author

To be honest I've forgotten what I did in this PR! Will check through it next week and then we can figure out how to move on it. Like you say, no rush now.

@simonrp84
Copy link
Member Author

I have now added some tests that should improve the coverage of the code previously missed. I chose to not mock the h5py library but to actually reader an HDF5 RSR file through the tests and then delete it after. Am unsure if this is the best way to do things so please let me know what you think!

Copy link
Collaborator

@adybbroe adybbroe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@adybbroe adybbroe merged commit 3a0f406 into pytroll:main Oct 10, 2022
@simonrp84 simonrp84 deleted the arctica-m-srf branch October 10, 2022 19:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants