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

Fix handling of non-existent reflectance bands in 'viirs_l1b' reader #2100

Merged
merged 4 commits into from May 4, 2022

Conversation

djhoese
Copy link
Member

@djhoese djhoese commented May 4, 2022

The VIIRS L1b format was changed a couple years ago to save space by only including reflectance band when there is day data in the scene. The variables in these cases do not exist in the files. This resulted in two problems:

  1. Trying to load a reflectance band would produce an unexpected error related to trying to treat an integer shape (default return value to handle scalar variables) as a tuple.
  2. Listing the reflectance bands as available in Scene.available_dataset_ids/names.

This PR fixes both those cases.

  • Closes #xxxx
  • Tests added
  • Fully documented

@djhoese djhoese self-assigned this May 4, 2022
@djhoese djhoese added this to In progress in PCW Spring 2022 via automation May 4, 2022
@djhoese djhoese requested a review from mraspaud as a code owner May 4, 2022 01:22
@codecov
Copy link

codecov bot commented May 4, 2022

Codecov Report

Merging #2100 (d8ed23a) into main (2e1d845) will increase coverage by 0.02%.
The diff coverage is 96.07%.

@@            Coverage Diff             @@
##             main    #2100      +/-   ##
==========================================
+ Coverage   93.90%   93.92%   +0.02%     
==========================================
  Files         283      283              
  Lines       42615    42715     +100     
==========================================
+ Hits        40017    40120     +103     
+ Misses       2598     2595       -3     
Flag Coverage Δ
behaviourtests 4.71% <0.00%> (-0.01%) ⬇️
unittests 94.48% <96.07%> (+0.02%) ⬆️

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

Impacted Files Coverage Δ
satpy/tests/reader_tests/test_viirs_l1b.py 98.93% <93.93%> (+1.66%) ⬆️
satpy/readers/viirs_l1b.py 96.15% <100.00%> (+0.37%) ⬆️
satpy/readers/cmsaf_claas2.py 100.00% <0.00%> (ø)
satpy/tests/reader_tests/test_cmsaf_claas.py 100.00% <0.00%> (ø)
satpy/tests/test_scene.py 99.47% <0.00%> (+<0.01%) ⬆️
satpy/scene.py 93.32% <0.00%> (+0.20%) ⬆️

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 2e1d845...d8ed23a. Read the comment docs.

@coveralls
Copy link

coveralls commented May 4, 2022

Coverage Status

Coverage increased (+0.01%) to 94.421% when pulling d8ed23a on djhoese:bugfix-viirs-l1b-available into e5a71d5 on pytroll:main.

Copy link
Member

@mraspaud mraspaud left a comment

Choose a reason for hiding this comment

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

LGTM, just a small improvement suggestion inline.

satpy/readers/viirs_l1b.py Outdated Show resolved Hide resolved
@djhoese djhoese merged commit 56eb21b into pytroll:main May 4, 2022
PCW Spring 2022 automation moved this from In progress to Done May 4, 2022
@djhoese djhoese deleted the bugfix-viirs-l1b-available branch May 4, 2022 14:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

Successfully merging this pull request may close these issues.

None yet

3 participants