Closed rajgiriUW closed 3 years ago
I agree that np.nan failures are not necessarily wanted, especially when plotting because it is how we specify 'dead' pixels that should not be plotted. Thanks for the PR.
Thanks Rama. Addressed in #125 , closing
Where there are NaN values, I saw that get_exponent will return an error as you can't cast a
NaN
asint
. I'm wondering what should be the correct use case here?Specifically
get_exponent
innum_utils
. This situation comes up if usingplot_map
and there are NaNs in the image, as often happens in cases where you miss a pixel, or if you happen to have a sparsely-sampled image in certain processing methods.Suggestion 1 is return np.NaN in num_utils (add a check for if the source vector contains a NaN or not) Suggestion 2 is have to change plot_map to check the correct range (i.e. find the max of only non-NaN pixels in the image).
I will suggest and make a PR with something like fix 2 this afternoon and maybe have get_exponent throw an error with a message if the source vector contains a NaN (so it's more obvious what the error is).