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 limb_correction keyword argument to MiRS reader #1621

Merged
merged 15 commits into from Mar 30, 2021

Conversation

joleenf
Copy link
Contributor

@joleenf joleenf commented Mar 25, 2021

Addresses #1601 by adding a limb_correction keyword argument to the reader.
Default: limb_correction for atms sensors is on, but will not be applied when keyword is set to false.

    from satpy import Scene, find_files_and_readers

    filenames = find_files_and_readers(base_dir, reader="mirs")
    scene = Scene(filenames, reader_kwargs={'limb_correction': False})

@codecov
Copy link

codecov bot commented Mar 25, 2021

Codecov Report

Merging #1621 (b0140d1) into master (2286d24) will increase coverage by 0.26%.
The diff coverage is 92.85%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1621      +/-   ##
==========================================
+ Coverage   92.35%   92.61%   +0.26%     
==========================================
  Files         254      258       +4     
  Lines       37409    37746     +337     
==========================================
+ Hits        34548    34959     +411     
+ Misses       2861     2787      -74     
Flag Coverage Δ
behaviourtests 4.81% <0.00%> (+0.03%) ⬆️
unittests 92.75% <92.85%> (+0.26%) ⬆️

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

Impacted Files Coverage Δ
satpy/readers/mirs.py 72.54% <80.00%> (+0.61%) ⬆️
satpy/tests/reader_tests/test_mirs.py 100.00% <100.00%> (ø)
satpy/readers/seviri_l1b_hrit.py 90.18% <0.00%> (-0.79%) ⬇️
satpy/dependency_tree.py 97.34% <0.00%> (-0.66%) ⬇️
satpy/scene.py 92.17% <0.00%> (-0.32%) ⬇️
satpy/composites/viirs.py 86.48% <0.00%> (-0.06%) ⬇️
satpy/tests/test_data_download.py 100.00% <0.00%> (ø)
satpy/readers/seviri_l1b_native_hdr.py 100.00% <0.00%> (ø)
satpy/tests/writer_tests/test_ninjotiff.py 100.00% <0.00%> (ø)
satpy/tests/reader_tests/test_seviri_base.py 100.00% <0.00%> (ø)
... and 29 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2286d24...b0140d1. Read the comment docs.

Copy link
Member

@djhoese djhoese left a comment

Choose a reason for hiding this comment

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

Looks good except for the docstring needs some small changes to get formatted correctly as a block of code.

satpy/readers/mirs.py Outdated Show resolved Hide resolved
@djhoese djhoese changed the title MiRS Reader: Add limb_correction keyword Add limb_correction keyword argument to MiRS reader Mar 26, 2021
@djhoese
Copy link
Member

djhoese commented Mar 26, 2021

Oh and do you have plans for a test with this keyword argument?

@joleenf
Copy link
Contributor Author

joleenf commented Mar 26, 2021

I will work on the test for the argument and fix the docstring.

Remove platform name from parameterize in last test for kwargs because
they are not used in that test.  Add a test for the NOAA-20 platform
when the limb_correction assertions are tested and platform name is
tested.
@joleenf joleenf requested a review from djhoese March 27, 2021 19:31
@djhoese djhoese added component:readers enhancement code enhancements, features, improvements labels Mar 27, 2021
@djhoese djhoese self-assigned this Mar 27, 2021
Copy link
Member

@djhoese djhoese left a comment

Choose a reason for hiding this comment

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

Nice job. Would it be possible to combine the two tests on the bottom into one that is parametrized on limb_correction (you can have multiple parametrize decorators if needed)?

@joleenf joleenf requested a review from djhoese March 30, 2021 11:36
@joleenf joleenf requested a review from djhoese March 30, 2021 13:07
@ghost
Copy link

ghost commented Mar 30, 2021

Congratulations 🎉. DeepCode analyzed your code in 146.559 seconds and we found no issues. Enjoy a moment of no bugs ☀️.

👉 View analysis in DeepCode’s Dashboard | Configure the bot

@djhoese
Copy link
Member

djhoese commented Mar 30, 2021

Thank you!

@djhoese djhoese merged commit 4cef629 into pytroll:master Mar 30, 2021
@joleenf joleenf deleted the iss1601 branch May 15, 2021 10:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component:readers enhancement code enhancements, features, improvements
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow MiRS reader to apply limb correction optionally
2 participants