#11 pdl fits writer bug truncates strings

closed-fixed
other (94)
5
2001-01-18
2000-11-08
Anonymous
No

nature: 100% reproducible
Bug context:
the PDL command "wfits" allows the user to store strings in a fits format file, via the use of gethdr and sethdr. I decide to try to use this facilty to store long strings describing my data. I created the strings using Data::Dumper.

here's how to create the bug:
use Data::Dumper to store a multi-level hash into a string and place this string in the piddle header hash.

you can read it back so you know this step worked.

Next write it to a fits format file using wfits.

now read the fits file and recover the stored string. you will see that it is truncated.

Perhaps there is undocumented limit of the size of strings in the fits file format?

Discussion

  • Doug Burke

    Doug Burke - 2000-12-10

    The FITS standard does limit the size of the
    data - I forget the limit, but it's less
    than ~ 70 chars (the header is stored at the start of the file in ASCII, with keyword, value, and comment having to fit in 80 chars).

    There is a standard for having multi-line values, but wfits/rfits doesn't know about it.

    A more-indepth FITS package is CFITSIO (available on CPAN), but you need to install an external library and it's not not got a nice, simple, FITS interface. You could save your strings to a file, and save the file names in the FITS header.

     
  • Doug Burke

    Doug Burke - 2001-01-18
    • assigned_to: nobody --> djburke
    • labels: 100100 --> other
    • status: open --> closed-fixed
     

Log in to post a comment.