Menu
  • HOME
  • TAGS

Converting ASCII Table to FITS image

python,matlab,fits,pyfits

You should be able to do this mostly with Astropy. The details are a little vague, but you should be able to read the text file into an Astropy table like: >>> from astropy.table import Table >>> table = Table.read('/path/to/text/file.txt', format='ascii') where the options you end up passing to Table...

size of fits file before and after processing

python,pyfits

From http://docs.astropy.org/en/stable/io/fits/appendix/faq.html#why-is-an-image-containing-integer-data-being-converted-unexpectedly-to-floats If the header for your image contains non-trivial values for the optional BSCALE and/or BZERO keywords (that is, BSCALE != 1 and/or BZERO != 0), then the raw data in the file must be rescaled to its physical values according to the formula: physical_value = BZERO + BSCALE...

astropy.io.fits - HIERARCH keywords don't work with CONTINUE cards: Bug or “Feature” of the FITS standard?

python,fits,astropy,pyfits

I wrote this in the issue opened by the OP, but I'm copying a version of it here too as a possible answer: The issue here is that the CONTINUE convention is strictly limited to extending the value of cards with string values (i.e. it does not apply to cards...

Append columns to table, while preserving header

python,fits,pyfits

The best answer to this partly depends on how the new table is being created, but as of the latest version of PyFITS (v3.3.0) or Astropy (v0.4.2) the BinTableHDU.from_columns method, which creates a new BINARY table HDU from a set of column definitions accepts an optional header argument which can...