Uploaded image for project: 'Data Management'
  1. Data Management
  2. DM-8100

Determine what astropy.io.fits does with FITS header cards for missing data

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Done
    • Resolution: Done
    • Fix Version/s: None
    • Component/s: Third Party Software
    • Labels:
      None
    • Story Points:
      1
    • Sprint:
      Arch 2019-04-08
    • Team:
      Architecture

      Description

      As part of implementing RFC-239 determine how astropy.io.fits handles FITS header cards with missing (unknown) values. I am virtually certain it cannot write such cards, but what happens when it tries to read them?

      This will inform implementation of RFC-239.

        Attachments

          Issue Links

            Activity

            Hide
            tjenness Tim Jenness added a comment -

            Astropy does it by having a astropy.io.fits.card.Undefined special value. That strikes me as really unhelpful since it doesn't behave like any other value that you might expect. It also acts like it's True so you can't say if "FILTER" in header and header["FILTER"]: but have to have special code for dealing with is Undefined.

            Show
            tjenness Tim Jenness added a comment - Astropy does it by having a astropy.io.fits.card.Undefined special value. That strikes me as really unhelpful since it doesn't behave like any other value that you might expect. It also acts like it's True so you can't say if "FILTER" in header and header ["FILTER"] : but have to have special code for dealing with is Undefined .
            Hide
            tjenness Tim Jenness added a comment -

            I have filed a pull request on Astropy to change the behavior such that FITS undefined value maps to None in python: https://github.com/astropy/astropy/pull/8572

            Show
            tjenness Tim Jenness added a comment - I have filed a pull request on Astropy to change the behavior such that FITS undefined value maps to None in python: https://github.com/astropy/astropy/pull/8572
            Hide
            tjenness Tim Jenness added a comment -

            Astropy accepted my pull request. Now Astropy and PropertyList translate python None to FITS undefined and vice versa.

            Show
            tjenness Tim Jenness added a comment - Astropy accepted my pull request. Now Astropy and PropertyList translate python None to FITS undefined and vice versa.

              People

              Assignee:
              tjenness Tim Jenness
              Reporter:
              rowen Russell Owen
              Watchers:
              Fritz Mueller, Kian-Tat Lim, Russell Owen, Tim Jenness
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Jenkins Builds

                  No builds found.