| Overview | Package | Class | Tree | Deprecated | Index | Help | |||
| PREV CLASS | NEXT CLASS | FRAMES | NO FRAMES | ||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||
java.lang.Object
|
+--java.util.Dictionary
|
+--java.util.Hashtable
|
+--ncsa.horizon.util.Metadata
|
+--ncsa.horizon.coordinates.CoordMetadata
|
+--ncsa.horizon.coordinates.FITSCoordMetadata
This class provides a variety of methods that makes it easy load FITS metadata with the correct type. As the are loaded, they are converted values and types defined by the horizon schema so that they can be used by the horizon coordinate classes.
One should note that the FITS metadata format/schema uses the convention of numbering axes beginning with 1, in contrast to the horizon schema which numbers axes beginning with 0. Methods in this class that take an axis number as an argument assume the FITS convention (subtracting 1 from the input value when converting to the horizon schema).
The majority of methods provided by this class give the user a way of
saving individual metadata values; these are methods like
setNAXIS() and setCTYPE(). It also
provides a few methods for parsing out FITS headers for
coordinate-related data. These include scanHeaderLine()
which parses a single line from the header, and scanHeader
for parsing an entire header from an input stream. The
modernize() method is used for converting depricated FITS
keywords into their current alternatives. Finally, after the metadata
list is fully loaded, one can use the createCoordSys() method
to create the CoordinateSystem object the metadata describe.
| Field Summary | |
| static AxisPosFormatter | defaultDecFormatter
|
| static AxisPosFormatter | defaultLinearFormatter
|
| static AxisPosFormatter | defaultRAFormatter
|
| Fields inherited from class ncsa.horizon.coordinates.CoordMetadata | |
| Axes, axisSchema, formatter, horizonSchema, label, name, naxes, refoffset, refposition, refvalue, stepsize, type, version | |
| Fields inherited from class ncsa.horizon.util.Metadata | |
| defaults, executeRunners, METARUNNER_TAG, schema, schemaVersion | |
| Constructor Summary | |
| FITSCoordMetadata()
Construct a CoordMetadata list for a FITS image |
|
| FITSCoordMetadata(int naxes,
Metadata defaults)
Creates an metadatum list for a coordinate system with naxes axes |
|
| FITSCoordMetadata(int naxes)
Creates an empty metadatum list with specified defaults. |
|
| FITSCoordMetadata(Metadata defaults)
Creates an empty metadatum list with specified defaults. |
|
| Method Summary | |
| static CoordinateSystem | createCoordSys(Metadata md)
create the coordinate system described by a metadata set. |
| CoordinateSystem | createCoordSys()
create the coordinate system described by this metadata set. |
| static java.lang.String | FITSkeyval(java.lang.String line)
return the value portion of a key-value pair from FITS header line. |
| static Metavector | getIdentityPCMatrix(int n)
return a Metavector object containing a PCMatrix whose values are equal to 1 on the diagonal and 0 otherwise. |
| static java.lang.String | getLONLATName(char c)
return the name horizon gives to various kinds of longitude and latitude based on the first letter of the CTYPE string. |
| static int | getNAXIS(Metadata md)
return the value of FITS keyword NAXIS, the number of axes in the dataset |
| int | getNAXIS()
return the value of FITS keyword NAXIS, the number of axes in the dataset |
| static void | main(java.lang.String[] args)
|
| static void | modernize(Metadata md)
convert deprecated metadata into their modern alternatives. |
| void | modernize()
convert deprecated metadata into their modern alternatives. |
| static java.lang.String | parseAfterDash(java.lang.String ctype)
return the string appearing after one or more dashes in a string |
| static java.lang.String | scanHeaderCard(Metadata md,
java.lang.String line)
scan an 80-character line of a FITS header and load the data in the metadata list if it is recognized as pertaining to the coordinate system. |
| java.lang.String | scanHeaderCard(java.lang.String card)
scan an 80-character line of a FITS header and load the data in this metadata list if it is recognized as pertaining to the coordinate system. |
| static int | scanHeader(Metadata md,
java.io.InputStream header)
scan FITS header and loads all the data recognized as pertaining to the coordinate system. |
| int | scanHeader(java.io.InputStream header)
scan FITS header and loads all the data recognized as pertaining to the coordinate system. |
| static void | setCDELT(Metadata md,
int axis,
double in)
insert a voxel width into a metadata list |
| void | setCDELT(int axis,
double in)
insert a voxel width into this metadata list |
| static void | setCROTA(Metadata md,
int axis,
double in)
insert an axis rotation into a metadata list; since the CROTA keyword is being phased out in favor of a PC Matrix, one should run modernize() on the metadata list after all metadata are loaded if this method was called. |
| void | setCROTA(int axis,
double in)
insert an axis rotation into this metadata list; since the CROTA keyword is being phased out in favor of a PC Matrix, one should run modernize() on the metadata list after all metadata are loaded if this method was called. |
| static void | setCRPIX(Metadata md,
int axis,
double in)
insert an axis reference data position into a metadata list |
| void | setCRPIX(int axis,
double in)
insert an axis reference data position into this metadata list |
| static void | setCRVAL(Metadata md,
int axis,
double in)
insert an axis reference value into a metadata list |
| void | setCRVAL(int axis,
double in)
insert an axis reference value into this metadata list |
| static void | setCTYPE(Metadata md,
int axis,
java.lang.String value)
insert the name and type information into a metadata list |
| void | setCTYPE(int axis,
java.lang.String in)
insert the name and type information into this metadata list |
| static void | setEPOCH(Metadata md,
double in)
insert the value of the EPOCH keyword into a metadata list |
| void | setEPOCH(double in)
insert the value of the EPOCH keyword into this metadata list |
| static void | setEQUINOX(Metadata md,
double in)
insert the value of the EQUINOX keyword into a metadata list |
| void | setEQUINOX(double in)
insert the value of the EQUINOX keyword into this metadata list |
| static void | setLATPOLE(Metadata md,
double latpole)
a the value of FITS keyword LATPOLE into a metadata list |
| void | setLATPOLE(double latpole)
insert the value of FITS keyword LATPOLE into this metadata list |
| static void | setLONGPOLE(Metadata md,
double longpole)
a the value of FITS keyword LONGPOLE into a metadata list |
| void | setLONGPOLE(double longpole)
insert the value of FITS keyword LONGPOLE into this metadata list |
| static void | setNAXIS(Metadata md,
int nax)
insert the number of axes into a metadata list |
| void | setNAXIS(int nax)
insert the number of axes into this metadata list |
| static void | setPCMatrix(Metadata md,
double[] in)
insert a PC matrix into a metadata list |
| void | setPCMatrix(double[] in)
insert a PC matrix into this metadata list |
| static void | setPCMatrix(Metadata md,
int i,
int j,
double in)
insert an element of the PC matrix into a metadata list. |
| void | setPCMatrix(int i,
int j,
double in)
insert an element of the PC matrix into a metadata list. |
| static void | setPROJP(Metadata md,
double[] in)
insert an array of projection parameters in a metadata list |
| void | setPROJP(double[] in)
insert an array of projection parameters in this metadata list |
| static void | setPROJP(Metadata md,
int i,
double in)
insert an element of the array of projection parameters |
| void | setPROJP(int i,
double in)
insert an element of the array of projection parameters |
| static void | setRADECSYS(Metadata md,
java.lang.String in)
insert the value of the RADECSYS keyword into a metadata list |
| void | setRADECSYS(java.lang.String in)
insert the value of the RADECSYS keyword into this metadata list |
| static void | setVeloStandard(Metadata md,
int axis,
java.lang.String in)
set the value of the velocity standard in use for specific axis |
| void | setVeloStandard(int axis,
java.lang.String in)
set the value of the velocity standard in use for specific axis |
| static void | setVeloStandard(Metadata md,
java.lang.String in)
set the value of the default velocity standard for the entire coordinate system |
| void | setVeloStandard(java.lang.String in)
set the value of the default velocity standard for the entire coordinate system |
| Methods inherited from class ncsa.horizon.util.Metadata | |
| cloneDefaults, clone, copyMetadata, copyMetadata, deepClone, detachedClone, detach, fetchDatum, fetchMetadatum, getDefaults, getMetadatum, getMetadatum, getMetadatum, getMetadatum, getRunnerNames, giveDefaults, metadatumNames, put, removeAllMetadata, setDefaults, setSchema, setSchemaVersion, toString | |
| Methods inherited from class java.util.Hashtable | |
| clear, clone, contains, containsKey, containsValue, elements, entrySet, equals, get, hashCode, isEmpty, keySet, keys, putAll, put, rehash, remove, size, toString, values | |
| Methods inherited from class java.util.Dictionary | |
| elements, get, isEmpty, keys, put, remove, size | |
| Methods inherited from class java.lang.Object | |
| clone, equals, finalize, getClass, hashCode, notifyAll, notify, toString, wait, wait, wait | |
| Field Detail |
public static final AxisPosFormatter defaultRAFormatter
public static final AxisPosFormatter defaultDecFormatter
public static final AxisPosFormatter defaultLinearFormatter
| Constructor Detail |
public FITSCoordMetadata()
public FITSCoordMetadata(int naxes,
Metadata defaults)
throws java.lang.ArrayIndexOutOfBoundsException
naxes
- the number of axes in the coordinate system
defaults
- the defaults (can be null)
public FITSCoordMetadata(int naxes)
throws java.lang.ArrayIndexOutOfBoundsException
defaults
- the defaults
public FITSCoordMetadata(Metadata defaults)
throws java.lang.ArrayIndexOutOfBoundsException
defaults
- the defaults| Method Detail |
public static int getNAXIS(Metadata md)
md
- the metadata list to searchpublic int getNAXIS()
public static void setNAXIS(Metadata md,
int nax)
md
- the Metadata list to insert value into
nax
- the value of the NAXIS keywordpublic void setNAXIS(int nax)
nax
- the value of the NAXIS keyword
public static void setCTYPE(Metadata md,
int axis,
java.lang.String value)
md
- the Metadata list to insert value into
axis
- the axis number (first axis is 1)
in
- the value of the CTYPE keyword
public void setCTYPE(int axis,
java.lang.String in)
axis
- the axis number (first axis is 1)
in
- the value of the CTYPE keywordprotected static java.lang.String getLONLATName(char c)
public static java.lang.String parseAfterDash(java.lang.String ctype)
ctype
- the string to parse, usually the value of the
CTYPE keyword
public static void setCRVAL(Metadata md,
int axis,
double in)
md
- the Metadata list to insert value into
axis
- the axis number (first axis is 1)
in
- the value of the CRVAL keyword
public void setCRVAL(int axis,
double in)
axis
- the axis number (first axis is 1)
in
- the value of the CRVAL keyword
public static void setCRPIX(Metadata md,
int axis,
double in)
md
- the Metadata list to insert value into
axis
- the axis number (first axis is 1)
in
- the value of the CRPIX keyword
public void setCRPIX(int axis,
double in)
axis
- the axis number (first axis is 1)
in
- the value of the CRPIX keyword
public static void setCDELT(Metadata md,
int axis,
double in)
md
- the Metadata list to insert value into
axis
- the axis number (first axis is 1)
in
- the value of the CDELT keyword
public void setCDELT(int axis,
double in)
axis
- the axis number (first axis is 1)
in
- the value of the CDELT keyword
public static void setCROTA(Metadata md,
int axis,
double in)
md
- the Metadata list to insert value into
axis
- the axis the standard is associated with
in
- the value of the CROTA keyword
public void setCROTA(int axis,
double in)
md
- the Metadata list to insert value into
axis
- the axis the standard is associated with
in
- the value of the CROTA keyword
public static void setVeloStandard(Metadata md,
int axis,
java.lang.String in)
md
- the Metadata list to insert value into
axis
- the axis the standard is associated with
in
- the code for the standard; e.g. "LSR", "HEL", "OBS".
public void setVeloStandard(int axis,
java.lang.String in)
axis
- the axis the standard is associated with
in
- the code for the standard; e.g. "LSR", "HEL", "OBS".
public static void setVeloStandard(Metadata md,
java.lang.String in)
md
- the Metadata list to insert value into
in
- the code for the standard; e.g. "LSR", "HEL", "OBS".public void setVeloStandard(java.lang.String in)
in
- the code for the standard; e.g. "LSR", "HEL", "OBS".
public static void setLONGPOLE(Metadata md,
double longpole)
md
- the Metadata list to insert value into
in
- value of the FITS keyword LONGPOLEpublic void setLONGPOLE(double longpole)
in
- value of the FITS keyword LONGPOLE
public static void setLATPOLE(Metadata md,
double latpole)
md
- the Metadata list to insert value into
in
- value of the FITS keyword LATPOLEpublic void setLATPOLE(double latpole)
in
- value of the FITS keyword LATPOLE
public static void setPCMatrix(Metadata md,
double[] in)
md
- the Metadata list to insert value into
in
- an array of NAXISxNAXIS elements, in order of
(PC001001, PC001002, ..., PC002001, PC002002, ...)public void setPCMatrix(double[] in)
in
- an array of NAXISxNAXIS elements, in order of
(PC001001, PC001002, ..., PC002001, PC002002, ...)
public static void setPCMatrix(Metadata md,
int i,
int j,
double in)
md
- the Metadata list to insert value into
i
- the matrix row; e.g. 3 for PC003002
j
- the matrix column; e.g. 2 for PC003002
in
- the PC matrix element
public void setPCMatrix(int i,
int j,
double in)
i
- the matrix row; e.g. 3 for PC003002
j
- the matrix column; e.g. 2 for PC003002
in
- the PC matrix elementpublic static Metavector getIdentityPCMatrix(int n)
n
- the dimensionality of the matrix; output matrix
will be n x n in size.
public static void setPROJP(Metadata md,
double[] in)
md
- the Metadata list to insert value into
in
- an array containing the projection parameterspublic void setPROJP(double[] in)
in
- an array containing the projection parameters
public static void setPROJP(Metadata md,
int i,
double in)
throws java.lang.ArrayIndexOutOfBoundsException
md
- the Metadata list to insert value into
i
- the array element to insert; e.g. 3 for PROJP3
in
- the value of the parameter
public void setPROJP(int i,
double in)
md
- the Metadata list to insert value into
i
- the array element to insert; e.g. 3 for PROJP3
in
- the value of the parameter
public static void setRADECSYS(Metadata md,
java.lang.String in)
md
- the Metadata list to insert value into
in
- the value of the RADECSYS keywordpublic void setRADECSYS(java.lang.String in)
md
- the Metadata list to insert value into
in
- the value of the RADECSYS keyword
public static void setEQUINOX(Metadata md,
double in)
md
- the Metadata list to insert value into
in
- the value of the EQUINOX keywordpublic void setEQUINOX(double in)
md
- the Metadata list to insert value into
in
- the value of the EQUINOX keyword
public static void setEPOCH(Metadata md,
double in)
md
- the Metadata list to insert value into
in
- the value of the EPOCH keywordpublic void setEPOCH(double in)
md
- the Metadata list to insert value into
in
- the value of the EPOCH keywordpublic static void modernize(Metadata md)
md
- the Metadata list to be updatedpublic void modernize()
md
- the Metadata list to be updated
public static java.lang.String scanHeaderCard(Metadata md,
java.lang.String line)
md
- the Metadata list to insert value into
line
- the FITS header linepublic java.lang.String scanHeaderCard(java.lang.String card)
card
- the FITS header line
public static int scanHeader(Metadata md,
java.io.InputStream header)
throws java.io.IOException
md
- the Metadata list to insert value into
header
- the stream containing the header
public int scanHeader(java.io.InputStream header)
throws java.io.IOException
header
- the stream containing the headerpublic static java.lang.String FITSkeyval(java.lang.String line)
public static CoordinateSystem createCoordSys(Metadata md)
throws IllegalTransformException
md
- the Metadata describing the system
public CoordinateSystem createCoordSys()
throws IllegalTransformException
public static void main(java.lang.String[] args)
| Overview | Package | Class | Tree | Deprecated | Index | Help | |||
| PREV CLASS | NEXT CLASS | FRAMES | NO FRAMES | ||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||