Comments (4)
Hi Richard -
This is strange, because it works for me on the exact same file:
ext=1
infile='DES0226-0416_g.fits.fz'
image,hdr=fitsio.read(infile, ext=ext, header=True)
image.shape
(10000, 10000)
hdr
XTENSION= 'BINTABLE' / binary table extension
BITPIX = 8 / 8-bit bytes
NAXIS = 2 / 2-dimensional binary table
NAXIS1 = 32 / width of table in bytes
NAXIS2 = 10000 / number of rows in table
....
I did make some improvements recently, but I doubt those changes would affect
this issue. But you might try re-installing.
Are you sure that file is OK?
-e
from fitsio.
OK, there was a typeo in my report. I meant ext=0. This is a clue since in the fz files have an extra extension at the front ie. ext=0 has the image in the fits file but it is ext=1 in the fz file. Of course, you know all this. Maybe this was causing my pyfits problem too!
So we have:
infile='/data/des/Y1C2/DES0436-5748/DES0436-5748_i.fits.fz'
fits=fitsio.FITS(infile)
print fits
extnum hdutype hduname[v]
0 IMAGE_HDU
1 IMAGE_HDU COMPRESSED_IMAGE
2 IMAGE_HDU COMPRESSED_IMAGE
3 IMAGE_HDU COMPRESSED_IMAGE
infile=' /data/des/Y1C2/DES0436-5748/DES0436-5748_i.fits'
fits=fitsio.FITS(infile)
print fits
extnum hdutype hduname[v]
0 IMAGE_HDU
1 IMAGE_HDU
2 IMAGE_HDU
It might be worth adding this to the documentation.
regards richard
from fitsio.
Hi Richard -
I think what may be causing the confusion is that the fitsio.read() function
skips to the first extension that contains data when you have not sent an
explicit ext= keyword; so in this case it jumped to 1. I did document this in
the docs for read().
-e
from fitsio.
Ok, I was trying to dumbly looping through the extensions starting at 0 doing some stats, For .fz files you need to start at ext=1. r.
from fitsio.
Related Issues (20)
- Return requested row order rather than sorted
- Bug when installing fitsio in one of the new Apple M2 Max HOT 18
- 1.1.9 segfaults in test_table_read_write() on i586 HOT 3
- Image return None value HOT 13
- cfitsio build failure HOT 8
- GZIP_2 does not appear to do lossless compression HOT 4
- lossless gzip not finalizing wile FITS object is open
- Please consider forwarding cfitsio adjustments to upstream HOT 2
- Consider support for `numpy` 2 variable length string `StringDType`
- move to ruff for linter in order to help flag numpy2 issues HOT 1
- Build failures against NumPy 2.0 with GCC 14 HOT 8
- 1.2.2 on pypi? HOT 4
- fitsio error while pip installing HOT 5
- bzip and curl checks don't seem to be working
- CFITSIO changed license: incompatible with GPL HOT 14
- Error when using pip install for fitsio HOT 5
- Error when install fitsio on linux, both 'pip install fitsio' and 'python setup.py install' failed. HOT 5
- Issue with slicing HOT 5
- fits_hcompress.c HOT 4
- Licensing under the LGPL
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fitsio.