Package uk.ac.starlink.fits
Class HeaderCards
- java.lang.Object
-
- uk.ac.starlink.fits.HeaderCards
-
public class HeaderCards extends java.lang.Object
Controlled access to a collection of FITS header cards. Currently decorates theHeader
class, but could be implemented on top of some other (possibly custom) header cards parser implementation.- Since:
- 12 Nov 2007
- Author:
- Mark Taylor
-
-
Field Summary
Fields Modifier and Type Field Description java.lang.String[]
BORING_KEYS
Keywords which are never used as table parameters.
-
Constructor Summary
Constructors Constructor Description HeaderCards(nom.tam.fits.Header hdr)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
containsKey(java.lang.String key)
Indicates whether the header collection contains a card with the given keyword.java.lang.Double
getDoubleValue(java.lang.String key)
Returns the double value for a card with a given key.java.lang.Integer
getIntValue(java.lang.String key)
Returns the integer value for a card with a given key.java.lang.Long
getLongValue(java.lang.String key)
Returns the long value for a card with a given key.java.lang.String
getStringValue(java.lang.String key)
Returns the string value for a card with a given key.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.void
useKey(java.lang.String key)
Marks a given keyword as used.
-
-
-
Method Detail
-
getIntValue
public java.lang.Integer getIntValue(java.lang.String key)
Returns the integer value for a card with a given key.- Parameters:
key
- header keyword- Returns:
- integer value, or null
-
getLongValue
public java.lang.Long getLongValue(java.lang.String key)
Returns the long value for a card with a given key.- Parameters:
key
- header keyword- Returns:
- long value, or null
-
getDoubleValue
public java.lang.Double getDoubleValue(java.lang.String key)
Returns the double value for a card with a given key.- Parameters:
key
- header keyword- Returns:
- double value, or null
-
getStringValue
public java.lang.String getStringValue(java.lang.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(java.lang.String key)
Marks a given keyword as used. This is invoked by all theget*Value
methods.- Parameters:
key
- header keyword
-
containsKey
public boolean containsKey(java.lang.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 whichuseKey(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
-
-