cds.simbad
Class Coordinates

java.lang.Object
  extended bycds.util.Nodata
      extended bycds.simbad.BasicData
          extended bycds.simbad.PosData
              extended bycds.simbad.Coordinates
All Implemented Interfaces:
java.io.Serializable

public class Coordinates
extends PosData

Version:
1.1 Oct 2002 : Modification des types des donnees ra et prec
Ajout des attributs de precision
=> modification des constructeurs et methodes
1.2 30 oct 2002 : Attributs de precisions geres directement dans Coo par dlon et dlat
1.3 22 nov 2002 : Gestion des cases coordonnees
1.4 Oct 2003 : Revision 1.5 Jan 2004 (BB) ajout de la methode equals.
Author:
Marc Wenger, Sylvaine Jaehn (Stage UTBM)
See Also:
Serialized Form

Field Summary
private  Astroframe coordframe
           
private static double DEFAULT_EQUINOX
           
private static int DEFAULT_FRAME
           
private static int LEVEL
           
private  Qbox qbox
           
 
Fields inherited from class cds.simbad.PosData
 
Fields inherited from class cds.simbad.BasicData
dataExists
 
Fields inherited from class cds.util.Nodata
NODATA, NODATA_DBL, NODATA_FLT, NODATA_SHT, NODATA_STR
 
Constructor Summary
Coordinates()
          Constructor without parameters.
Coordinates(Coordinates coo)
          Copy constructor
Coordinates(java.lang.String coostr, ErrorData error, java.lang.String qual, Bibcode bibcode)
          Constructor defining a complete coordinates object.
 
Method Summary
 void convert(int frame, double equi)
          Converts the coordinates to another frame
 boolean equals(java.lang.Object o)
          MOD-BB 21-01-04 Ajout de cette methode.
 Coobox getCooBox()
          Acces to actual qbox index
 Astroframe getCoord()
          Get the Astroframe object
 double getDec()
          Get the declination
 short getDecPrec()
          Get the declination precision
 java.lang.String getDecStr()
          Get declination edited in sexagesimal
 double getRa()
          Get the right ascension
 short getRaPrec()
          Get the right ascention precision
 java.lang.String getRaStr()
          Get the right ascension in sexagesimal format
private  void init()
          Initialize fields (only used by the constructors)
 void set(Coordinates coo)
          Sets the coordinates from another Coordinates object
 void set(double ra, double dec, short prec)
          Sets the coordinates values
 void set(double ra, double dec, short prec, ErrorData error, java.lang.String qual, Bibcode bibcode)
          Sets coordinates attributes
 void set(java.lang.String coo)
          Sets the coordinates value
 void set(java.lang.String coostr, ErrorData error, java.lang.String qual, Bibcode bibcode)
          Positionnement des attributs
static int setLevel(int level)
          Sets the level used for computing the coordinates box.
 java.lang.String toString()
          Fonction d'edition Par defaut, sortie en Sexagesimal
 java.lang.String toString(java.lang.String options)
          Fonction d'edition
 
Methods inherited from class cds.simbad.PosData
getBibcode, getError, getQuality, set, setBibcode, setBibcode, setError, setQuality
 
Methods inherited from class cds.simbad.BasicData
exists, setExist, setNodata
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

LEVEL

private static int LEVEL

DEFAULT_FRAME

private static int DEFAULT_FRAME

DEFAULT_EQUINOX

private static double DEFAULT_EQUINOX

qbox

private Qbox qbox

coordframe

private Astroframe coordframe
Constructor Detail

Coordinates

public Coordinates()
Constructor without parameters. The coord. box level is taken from a database parameters file.
Another way to define the level is to use the static method Coordinates.setLevel(level) before any object is created.


Coordinates

public Coordinates(java.lang.String coostr,
                   ErrorData error,
                   java.lang.String qual,
                   Bibcode bibcode)
Constructor defining a complete coordinates object. The coord. box level is taken from the current database parameters.
Another way to define the level is to use the static method Coordinates.setLevel(level) before any object is created.

Parameters:
coostr - coordinates as a string containing RA+DEC
error - error ellipse
qual - quality
bibcode - bibcode

Coordinates

public Coordinates(Coordinates coo)
Copy constructor

Parameters:
coo - Coordinates object to copy
Method Detail

init

private void init()
Initialize fields (only used by the constructors)


set

public void set(Coordinates coo)
Sets the coordinates from another Coordinates object

Parameters:
coo - Coordinates object to copy

set

public void set(java.lang.String coostr,
                ErrorData error,
                java.lang.String qual,
                Bibcode bibcode)
Positionnement des attributs

Parameters:
coostr - position sous forme de chaine de caracteres
error - erreur ou ellipse d'erreur
qual - qualite
bibcode - bibcode

set

public void set(double ra,
                double dec,
                short prec,
                ErrorData error,
                java.lang.String qual,
                Bibcode bibcode)
Sets coordinates attributes

Parameters:
ra - right ascension
dec - declination
prec - precision
error - erreur ou ellipse d'erreur
qual - qualite
bibcode - bibcode

set

public void set(java.lang.String coo)
Sets the coordinates value

Parameters:
coo - coordinates as a string. ra & dec must be separated by a sign

setLevel

public static int setLevel(int level)
Sets the level used for computing the coordinates box. By default, the level is defined from a database parameters set at object constuction (see the Coordinates constructor). This method allows to set (or change) the level at any moment. If this method is used before the first Coordinates object creation, then no parameters object is used to find it.

Parameters:
level - level for coordinates boxes (simbad3:5, simbad4:6)
Returns:
the previous value. If first use, the value -1 is returned

set

public void set(double ra,
                double dec,
                short prec)
Sets the coordinates values

Parameters:
ra - right ascension
dec - declination
prec - precision

getCoord

public Astroframe getCoord()
Get the Astroframe object

Returns:
Astroframe object

getRa

public double getRa()
Get the right ascension

Returns:
RA in degrees

getRaPrec

public short getRaPrec()
Get the right ascention precision

Returns:
precision of RA

getRaStr

public java.lang.String getRaStr()
Get the right ascension in sexagesimal format

Returns:
RA in sexagesimal

getDec

public double getDec()
Get the declination

Returns:
DEC in degrees

getDecPrec

public short getDecPrec()
Get the declination precision

Returns:
precision of DEC

getDecStr

public java.lang.String getDecStr()
Get declination edited in sexagesimal

Returns:
DEC edited in sexagesimal

getCooBox

public Coobox getCooBox()
Acces to actual qbox index

Returns:
actual qbox index

convert

public void convert(int frame,
                    double equi)
Converts the coordinates to another frame

Parameters:
frame - new frame
equi - new equinox

toString

public java.lang.String toString()
Fonction d'edition Par defaut, sortie en Sexagesimal

Overrides:
toString in class PosData
Returns:
chaine de description des coordonnees

toString

public java.lang.String toString(java.lang.String options)
Fonction d'edition

Parameters:
options - a string with the option letters having the meaning:
	d = edit in Decimal
	s = edit in Sexagesimal
	: = separate sexagesimal parts with the colon
	f = edit also the frame (system+equinox)
	F = edit in full precision (ignore the precision of the system)
 
Returns:
chaine de description des coordonnees

equals

public boolean equals(java.lang.Object o)
MOD-BB 21-01-04 Ajout de cette methode. Test d'egalite de Coordinates.

Parameters:
o - Objet a comparer.
Returns:
Vrai si o est identique a this, faux sinon.