cds.astro
Class Astroframe

java.lang.Object
  extended by cds.astro.Astroframe
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
Ecliptic, Equatorial, Galactic, ICRS, Supergal

public abstract class Astroframe
extends java.lang.Object
implements java.io.Serializable

This abstract class defines the required methods to instanciate the definition of a frame used for astronomical coordinates.

See Also:
Serialized Form

Field Summary
 double base_epoch
          The defaut epoch, a constant which cannot be changed for a frame.
 byte ed_lat
          Default edition of Latitude/Declination.
 byte ed_lon
          Default edition of Longitude/Right Ascension.
 double epoch
          The epoch, expressed in Julian Year.
 boolean hms
          The sexagesimal representation of the longitude may be expressed in time unit.
static java.lang.String IAUframes
          List of valid 1-letter frames used in IAU designations
 double[][] ICRSmatrix
          The conversion to ICRS, if it is a simple rotation.
 java.lang.String name
          The name of the frame (normally assigned at instanciation)
 byte precision
          The defaut precision (0=unknown, 3=1', 5=1").
 
Constructor Summary
Astroframe()
           
 
Method Summary
static Astroframe create(char sym)
          Creation of an astroframe from a single char (J, B, G, etc)
static Astroframe create(java.lang.String name)
          Creation of an astroframe from the interpretation of a text
 boolean equals(char sym)
          Creation of an astroframe from a single char (J, B, G, etc)
 boolean equals(java.lang.Object o)
          Equality of frames -- name + epoch are assumed fully represent any frame.
 void fromICRS(Coo coo)
          Conversion from ICRS.
 void fromICRS(double[] u6)
          Conversion from ICRS with derivatives.
static boolean isIAU(char sym)
          Verify letter is a valid frame.
static Astroframe parse(Parsing txt)
          Interpret a text representing a frame
 void setFrameEpoch(double epoch)
          The setFrameEpoch method just set the default epoch.
 void setICRSmatrix()
          Make the required verifications to install the ICRS matrix.
 void toICRS(Coo coo)
          Conversion to ICRS.
 void toICRS(double[] u6)
          Conversion to ICRS with derivatives.
abstract  double[][] toICRSmatrix()
          Getting the matrix to rotate to ICRS system.
 java.lang.String toString()
          Edition of an Astroframe.
 java.lang.String toString(double epoch)
          Edition of an Astroframe with specification of the epoch.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

IAUframes

public static java.lang.String IAUframes
List of valid 1-letter frames used in IAU designations


name

public java.lang.String name
The name of the frame (normally assigned at instanciation)


base_epoch

public double base_epoch
The defaut epoch, a constant which cannot be changed for a frame.


epoch

public double epoch
The epoch, expressed in Julian Year. This epoch may be changed by setFrameEpoch.


ICRSmatrix

public double[][] ICRSmatrix
The conversion to ICRS, if it is a simple rotation.


hms

public boolean hms
The sexagesimal representation of the longitude may be expressed in time unit. This is the case of the Equatorial frames, but also in the ICRS.


precision

public byte precision
The defaut precision (0=unknown, 3=1', 5=1"). The precision value is expressed as the number of decimals (+1), i.e. 0=unknown, 1=deg 3=1' 5=1" 8=1mas 11=1uas, etc...


ed_lon

public byte ed_lon
Default edition of Longitude/Right Ascension. It contains one of the options in Astroformat among DECIMAL, SEXA..., eventualled or'ed with SIGN_EDIT | ZERO_FILL


ed_lat

public byte ed_lat
Default edition of Latitude/Declination. It contains one of the options in Astroformat among DECIMAL, SEXA..., eventualled or'ed with SIGN_EDIT | ZERO_FILL

Constructor Detail

Astroframe

public Astroframe()
Method Detail

parse

public static Astroframe parse(Parsing txt)
Interpret a text representing a frame

Parameters:
txt - A text which contains a frame definition.
  • I = IRCS (no equinox)
  • J = FK5 eventually followed by equinox (Julian)
  • B = FK4 eventually followed by equinox (Besselian)
  • E = Ecliptic, eventually followed by equinox (Julian)
  • G = Galactic (no equinox)
  • S = Supergalactic (no equinox)
  • FK4(equinox), equivalent to Bequinox, e.g. FK4(1950)
  • FK5(equinox), equivalent to Jequinox, e.g. FK5(2000)
An epoch might be added, e.g. ICRS(1991.25) or ICRS(Epoch=1991.25) for the frame used in Hipparcos.
Returns:
the astroframe interpreted. When null is returned, the parsing object is not modified.

create

public static Astroframe create(java.lang.String name)
Creation of an astroframe from the interpretation of a text

Parameters:
name - the frame name + equinox + epoch
Returns:
the astroframe
See Also:
parse

isIAU

public static final boolean isIAU(char sym)
Verify letter is a valid frame.

Parameters:
sym - the letter defining the frame. (I=ICRS, J=J2000, B=B1950, E=EclJ2000, G=Gal, S=SuperGal)
Returns:
true/false

create

public static Astroframe create(char sym)
Creation of an astroframe from a single char (J, B, G, etc)

Parameters:
sym - the letter defining the frame. (I=ICRS, J=J2000, B=B1950, E=EclJ2000, G=Gal, S=SuperGal)
Returns:
the corresponding astroframe / null

equals

public boolean equals(char sym)
Creation of an astroframe from a single char (J, B, G, etc)

Parameters:
sym - the letter defining the frame. (I=ICRS, J=J2000, B=B1950, E=EclJ2000, G=Gal, S=SuperGal)
Returns:
the corresponding astroframe / null

toString

public java.lang.String toString()
Edition of an Astroframe. The name contains the epoch when the epoch is non-standard.

Overrides:
toString in class java.lang.Object
Returns:
the name of the Astroframe.

toString

public java.lang.String toString(double epoch)
Edition of an Astroframe with specification of the epoch.

Returns:
the name of the Astroframe.

setICRSmatrix

public final void setICRSmatrix()
Make the required verifications to install the ICRS matrix.


setFrameEpoch

public void setFrameEpoch(double epoch)
The setFrameEpoch method just set the default epoch.

Parameters:
epoch - epoch of the frame, in Julian year.

equals

public boolean equals(java.lang.Object o)
Equality of frames -- name + epoch are assumed fully represent any frame. Note that the equinox is part of the frame name, hence an equality of names imples the same equinox.

Overrides:
equals in class java.lang.Object
Parameters:
o - Another object
Returns:
True if same Astroframe

toICRSmatrix

public abstract double[][] toICRSmatrix()
Getting the matrix to rotate to ICRS system. This method should return null when the change to ICRS can't be done by a simple rotation.

Returns:
The rotation matrix from current frame to ICRS.

toICRS

public void toICRS(Coo coo)
Conversion to ICRS. This conversion must be installed only if toICRSmatrix() returns null (as in FK4). The conversion is straightforward if just a rotation is involved: coo.rotate(toICRSmatrix());

Parameters:
coo - a Coordinate assumed to express a position in my frame. On return, coo contains the corresponding coordinate in the ICRS.

fromICRS

public void fromICRS(Coo coo)
Conversion from ICRS. This conversion must be installed only if toICRSmatrix() returns null (as in FK4).

Parameters:
coo - a Coordinate assumed to express a position in ICRS. On return, coo gives the corresponding coordinate in my frame.

toICRS

public void toICRS(double[] u6)
Conversion to ICRS with derivatives. The code contained here assumes a simple rotation. It has to be overloaded if this assertion is false (see e.g. FK4)

Parameters:
u6 - a 6-vector (phase vector) of position + velocity. Velocity in Jyr-1 Note that u6 can restricted be a 3-vector.

fromICRS

public void fromICRS(double[] u6)
Conversion from ICRS with derivatives. The code contained here assumes a simple rotation. It has to be overloaded if this assertion is false (see e.g. FK4)

Parameters:
u6 - a 6-vector (phase vector) of position + velocity. Velocity in Jyr-1 Note that u6 can restricted be a 3-vector.