|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcds.astro.Coo
cds.astro.Astrocoo
public class Astrocoo
This class defines the spherical coordinates used in Astronomy. It associates the coordinates on the sphere (defined in the Coo class) with the system (Astroframe) in which they are expressed. It also includes the accuracy (number of digits) in which the coordinates are expressed, and the epoch of the position.
The typical usage of the Astrocoo class consists in:
Astroframe
,
Astroformat
,
Serialized FormField Summary | |
---|---|
static byte |
ARCMIN
Definitions of Precisions for the angles |
static byte |
ARCSEC
Definitions of Precisions for the angles |
static boolean |
DEBUG
|
static byte |
DEG
Definitions of Precisions for the angles |
static short |
EDIT_2NUMBERS
Editing option to separate the 2 components by a blank |
static short |
EDIT_DEFAULT
The default edition options |
static short |
EDIT_EPOCH
Editing option to write the Epoch |
static short |
EDIT_FRAME
Editing option to insert the name of the frame |
static short |
EDIT_FULL
Editing option to show all decimals |
static short |
EDIT_MEAN_EPOCH
Editing option to write the MeanEpoch |
double |
epoch
Epoch (Jyr) of the position |
Astroframe |
frame
The associated frame |
static byte |
MAS
Definitions of Precisions for the angles |
static byte |
NONE
Definitions of Precisions for the angles |
Fields inherited from class cds.astro.Coo |
---|
decimals, ed, Umatrix3, x, y, z |
Constructor Summary | |
---|---|
Astrocoo()
Create the default ICRS Astrocoo |
|
Astrocoo(Astroframe frame)
Create an Astrocoo object: specify just frame, equinox, precision. |
|
Astrocoo(Astroframe frame,
double lon,
double lat)
Create an Astrocoo object with a known position. |
|
Astrocoo(Astroframe frame,
double lon,
double lat,
double epoch)
Create an Astrocoo object with a known position at given epoch. |
|
Astrocoo(Astroframe frame,
java.lang.String text)
Create an Astrocoo object from a position (Epoch) |
|
Astrocoo(java.lang.String text)
Create an Astrocoo object from just a string. |
Method Summary | |
---|---|
java.lang.Object |
clone()
Clone the Coo object |
static void |
convert(Astrocoo source,
Astrocoo target)
Transform the celestial position. |
void |
convertTo(Astroframe new_frame)
Transform the position into another frame. |
void |
dump(java.lang.String title)
Dump the contents of an Astrocoo. |
java.lang.StringBuffer |
edit(java.lang.StringBuffer buf,
int opt)
Method to edit the Coordinates in a StringBuffer |
static int |
editingOptions(java.lang.String text)
Convert the String of editing options into an integer |
boolean |
equals(java.lang.Object o)
Compare 2 coordinates. |
static java.lang.String |
explain(int editing)
Explain the editing option of the coordinate |
int |
getEditing()
Get the defaut editing option. |
static double |
getEpoch(Parsing txt)
Interpret an epoch, eventually within ( ). |
Astroframe |
getFrame()
Get an explicit designation of the frame |
byte |
getLatPrec()
Get the precision on the longitude |
byte |
getLonPrec()
Get the precision on the latitude |
int |
getPrecision()
Get the precision of the current value |
int |
parse(java.lang.String txt,
int offset)
Parsing method: interpret a String. |
static Astroframe |
parseFrame(Parsing txt)
Interpret a text representing a frame |
boolean |
parsing(Parsing txt)
Interpret the string and convert to Coo + Epoch. |
void |
set(Astrocoo coo)
Set a position from an existing one (copy). |
void |
set(Coo coo,
double epoch)
Set position + epoch. |
void |
set(java.lang.String text)
Set a position from a text which may contain position and Epoch. |
void |
setEditing(int edit_option)
Change the default way of edition |
boolean |
setEpoch(double epoch)
Change the Epoch of the data |
void |
setPrecision(int precision)
Change the precision of the data |
void |
setPrecision(int dlon,
int dlat)
Change the precision of the data |
java.lang.String |
toString()
Default edition: use what's stored |
java.lang.String |
toString(int edit_option)
Customized edition of Coordinates to a String |
java.lang.String |
toString(java.lang.String options)
Customized edition of Coordinates to a String |
Methods inherited from class cds.astro.Coo |
---|
add, add, copyAngles, copyUvector, distance, distance, editCoo, eulerMatrix, getLat, getLon, localMatrix, localMatrix, localMatrix, moveMatrix, normalize, normalize, rotate_1, rotate, rotateVector_1, rotateVector, set, set, set, set, setDecimals, setUvec, sub, sub |
Methods inherited from class java.lang.Object |
---|
getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static boolean DEBUG
public Astroframe frame
public double epoch
public static final byte NONE
public static final byte DEG
public static final byte ARCMIN
public static final byte ARCSEC
public static final byte MAS
public static final short EDIT_FRAME
public static final short EDIT_2NUMBERS
public static final short EDIT_EPOCH
public static final short EDIT_MEAN_EPOCH
public static final short EDIT_FULL
public static final short EDIT_DEFAULT
Constructor Detail |
---|
public Astrocoo()
public Astrocoo(Astroframe frame)
frame
- one of the possible Astroframespublic Astrocoo(Astroframe frame, double lon, double lat)
frame
- one of the possible Astroframeslon
- Longitude of the position (degrees)lat
- Latitude of the position (degrees)public Astrocoo(Astroframe frame, double lon, double lat, double epoch)
frame
- one of the possible Astroframeslon
- Longitude of the position (degrees)lat
- Latitude of the position (degrees)epoch
- Epoch of the position, in Jyr (see Astrotime)public Astrocoo(Astroframe frame, java.lang.String text) throws java.text.ParseException
frame
- one of the possible Astroframestext
- Text with position, possibly followed by an epoch.
Valid texts are e.g.
"12 34 12.45 -42 12 76.4 J1991.25" or
"12 34 12.45 -42 12 76.4 (J1991.25)"
java.text.ParseException
public Astrocoo(java.lang.String text) throws java.text.ParseException
text
- Text with frame, position, possibly followed by an epoch.
Valid texts are e.g.
"J2000: 12 34 12.45 -42 12 76.4 J1991.25" or
"(ICRS) 12 34 12.45 -42 12 76.4 (J1991.25)"
java.text.ParseException
Method Detail |
---|
public static final java.lang.String explain(int editing)
public static Astroframe parseFrame(Parsing txt)
public java.lang.Object clone()
Coo
clone
in class Coo
public static double getEpoch(Parsing txt)
txt
- Text to interpret
public boolean parsing(Parsing txt)
parsing
in class Coo
txt
- to interpret as a Parsing object "12 34.5 -72 54 J1991.25"
public int parse(java.lang.String txt, int offset)
parse
in class Coo
txt
- to interpret.offset
- starting position in text
public void set(Astrocoo coo)
coo
- the Astrocoo to copy.public void set(java.lang.String text) throws java.text.ParseException
set
in class Coo
text
- Longitude + latitude in text
java.text.ParseException
- when the string is not interpretablepublic void set(Coo coo, double epoch)
coo
- the lon+latepoch
- the epoch.public void setPrecision(int precision)
precision
- integer number, typically one of the values NONE (0),
DEG (1), ARCMIN (3), ARCSEC (5), MAS (8);
use ARCSEC+1 for 0.1arcsec, MAS-1 for 10mas, etc...public void setPrecision(int dlon, int dlat)
dlon
- Precision number on longitude (RA).dlat
- Precision number on latitude (Dec).public void setEditing(int edit_option)
edit_option
- A mixture of Astroformat
options,
and EDIT_FRAME EDIT_FULL.public boolean setEpoch(double epoch)
epoch
- the epoch of the coordinates
public final Astroframe getFrame()
public final int getPrecision()
public byte getLonPrec()
public byte getLatPrec()
public final int getEditing()
public void dump(java.lang.String title)
dump
in class Coo
title
- A title to precede the dumppublic boolean equals(java.lang.Object o)
equals
in class Coo
o
- Objet a comparer.
public static int editingOptions(java.lang.String text) throws java.lang.IllegalArgumentException
text
- List of options:d = edit in Decimal s = edit in Sexagesimal : = separate sexagesimal parts with the colon u = separate sexagesimal parts with the relevant unit (h m s d m s) f = edit also the frame (system+equinox) F = edit in full precision (ignore the precision of the system) 2 = edit with a blank between numbers E = edit the epoch M = edit the Mean Epoch * = default edition options
java.lang.IllegalArgumentException
public final java.lang.StringBuffer edit(java.lang.StringBuffer buf, int opt)
edit
in class Coo
buf
- Buffer where the result is appendedopt
- A mixture of the options ED_COLON, ED_DECIMAL,
EDIT_FULL, EDIT_SEXA, EDIT_FRAME, EDIT_2NUMBERS
public java.lang.String toString(int edit_option)
edit_option
- A mixture of Astroformat
options,
and EDIT_FRAME EDIT_FULL.
public java.lang.String toString(java.lang.String options) throws java.lang.IllegalArgumentException
options
- a string with the option letters (see edit)
java.lang.IllegalArgumentException
editingOptions(java.lang.String)
public java.lang.String toString()
toString
in class Coo
public void convertTo(Astroframe new_frame)
new_frame
- The frame of the resulting position.public static void convert(Astrocoo source, Astrocoo target)
source
- Source position (with its frame)target
- Target position (coordinates part replaced)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |