-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Loading image changes reported BITPIX value #1502
Comments
Do bscale or bzero exist in the header? On Oct 1, 2013, at 2:22 PM, rsiverd wrote:
|
Yes, both BSCALE and BZERO are present. This image is unsigned short (USHORT_IMG in CFITSIO), meaning BITPIX=16, On Tue, Oct 1, 2013 at 1:45 PM, perrygreenfield notifications@github.comwrote:
|
Closing as a duplicate--for now tickets need only be issued in one or the other. I will port them as necessary. |
Ah, I just saw your last comment @rsiverd. If they're expected to be scaled as unsigned integers open the file with I've been thinking of making this the default given that it's such a common convention. Problem is just that's a convention and not part of the FITS standard (which really should have added support for this formally just about forever ago). |
On Thu, Oct 10, 2013 at 3:22 PM, Erik Bray notifications@github.com wrote:
Perfect, thanks (just saw this). This is what I needed as it appears to |
Also reported to pyfits: spacetelescope/PyFITS#36
With current pyfits (3.1.2) or astropy (0.2.4), the act of reading an image into a numpy array appears to force the reported value of BITPIX to -32. If the image is actually integer (e.g., BITPIX=16), pyfits/astropy.io.fits reports an incorrect BITPIX value when checked after loading pixel data.
This affects normal and Rice-compressed images. Floating-point (BITPIX -32) images are "unaffected." I suspect this is not the intended behavior.
Test image available here:
http://astro.phy.vanderbilt.edu/~siverdrj/survey11n.e.20100613.061.fits.fz
Output:
BITPIX (before): 16
BITPIX (after): -32
Comparison: False
The text was updated successfully, but these errors were encountered: