Uploaded image for project: 'Request For Comments'
  1. Request For Comments
  2. RFC-239

PropertyList should support missing values and possibly units

    XMLWordPrintable

    Details

    • Type: RFC
    • Status: Implemented
    • Resolution: Done
    • Component/s: DM
    • Labels:
      None

      Description

      PropertyList is how we perform FITS header I/O, but it does not support missing values, which are used in FITS headers to indicate items that have unknown value.

      Furthermore, it would be nice to have support for units as a separate field, though for FITS headers one must include that information as part of the comment.

      I am not necessarily proposing to do this work, but I felt I could at least get permission for it to be done.

        Attachments

          Issue Links

            Activity

            Hide
            tjenness Tim Jenness added a comment -

            Paul Price are you talking about:

            KEYWORD =       NaN / Floating point that came out wrong
            

            or

            KEYWORD =     'NaN' / not a number written out as a string
            

            ?

            Show
            tjenness Tim Jenness added a comment - Paul Price are you talking about: KEYWORD = NaN / Floating point that came out wrong or KEYWORD = 'NaN' / not a number written out as a string ?
            Hide
            price Paul Price added a comment -

            I think we want to be able to round-trip floating-point values, so we need to support NaN and +/- Inf. I don't think FITS supports these natively, so you have to write them as strings.

            Show
            price Paul Price added a comment - I think we want to be able to round-trip floating-point values, so we need to support NaN and +/- Inf . I don't think FITS supports these natively, so you have to write them as strings.
            Hide
            Parejkoj John Parejko added a comment -

            How does writing NAN/Inf as strings help? We would have to do some strange parsing internally, and they would break everything else externally. Plus, strings wouldn't even work for some keywords that must be a certain type.

            Show
            Parejkoj John Parejko added a comment - How does writing NAN/Inf as strings help? We would have to do some strange parsing internally, and they would break everything else externally. Plus, strings wouldn't even work for some keywords that must be a certain type.
            Hide
            price Paul Price added a comment -

            I don't want to hijack this thread, so let's take the NaN issue offline.

            Show
            price Paul Price added a comment - I don't want to hijack this thread, so let's take the NaN issue offline.
            Hide
            rowen Russell Owen added a comment -

            This RFC is accepted as follows:

            • PropertyList will be extended to support missing (unknown) values, in a way that is compatible with the FITS standard for header cards.
            • PropertySet need not not gain same support, but if it can be added without doing violence to the class, then it would help keep the classes more closely aligned.
            • Consider using None as the value for missing values in Python.
            • How important this is, and whether we can safely rely on it, depends partly on how pyfits handles headers with missing values. We know pyfits cannot write such headers, but we don't know what happens when it tries to read them.
            • Do not add support for units as part of this RFC. Feel free to make a new RFC for that.
            Show
            rowen Russell Owen added a comment - This RFC is accepted as follows: PropertyList will be extended to support missing (unknown) values, in a way that is compatible with the FITS standard for header cards. PropertySet need not not gain same support, but if it can be added without doing violence to the class, then it would help keep the classes more closely aligned. Consider using None as the value for missing values in Python. How important this is, and whether we can safely rely on it, depends partly on how pyfits handles headers with missing values. We know pyfits cannot write such headers, but we don't know what happens when it tries to read them. Do not add support for units as part of this RFC. Feel free to make a new RFC for that.

              People

              Assignee:
              rowen Russell Owen
              Reporter:
              rowen Russell Owen
              Watchers:
              John Parejko, Kian-Tat Lim, Paul Price, Russell Owen, Tim Jenness, Xiuqin Wu [X] (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Planned End:

                  CI Builds

                  No builds found.