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 cira stretch upcasting the data #2956

Merged
merged 2 commits into from
Oct 25, 2024

Conversation

pnuu
Copy link
Member

@pnuu pnuu commented Oct 25, 2024

The cira_stretch does a upcast on the data from float32 to float64. This PR changes the _cira_stretch so that the small values are clipped in float64 base and passed on to np.log10() as such, which returns the data as the dtype of the input data.

The match_dtype kwarg was added to run_and_check_enhancement() helper function in enhancement tests. This could be added to other where applicable. I first added the dtype tests to all calls, but there were some int64 input data and didn't want to figure out which tests expect the dtype to stay the same and which enhancements expect it to change.

  • Tests added

Copy link

codecov bot commented Oct 25, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.09%. Comparing base (a4b8c8d) to head (5169923).
Report is 4 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2956   +/-   ##
=======================================
  Coverage   96.09%   96.09%           
=======================================
  Files         377      377           
  Lines       55074    55089   +15     
=======================================
+ Hits        52924    52939   +15     
  Misses       2150     2150           
Flag Coverage Δ
behaviourtests 3.94% <0.00%> (-0.01%) ⬇️
unittests 96.19% <100.00%> (+<0.01%) ⬆️

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

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

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.

Thanks for fixing this! One request inline.

satpy/tests/enhancement_tests/test_enhancements.py Outdated Show resolved Hide resolved
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, nice one with splitting up the test function!

@coveralls
Copy link

Pull Request Test Coverage Report for Build 11515862200

Details

  • 25 of 25 (100.0%) changed or added relevant lines in 2 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.001%) to 96.203%

Totals Coverage Status
Change from base Build 11485792071: 0.001%
Covered Lines: 53183
Relevant Lines: 55282

💛 - Coveralls

@mraspaud mraspaud merged commit 309c874 into pytroll:main Oct 25, 2024
18 checks passed
@pnuu pnuu deleted the bugfix-cira-stretch-upcast branch October 25, 2024 11:26
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.

4 participants