[AstroPy] writing 2D string column to fits binary table

Erik Bray embray at stsci.edu
Wed Jan 28 11:14:59 EST 2015


On 01/27/2015 06:27 PM, Stephen Bailey wrote:
> Alas, I always prefer to get back to vanilla ndarray objects as quickly as
> possible when doing I/O so that downstream algorithm code can rely on ndarray
> only, not on the particular I/O format from whence it came.

Understandable.

>  From your description, I think there are two separate astropy bug reports
> brewing here:
> 1. cosmetic: astropy.io.fits.writeto() shouldn't issue that warning since it
> actually is writing the file correctly

Easy to fix.

> 2. important: the conversion from the FITS_rec structure to the np.array is not
> converting the chararray() portion correctly to maintain the 2D nature of the
> string array.

Less easy, believe it or not.  There's not a lot of control over this without 
changing the data format.  The FITS_rec structure is extremely long in the tooth 
though and has long been planned for replacement, likely with the Astropy Table 
class.  I've been tasked with that work but it has been on the backburner behind 
other priorities.

Erik




More information about the AstroPy mailing list