[AstroPy] Possible PyFITS behavior change with scaled data
embray at stsci.edu
Wed May 9 11:35:33 EDT 2012
Speaking of conversion of scaled image data to floats, I have a question
to put out there regarding the upcoming 3.0.8 release of PyFITS.
PyFITS 3.0.8 will fix a long-standing bug that's been around long enough
that I'm worried that some people might have workarounds for it in place
that will break now that the bug is fixed.
This specifically pertains to support for scaled images in image "sections".
For some background, PyFITS has a feature called "sections" that allows
accessing small portions of an image without reading the entire image
into memory at once. For example:
>>> hdul = pyfits.open('jb1f98q1q_raw.fits')
No. Name Type Cards Dimensions Format
0 PRIMARY PrimaryHDU 205 () int16
1 SCI ImageHDU 95 (4144, 2068) int16
array([[ 2278., 2252., 2248., ..., 2252., 2252., 2253.],
[ 2277., 2252., 2250., ..., 2255., 2253., 2258.],
[ 2277., 2257., 2250., ..., 2260., 2255., 2257.],
This reads the file in portions so that just the first 100x100 block of
pixels is read from disk.
This feature used to have very spotty/broken support for scaled image
data, but now that's been fixed.
Is that fact that this is now fixed likely to break anybody's code?
More information about the AstroPy