public class FitsHeader
extends java.lang.Object
The FITS 4.0 long-string syntax is supported.
Modifier and Type | Field and Description |
---|---|
java.lang.String[] |
BORING_KEYS
Keywords which are never used as table parameters.
|
Constructor and Description |
---|
FitsHeader(ParsedCard<?>[] cards)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
java.lang.Boolean |
getBooleanValue(java.lang.String key)
Returns the boolean value for a card with a given key,
if one exists.
|
ParsedCard<?>[] |
getCards()
Returns the header cards of which this header is composed.
|
long |
getDataBlockCount()
Returns the number of FITS blocks occupied by the Data part of the
HDU described by this header.
|
long |
getDataByteCount()
Returns the number of bytes occupied by the Data part of the
HDU described by this header,
rounded up to an integer number of blocks.
|
DescribedValue |
getDescribedValue(java.lang.String key)
Returns the content of a card with a given key as a DescribedValue,
if such a key exists.
|
java.lang.Double |
getDoubleValue(java.lang.String key)
Returns the double value for a card with a given key,
if one exists.
|
long |
getHeaderBlockCount()
Returns the number of FITS blocks occupied by this header.
|
long |
getHeaderByteCount()
Returns the number of bytes occupied by this header,
rounded up to an integer number of blocks.
|
java.lang.Integer |
getIntValue(java.lang.String key)
Returns the integer value for a card with a given key,
if one exists.
|
java.lang.Long |
getLongValue(java.lang.String key)
Returns the long value for a card with a given key,
if one exists.
|
java.lang.Number |
getNumberValue(java.lang.String key)
Returns a numeric value for a card with a given key,
if one exists.
|
int |
getRequiredIntValue(java.lang.String key)
Returns an integer value for a card with a given key,
or throws an exception if none exists.
|
long |
getRequiredLongValue(java.lang.String key)
Returns a long value for a card with a given key,
or throws an exception if none exists.
|
java.lang.String |
getRequiredStringValue(java.lang.String key)
Returns a long value for a card with a given key,
or throws an exception if none exists.
|
java.lang.String |
getStringValue(java.lang.String key)
Returns the string value for a card with a given key,
if one exists.
|
DescribedValue[] |
getUnusedParams()
Returns an array of DescribedValue objects suitable for use as
items of per-table metadata derived from this FITS header.
|
java.lang.Object |
getValue(java.lang.String key)
Returns the untyped value for a card with a given key,
if one exists.
|
void |
useKey(java.lang.String key)
Marks a given keyword as used.
|
public final java.lang.String[] BORING_KEYS
public FitsHeader(ParsedCard<?>[] cards)
cards
- header cards composing the headerpublic ParsedCard<?>[] getCards()
public java.lang.Object getValue(java.lang.String key)
key
- header keywordpublic DescribedValue getDescribedValue(java.lang.String key)
ValueInfo.getDescription()
.key
- header keywordpublic java.lang.Integer getIntValue(java.lang.String key)
key
- header keywordpublic java.lang.Long getLongValue(java.lang.String key)
key
- header keywordpublic java.lang.Double getDoubleValue(java.lang.String key)
key
- header keywordpublic java.lang.Number getNumberValue(java.lang.String key)
key
- header keywordpublic java.lang.Boolean getBooleanValue(java.lang.String key)
key
- header keywordpublic java.lang.String getStringValue(java.lang.String key)
key
- header keywordpublic int getRequiredIntValue(java.lang.String key) throws HeaderValueException
key
- header keywordHeaderValueException
- if no suitable card existspublic long getRequiredLongValue(java.lang.String key) throws HeaderValueException
key
- header keywordHeaderValueException
- if no suitable card existspublic java.lang.String getRequiredStringValue(java.lang.String key) throws HeaderValueException
key
- header keywordHeaderValueException
- if no suitable card existspublic void useKey(java.lang.String key)
get*Value
methods.key
- header keywordpublic long getHeaderBlockCount()
public long getDataBlockCount() throws HeaderValueException
HeaderValueException
public long getHeaderByteCount()
getHeaderBlockCount()
* 2880public long getDataByteCount() throws HeaderValueException
getDataBlockCount()
* 2880HeaderValueException
public DescribedValue[] getUnusedParams()
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.