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

Preservation of input data dtype in processing FCI data #2647

Closed
pnuu opened this issue Nov 23, 2023 · 13 comments
Closed

Preservation of input data dtype in processing FCI data #2647

pnuu opened this issue Nov 23, 2023 · 13 comments

Comments

@pnuu
Copy link
Member

pnuu commented Nov 23, 2023

Recently we've been creating a lot of pull requests to make Satpy preserve the data type of the FCI input data as long as possible. The main thing is not to convert float32 data to float64 without a good reason to make processing to use less memory and be faster in general when the arrays are not converted back and forth.

This issue collects all of the issues/pull requests together.

Readers

Satpy

Compositors and related packages

Satpy

Enhancements and related packages

Trollimage

Modifiers and related packages

Satpy

Pyspectral

@pnuu
Copy link
Member Author

pnuu commented Nov 23, 2023

I also checked that saving in trollimage.xrimage.XRImage doesn't do any up-casting internally, but this is not tested as far as I can tell.

@pnuu
Copy link
Member Author

pnuu commented Nov 28, 2023

Trollimage and Pyspectral have been released with the above updates, Satpy release remaining.

@mraspaud
Copy link
Member

@pnuu could you make a short summary here of the performance benefits of this work?

@pnuu
Copy link
Member Author

pnuu commented Nov 28, 2023

I'll run a benchmark with the releases before these changes were made and with the latest versions (main for Satpy) and post in a bit.

@pnuu
Copy link
Member Author

pnuu commented Nov 28, 2023

Benchmarks.

For both cases:

  • Dask workers: 4
  • OMP threads: 1
  • GDAL threads: 4
  • Dask chunk size: 2097152
  • FCI L1c data, both FDHSI and HRFI file supplied
  • 3 RGB composites using GenericCompositor
  • 1 composite using GenericCompositor saved as float32
  • 7 composites using DayNightCompositor, only day or night side shown, the other side is transparent
  • load the composites with compute=False
  • resampling gradient_search
  • saved as COG images

Using previous released versions:

  • Trollimage: 1.21.0
  • Pyspectral: 0.12.5
  • Satpy: 0.44.0

Screenshot 2023-11-28 at 14-36-31 Bokeh Plot

With the changes listed in this issue:

  • Trollimage: 1.22.2
  • Pyspectral: 1.13.0
  • Satpy main, commit a1c3b13

Screenshot 2023-11-28 at 14-23-10 Bokeh Plot

@pnuu
Copy link
Member Author

pnuu commented Nov 28, 2023

I noticed that there were two PRs not listed here that affected the performance:

I'll run the test with these fixes incrementally keeping the other packages at their previous release versions.

@pnuu
Copy link
Member Author

pnuu commented Nov 28, 2023

Without #2617 and #2634 (commit f189402): similar to v0.44.0

With #2617 (commit 86c075a):

Screenshot 2023-11-28 at 15-13-02 Bokeh Plot

With #2634 (commit e43f3fa):

Screenshot 2023-11-28 at 15-24-12 Bokeh Plot

@pnuu
Copy link
Member Author

pnuu commented Nov 28, 2023

Meh, tracking the merge order is too tedious to see what happened when. In any case, the removal of duplicates from the FCI reader config shouldn't have that much of a effect compared to the previous case.

@pnuu
Copy link
Member Author

pnuu commented Nov 28, 2023

Still missed one: #2623 . I bet this was merged between #2617 and #2634 and made the big jump in performance.

@pnuu
Copy link
Member Author

pnuu commented Nov 29, 2023

Yep, that explains the jump.

Before #2623 (commit 14f59c4)
Screenshot 2023-11-29 at 08-26-20 Bokeh Plot

With #2623 (commit d59e467)
Screenshot 2023-11-29 at 08-22-18 Bokeh Plot

@pnuu pnuu changed the title Preservation of input data dtype Preservation of input data dtype in processing FCI data Nov 29, 2023
@mraspaud
Copy link
Member

Thanks for driving this @pnuu !

@ameraner
Copy link
Member

Summarising, if I see this correctly, with satpy>=v0.45.0, pyspectral>=v0.13.0 and trollimage>=1.22.2 one should get all improvements

@pnuu
Copy link
Member Author

pnuu commented Nov 29, 2023

Summarising, if I see this correctly, with satpy>=v0.45.0, pyspectral>=v0.13.0 and trollimage>=1.22.2 one should get all improvements

Yes, that's correct.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants