[AstroPy] fits table column values

Evert Rol evert.rol at gmail.com
Mon Dec 23 11:39:00 EST 2013

 Hi Jon,

I think you can use a table perfectly fine. Though I'm not used to FITS tables, you can afaik store vectors there as well, so a floating point 3-vector for each entry could work. In HDF 5, a simple compound table with x, y and z floating points column works also fine (which is what I'd use).
If you want to go the image way, you probably need a second "flag" image to indicate the valid pixels. But yes, you'd get (a lot of) non-essential data.
I assume you only want FITS to store the data; not use it to inspect the data in e.g. DS9.

In fact, rereading about the FITS vector tables, perhaps you can just create an 3 x N image, with N your number of points and the other axis indicating x, y and z. So each pixel contains the x, y or z value (essentially thus the table disguised as an image); just what you feel comfortable with. (Though I'd be curious to hear if there are objections against this approach).



> Hi all,
> Maybe I'm being dense today, but I'm not clear on how to do something pretty basic.  The issue is that I have essentially 3-D data wherein the data is not known on a uniform grid.  That is, although the data is on an x-y grid, neither the x values nor the y values are uniform.  I want to save the values (i.e. z values) at each point in the grid in a fits file.  The natural thing to do is either create an image or a table, but specifying the grid is not quite so straightforward in either case.  For a table one could have one column be an axis (e.g. 'y') and save the y values, but then the x values are the table column 'names', which I think have to be strings.  Nothing is fundamentally unworkable about that, it's just a little awkward to have string versions of the numeric axis values.  If I output an image instead, then I'm left with specifying the grid locations in the header.
> So, I do have ways of doing what I want to do, but it just seems that the ways I've thought of are not the simplest ways.  And I wonder if there isn't some other way that I haven't thought of.  Any hints on this would be appreciated.  Maybe some other output format (e.g. hdf5) would be better?
> Jon
> -- 
> ________________________________________________________
> Jonathan D. Slavin                 Harvard-Smithsonian CfA
> jslavin at cfa.harvard.edu       60 Garden Street, MS 83
> phone: (617) 496-7981       Cambridge, MA 02138-1516
> fax: (617) 496-7577            USA
> ________________________________________________________
> _______________________________________________
> AstroPy mailing list
> AstroPy at scipy.org
> http://mail.scipy.org/mailman/listinfo/astropy

More information about the AstroPy mailing list