[AstroPy] writing 2D string column to fits binary table
Erin Sheldon
erin.sheldon at gmail.com
Tue Jan 27 22:38:42 EST 2015
On 1/27/15, Bob Garwood <bgarwood at nrao.edu> wrote:
>> Hi Stephen -
>>
>> Interesting, compare this to the cfitsio manual
>>
>> http://heasarc.nasa.gov/docs/software/fitsio/c/c_user/node24.html
>>
>> So this may be cfitsio specific, and perhaps something we should
>> work around
>> in fitsio.
>>
>>
>> Gack. My interpretation of that is that cfitsio is violating the FITS
>> standard by doing something crazy with padding and stripping spaces.
>> If you have some way of working around that in fitsio, that would be
>> great.
>
> My interpretation of this section of the cfitsio manual is that this
> only applies to header values and ascii tables. I think there are no
> such limits for binary tables (but the documentation isn't quite
> explicit in that regards and I haven't tested it to see).
It certainly applies to binary tables too; that section is for all tables. It
does throw the word ASCII around a lot, but that is referring to the data.
I agree discussion with Bill Pence is a good idea.
It is a simple change to the CFITSIO code to get the behavior we want: pad
with nulls instead of spaces. I just did this in the fitsio codebase (which
embeds cfitsio) in a one line change and it works as expected.
-e
--
Erin Scott Sheldon
Brookhaven National Laboratory erin dot sheldon at gmail dot com
More information about the AstroPy
mailing list