Skip to content

impl fitsio::tables::ReadsCol for OSString #246

Description

@d3v-null

Hello,
I've had the misfortune of encountering a fits file in which random non-utf8 junk bytes are present after a null byte in a string column.
Because fitsio impls ReadsCol for String, but not OSString, this means that it can't read these columns at all.

Here's what the data looks like in Python:

>>> from astropy.io import fits
>>> hdus=fits.open('file.uvf')
>>> print(repr(hdus['AIPS AN'].data['ANNAME'][0]))
b's0000\x00\xff\xff'

The first ANNAME should just be s0000. If there were an impl OSString, I could trim these junk bytes before converting to string and read the column correctly.

Thanks

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions