-
Notifications
You must be signed in to change notification settings - Fork 160
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
_stretch_im
not working as intended
#743
Comments
Also in trouble shooting realizing our tests involving the stretch image function need to be updated! They don't test for what the parameter actually does, unless I'm misreading them. I think this is why the faulty stretch never tripped any errors. |
https://gist.github.com/nkorinek/e566788685c453174d6920829d4b5829 gist demonstrating the issue better then I described it @lwasser |
just a note on this from the matplotlib docs:. Note below that MPL accepts either 0-255 as an int format or 0-1 as a float. this is fairly standard. Often images are stored as int and the data are scaled. this is because storing ints is less space (smaller file size) vs storing floats. so either is acceptable. You get into trouble when you try to give mpl floats that have values beyond 0-1 or 0-255 as it struggles to map the values the way you'd expect to a colormap object. More below. So i wouldn't worry about the 0-1 values as much as the image stretch looking icky. We should consider adding (in the future as an enhancement) different types of stretch that may better account for issues in image intensity across bands. linear will not fix all images visually the way we want it to. i do see some other issues with plot_rgb that are bugs (adam's) that we may want to prioritize before this one UNLESS you do really see a bug in the code. i do like the ideas we discussed of updating the lesson a bit to explain why that image looks so funky and perhaps adding an image that stretches a bit more nicely could be good too (or link to the NAIP lesson that shows this nicely there).
|
When using the
stretch
parameter of earthpy'splot_rgb
function, the resulting image is not what is expected. It's supposed to be the original array with the values stretched to show contrast better, but instead it's an array from 0-1 of very odd values. I think the function is returning the scalar (I'm pretty sure) and we need to instead multiply the return of that function by the original array. Going from this:to this:
Testing seems to show this working
The text was updated successfully, but these errors were encountered: