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

Include gradient/axisintercept for mode p #2870

Merged

Conversation

gerritholl
Copy link
Collaborator

@gerritholl gerritholl commented Aug 5, 2024

NinJo expects palette images to include gradient and axisintercept with values 1 and 0, respectively.

Needs #2874 to be merged first.

I needed to include some workarounds for #2300.

NinJo wants that gradient=1 and axisintercept=0 for images of mode p.
It shall be so.
Copy link

codecov bot commented Aug 5, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.05%. Comparing base (5e27be4) to head (ea7d8d2).
Report is 291 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2870   +/-   ##
=======================================
  Coverage   96.05%   96.05%           
=======================================
  Files         370      370           
  Lines       54320    54332   +12     
=======================================
+ Hits        52177    52189   +12     
  Misses       2143     2143           
Flag Coverage Δ
behaviourtests 3.99% <0.00%> (-0.01%) ⬇️
unittests 96.15% <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.

@coveralls
Copy link

coveralls commented Aug 5, 2024

Pull Request Test Coverage Report for Build 10528439571

Details

  • 15 of 15 (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.152%

Totals Coverage Status
Change from base Build 10528275069: 0.001%
Covered Lines: 52420
Relevant Lines: 54518

💛 - Coveralls

In the ninjogeotiff writer, when testing p-mode images, add an
enhancement history such as palettize would add, to get a more realistic
test.
For ninjogeotiff mode p, force scale/offset to be 1 and 0, respectively.

As a workaround for pytroll#2300, do not
check image.mode, but use image.data.attrs["mode"] instead.
@gerritholl gerritholl marked this pull request as ready for review August 8, 2024 14:38
The fallback/workaround to use image.data.attrs["mode"] instead of
image.mode can and should only be used after to_image has been called.
Before to_image has been called, the former is unavailable and the
latter is reliable, I think.
@gerritholl gerritholl force-pushed the feature-ninjogeotiff-p-mode-gradient branch from b675cbf to 2440dc0 Compare August 8, 2024 16:05
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

@mraspaud mraspaud added enhancement code enhancements, features, improvements component:writers labels Oct 17, 2024
@mraspaud mraspaud merged commit c245cab into pytroll:main Oct 17, 2024
17 of 18 checks passed
@gerritholl gerritholl deleted the feature-ninjogeotiff-p-mode-gradient branch October 17, 2024 09:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component:writers enhancement code enhancements, features, improvements
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ninjogeotiff writer should write gradient for P mode images
3 participants