_ImageBaseHDU._get_scaled_image_data returns a raw data if bzero==0 and bscale==1 even though blank is not None#993
Conversation
…nd bscale==1 even though blank is not None
|
Thanks for looking into this. This is not a problem just for BLANK, but also for BZERO and/or BSCALE (really, any header keywords that affect how the data should be read). I'm thinking maybe On the other hand, I have had in mind for a while (I think there's a Trac ticket for it somewhere) a special ndarray subclass of FITS images that incorporates all the scaling issues and can do so on a per-element basis (perhaps with optional caching of the results). That would allow this to work a little more transparently, even with mmap. |
|
Related to #2307. |
|
Just remembered about this PR. As @mdboom wrote #2307 added the suggested
I think a |
This PR is to trigger discussion regarding the memmap support.
With the above code, I expected
f[0].datareturns a memmap'd numpy array, but it does not for files w/ "BLANK" header values. And I think this is something that needed to be fixed.I think there are a few ways to fix this.
ignore_blank.On the other hand, wouldn't it be good to have a method like
get_raw_data(similar to_get_raw_databut with a simpler signature)?