Class HeaderCards

java.lang.Object
uk.ac.starlink.oldfits.HeaderCards

public class HeaderCards extends Object
Controlled access to a collection of FITS header cards. Currently decorates the Header class, but could be implemented on top of some other (possibly custom) header cards parser implementation.
Since:
12 Nov 2007
Author:
Mark Taylor
  • Field Details

    • BORING_KEYS

      public final String[] BORING_KEYS
      Keywords which are never used as table parameters.
  • Constructor Details

    • HeaderCards

      public HeaderCards(nom.tam.fits.Header hdr)
      Constructor.
      Parameters:
      hdr - FITS header object
  • Method Details

    • getIntValue

      public Integer getIntValue(String key)
      Returns the integer value for a card with a given key.
      Parameters:
      key - header keyword
      Returns:
      integer value, or null
    • getLongValue

      public Long getLongValue(String key)
      Returns the long value for a card with a given key.
      Parameters:
      key - header keyword
      Returns:
      long value, or null
    • getDoubleValue

      public Double getDoubleValue(String key)
      Returns the double value for a card with a given key.
      Parameters:
      key - header keyword
      Returns:
      double value, or null
    • getStringValue

      public String getStringValue(String key)
      Returns the string value for a card with a given key.
      Parameters:
      key - header keyword
      Returns:
      string value, or null
    • useKey

      public void useKey(String key)
      Marks a given keyword as used. This is invoked by all the get*Value methods.
      Parameters:
      key - header keyword
    • containsKey

      public boolean containsKey(String key)
      Indicates whether the header collection contains a card with the given keyword.
      Parameters:
      key - header keyword
      Returns:
      true iff key is present
    • getUnusedParams

      public uk.ac.starlink.table.DescribedValue[] getUnusedParams()
      Returns an array of DescribedValue objects suitable for use as items of per-table metadata derived from this FITS header. This contains entries for every card which has not already been queried within this object (for which useKey(java.lang.String) has not been explicitly or implicitly called. Certain standard structural FITS keywords (BORING_KEYS) are ignored as well.

      The idea is that keywords which have already been read to determine table structure do not need to be recorded separately since their meaning is implicitly included in the table metadata already.

      Returns:
      array of table parameters relating to this object