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 for missing attributes when requesting 'counts' calibration from ABI L1B reader. #1800

Merged
merged 3 commits into from Aug 24, 2021

Conversation

jon4than
Copy link
Contributor

As part of Pull Request #1692, we added an early return to abi_l1b.py's get_dataset method when the requested calibration is "counts".

The problem is that the early return results in a number of missing attributes in the object returned from get_dataset.

I also took the liberty of updating the unit tests to check for some of the missing attributes, as well as including a test for invalid calibration.

As an aside, I agree with the logic for why it was decided to return early; the self.nc['Rad'] values aren't radiances. That said, I couldn't think of a more straightforward way to write this code.

  • Tests added
  • Fully documented
  • Add your name to AUTHORS.md if not there already

As part of Pull Request pytroll#1692, we added an early return to abi_l1b.py's
get_dataset method when the requested calibration is "counts".

The problem is that the early return results in a number of missing
attributes in the object returned from get_dataset.

I also took the liberty of updating the unit tests to check for some of
the missing attributes, as well as including a test for invalid
calibration.
Should satisfy the pull request requirements.
satpy/readers/abi_l1b.py Outdated Show resolved Hide resolved
Also adjusted the formatting of test_abi_l1b.py so that it'll conform
with flake8 (and flake8-docstring).
@codecov
Copy link

codecov bot commented Aug 24, 2021

Codecov Report

Merging #1800 (4b4d2f4) into main (4813df6) will increase coverage by 0.00%.
The diff coverage is 92.85%.

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #1800   +/-   ##
=======================================
  Coverage   92.92%   92.92%           
=======================================
  Files         265      265           
  Lines       39081    39092   +11     
=======================================
+ Hits        36316    36328   +12     
+ Misses       2765     2764    -1     
Flag Coverage Δ
behaviourtests 4.76% <0.00%> (-0.01%) ⬇️
unittests 93.46% <92.85%> (+<0.01%) ⬆️

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

Impacted Files Coverage Δ
satpy/tests/reader_tests/test_abi_l1b.py 99.25% <91.66%> (-0.75%) ⬇️
satpy/readers/abi_l1b.py 98.61% <100.00%> (+2.77%) ⬆️

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 4813df6...4b4d2f4. Read the comment docs.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.004%) to 93.41% when pulling 4b4d2f4 on jon4than:abi-counts-attrfix into 4813df6 on pytroll:main.

@djhoese
Copy link
Member

djhoese commented Aug 24, 2021

Thanks @jon4than!

@djhoese djhoese merged commit 2a81e65 into pytroll:main Aug 24, 2021
simonrp84 pushed a commit to simonrp84/satpy that referenced this pull request Nov 24, 2021
…ABI L1B reader. (pytroll#1800)

* Fix ABI L1B reader not returning expected attrs.

As part of Pull Request pytroll#1692, we added an early return to abi_l1b.py's
get_dataset method when the requested calibration is "counts".

The problem is that the early return results in a number of missing
attributes in the object returned from get_dataset.

I also took the liberty of updating the unit tests to check for some of
the missing attributes, as well as including a test for invalid
calibration.

* Add myself to AUTHORS.md.

Should satisfy the pull request requirements.

* Add explicit copy() of raw counts

Also adjusted the formatting of test_abi_l1b.py so that it'll conform
with flake8 (and flake8-docstring).
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

3 participants