Giter Site home page Giter Site logo

Comments (4)

esheldon avatar esheldon commented on August 20, 2024

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.

richardgmcmahon avatar richardgmcmahon commented on August 20, 2024

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.

esheldon avatar esheldon commented on August 20, 2024

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.

richardgmcmahon avatar richardgmcmahon commented on August 20, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.