FIX: Image scaling for large dynamic range ints#10133
FIX: Image scaling for large dynamic range ints#10133dopplershift merged 1 commit intomatplotlib:masterfrom
Conversation
|
Yeah, understood. This is the dumbest solution. I don't quite understand why this rescaling is necessary, despite the nice comments.... |
|
OK, I only used the bigger float64 if the amin-amax > 1e8. |
|
I think(?) you probably care more about maxabs/minabs. |
|
Hmmm, not at all sure, because I once understood all the low-level reps of floats etc, but not so good at it anymore. Happy if someone wants to pick this up and do it better. But, I think the error comes in when we do: matplotlib/lib/matplotlib/image.py Lines 389 to 390 in 884060a and the resulting float doesn't preserve all the bits in the |
|
This is a reasonable approach. The scaling is to be able to track the over/under pixels and get around ringing in the interpolations. |
|
Discussed this on the phone call. Will investigate
|
5415e6a to
9ba75dc
Compare
|
Test added, and changes requested above made... Thanks! |
dopplershift
left a comment
There was a problem hiding this comment.
Working and slow is better than broken and fast. Happy to merge a future PR that keeps things working and makes it faster.
Backport PR #10133 on branch v2.1.x
PR Summary
This fixes #10072.
The problem was that for a uint32 image, the dynamic range was too high for a float32 to properly represent. Simply changing to float64 fixes the issue. I suppose someone could use a unit64 image, but...
Test coming: code:
PR Checklist