Package uk.ac.starlink.oldfits
Class HeaderCards
java.lang.Object
uk.ac.starlink.oldfits.HeaderCards
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 Summary
FieldsModifier and TypeFieldDescriptionfinal String[]
Keywords which are never used as table parameters. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
containsKey
(String key) Indicates whether the header collection contains a card with the given keyword.getDoubleValue
(String key) Returns the double value for a card with a given key.getIntValue
(String key) Returns the integer value for a card with a given key.getLongValue
(String key) Returns the long value for a card with a given key.getStringValue
(String key) Returns the string value for a card with a given key.uk.ac.starlink.table.DescribedValue[]
Returns an array of DescribedValue objects suitable for use as items of per-table metadata derived from this FITS header.void
Marks a given keyword as used.
-
Field Details
-
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
Returns the integer value for a card with a given key.- Parameters:
key
- header keyword- Returns:
- integer value, or null
-
getLongValue
Returns the long value for a card with a given key.- Parameters:
key
- header keyword- Returns:
- long value, or null
-
getDoubleValue
Returns the double value for a card with a given key.- Parameters:
key
- header keyword- Returns:
- double value, or null
-
getStringValue
Returns the string value for a card with a given key.- Parameters:
key
- header keyword- Returns:
- string value, or null
-
useKey
Marks a given keyword as used. This is invoked by all theget*Value
methods.- Parameters:
key
- header keyword
-
containsKey
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
-