| 
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcds.astro.Astrotime
public class Astrotime
The astronomical time may be expressed in (Modified) Julian Days, Julian Years or Besselian years. The conversion to Calendar can use the Calendar.setTimeInMillis(JD2Millis(date))
| Field Summary | |
|---|---|
static double | 
Byr
Value of Besselian Year in days  | 
static Editing | 
ed
The default choices of the edition for this class  | 
static double | 
JD_1970
Julian date of 1 Jan 1970  | 
static double | 
JD_B1900
Julian date of B1900 epoch  | 
static double | 
JD_J2000
Julian date of J2000 epoch  | 
static double | 
JD_MJD0
Modified Julian date  | 
static double | 
Jyr
Value of the Julian Year in days  | 
static double[] | 
offset
Origin of the different time scales from MJD0 (1858-11-17T00:00:00)  | 
static java.lang.String[] | 
prefix
Conversion of time: time in unit = mjd*factor + offset  | 
| Constructor Summary | |
|---|---|
Astrotime()
Default contructor (undefined time)  | 
|
Astrotime(java.lang.String text)
Constructor from a String.  | 
|
| Method Summary | |
|---|---|
static double | 
B2J(double y)
Conversion of a Besselian epoch to a Julian epoch  | 
static double | 
B2JD(double y)
Conversion of a Besselian epoch to a Julian Date  | 
 void | 
dump(java.lang.String title)
Dump the time contents.  | 
 double | 
getByr()
Get the time expressed in Besselian yr  | 
 double | 
getJD()
Get the time expressed in JD  | 
 double | 
getJyr()
Get the time expressed in Julian yr  | 
 double | 
getMJD()
Get the time expressed in MJD (JD-2400000.5)  | 
 long | 
getTime()
Get the time expressed in milliseconds since 1 Jan 1970  | 
static double | 
J2B(double y)
Conversion of a Julian epoch to a Besselian epoch  | 
static double | 
J2JD(double y)
Conversion of a Julian epoch to a Julian Date  | 
static double | 
JD2B(double jd)
Conversion of a Julian Date to a Besselian epoch  | 
static double | 
JD2J(double jd)
Conversion of a Julian Date to a Julian epoch  | 
static double | 
JD2MJD(double jd)
Conversion of a JD to MJD  | 
static long | 
JD2ms(double jd)
Conversion of a Julian Date to a Milliseconds since 1 January 1970  | 
static void | 
JD2YMD(double jd,
       int[] ymd)
Conversion of a Julian Date into a calendar year/month/day.  | 
static double | 
MJD2JD(double mjd)
Conversion of a MJD to JD  | 
static double | 
ms2JD(long ms)
Conversion of a calendar time expressed in Milliseconds to a Julian Date  | 
 int | 
parse(java.lang.String text,
      int offset)
Interpret a string for a time.  | 
 boolean | 
parsing(Parsing t)
Interpret a string for a time.  | 
 void | 
set(double mjd)
Set the time from MJD.  | 
 void | 
set(long ms)
Set the time from milliseconds.  | 
 void | 
set(java.lang.String text)
Set the time from a String.  | 
 java.lang.String | 
toString()
Get the time expressed in milliseconds since 1 Jan 1970  | 
 java.lang.String | 
toString(java.lang.String unit)
Edit the time in the specified choice.  | 
static double | 
YMD2JD(int year,
       int month,
       int day)
Conversion of a calendar date into a Julian Date.  | 
| Methods inherited from class java.lang.Object | 
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait | 
| Field Detail | 
|---|
public static Editing ed
public static final double Byr
public static final double Jyr
public static final double JD_J2000
public static final double JD_B1900
public static final double JD_1970
public static final double JD_MJD0
public static final java.lang.String[] prefix
public static final double[] offset
| Constructor Detail | 
|---|
public Astrotime()
public Astrotime(java.lang.String text)
          throws java.text.ParseException
text - Sting expression of an Astrotime.
        Valid input values can be "Byyyy...", "Jyyyy...", "JDxxx" or "MJD..."
java.text.ParseException - when text can't be interpreted.| Method Detail | 
|---|
public static final double J2JD(double y)
y - Julian epoch
public static final double B2JD(double y)
y - Besselian epoch
public static final double YMD2JD(int year,
                                  int month,
                                  int day)
year - Year numbermonth - Month number, range 0=January to 11=Decemberday - Day number, range 1 to 31
public static final void JD2YMD(double jd,
                                int[] ymd)
jd - Julian dateymd - array on return with year month day.
                year=ymd[0], month=ymd[1](range 0..1), day=ymd[2](range 1..31).
                Day in year (range 1..366) is given as 
                ymd[1] if ymd has 2 elements, ymd[3] if 4 elements.public static final double ms2JD(long ms)
ms - UTC millisconds got e.g. via Calendar.getTimeInMillis()
public static final double MJD2JD(double mjd)
mjd - Modified Julian Date
public static final double JD2J(double jd)
jd - Julian Date
public static final double JD2B(double jd)
jd - Julian Date
public static final long JD2ms(double jd)
jd - Julian Date
public static final double JD2MJD(double jd)
jd - Julian Date
public static final double B2J(double y)
y - Besselian epoch
public static final double J2B(double y)
y - Julian epoch
public final void dump(java.lang.String title)
public boolean parsing(Parsing t)
t - Text to interpret as a Parsing object
public int parse(java.lang.String text,
                 int offset)
text - String expression of an Astrotimeoffset - Where to start in the text
public void set(double mjd)
mjd - Date/time in MJD (JD-2400000.5)public void set(long ms)
ms - Date/Time in milliseconds.
                (e.g. value returned from Calendar.getTimeInMillis()).
                The default edition is in JD, with 8 decimals.
public void set(java.lang.String text)
         throws java.text.ParseException
text - Sting expression of an Astrotime
java.text.ParseException - when text can't be interpreted.public double getMJD()
public double getJyr()
public double getByr()
public double getJD()
public long getTime()
public java.lang.String toString(java.lang.String unit)
unit - One of the possibilities "JD" "MJD" "J" "B" "ms"public java.lang.String toString()
toString in class java.lang.Object
  | 
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||