Package nom.tam.fits.header
Interface IFitsHeader
- All Known Implementing Classes:
Checksum
,CommonExt
,Compression
,CXCExt
,CXCStclSharedExt
,DataDescription
,DateTime
,ESOExt
,FitsHeaderImpl
,FitsKey
,HierarchicalGrouping
,InstrumentDescription
,MaxImDLExt
,NOAOExt
,NonStandard
,ObservationDescription
,ObservationDurationDescription
,SBFitsExt
,Standard
,STScIExt
,WCS
public interface IFitsHeader
Interface for standardized header keyword implementations. Standardized header keys help with proper usage, with
restricted use and value types as appropriate. Using keywords that implement this interface make it less likely for
one to end up with inproperly constructed FITS files. Therefore, their usage is highly encouranged when possible.
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic enum
An enumeration of HDU types in which a header keyword may be used.static enum
Documentation sources for the various known conventions.static enum
Values types to which implementing keywords can be restricted to. -
Field Summary
Modifier and TypeFieldDescriptionstatic final int
Max numeric index we may use to replace n in the Java name of indexed variables. -
Method Summary
Modifier and TypeMethodDescriptiondefault String
comment()
Returns the comment associated to this FITS header entry.default int[]
extractIndices
(String key) Extracts the indices for this stndardized key from an actual keyword realization.default IFitsHeader.HDU
hdu()
Returns the type of HDU(s) in which this header entry may be used.default FitsKey
impl()
(primarily for internal use) Returns the concrete implementation of this header entry, which provides implementation of access methods.default String
key()
Returns the FITS header keyword (or keyword template) for this header entry.default IFitsHeader
n
(int... numbers) Constructs an indexed FITS header keyword entry from this stem, replacing index place-holders (indicated by lower-case 'n' in the name) with actual numerical values.default IFitsHeader.SOURCE
status()
Returns the standard convention, which defines this FITS header entrydefault IFitsHeader.VALUE
The type(s) of value(s) this FITS header entry might take.
-
Field Details
-
MAX_INDEX
static final int MAX_INDEXMax numeric index we may use to replace n in the Java name of indexed variables.- See Also:
-
-
Method Details
-
impl
(primarily for internal use) Returns the concrete implementation of this header entry, which provides implementation of access methods.- Returns:
- the implementation of this keyword, which provides the actual access methods. Implementations of this interface should simply return themselves.
- Since:
- 1.19
-
comment
Returns the comment associated to this FITS header entry. The comment is entirely optional, and it may not be appear in full (or at all) in the FITS header. Comments should thus never contain essential information. Their purpose is only to provide non-essential extra information for human use.- Returns:
- the associated standard comment.
- See Also:
-
hdu
Returns the type of HDU(s) in which this header entry may be used.- Returns:
- the HDU type(s) that this keyword may support.
-
key
Returns the FITS header keyword (or keyword template) for this header entry. Standard FITS keywords are limited to 8 characters, and contain only epper-case letters, numbers, hyphen, and underscore characters. Lower-case 'n' characters may be included as placeholders for indexing conventions that must be filled before the keyword may be used in headers and/or header cards.
- Returns:
- the FITS header keyword for this entry. The returned keyword may include an indexing pattern (lower-case
'n' characters), which may need to be filled via
n(int...)
before the keyword may be used to construct header cards or be used in FITS headers. (Alternative coordinate markers, via lower case 'a' at the end of the keyword definition, are stripped and should not be included in the returned keyword name pattern.) - See Also:
-
n
default IFitsHeader n(int... numbers) throws IndexOutOfBoundsException, NoSuchElementException, IllegalStateException Constructs an indexed FITS header keyword entry from this stem, replacing index place-holders (indicated by lower-case 'n' in the name) with actual numerical values. Numbering for FITS header keywords always starts from 1, and should never exceed 999. Note, that for keywords that have multiple indices, you may specify them all in a single call, or may use successive calls to fill indices in the order they appear (the latter is somewhat less efficient, but still entirely legal).- Parameters:
numbers
- the 1-based indices to add to the stem, in the order they appear in the the enum name.- Returns:
- an indexed instance of this FITS header entry
- Throws:
IndexOutOfBoundsException
- if the index is less than 0 or exceeds 999. (In truth we should throw an exception for 0 as well, but seems to be common not-quite-legal FITS usage with 0 indices. Hence we relax the condition).IllegalStateException
- if the resulting indexed keyword exceeds the maximum 8-bytes allowed for standard FITS keywords.NoSuchElementException
- If more indices were supplied than can be filled for this keyword.- See Also:
-
status
Returns the standard convention, which defines this FITS header entry- Returns:
- the standard or convention that specifies this FITS heacer keyword
-
valueType
The type(s) of value(s) this FITS header entry might take.- Returns:
- the value type(s) for this FITS header entry
-
extractIndices
Extracts the indices for this stndardized key from an actual keyword realization. The keyword realization must be match the indexing and/or alternative coordinate system pattern for this key, or else an exception will be thrown.- Parameters:
key
- The actual keyword as it appears in a FITS header- Returns:
- An array of indices that appear in the key, or
null
if the keyword is not one that can be indexed. - Throws:
IllegalArgumentException
- if the keyword does not match the pattern of this standardized FITS key- Since:
- 1.19
- See Also:
-