|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.hermit.astro.Instant
public class Instant
A representation of a particular moment in time, with methods to convert between the numerous time systems used in astronomy.
Field Summary |
---|
Fields inherited from interface org.hermit.astro.AstroConstants |
---|
ABERRATION, AU, HALFPI, J1900, J1990, J2000, JD_UNIX, REFRACTION, SECS_PER_DAY, SIDEREAL_RATIO, SIDEREAL_YEAR, TROPICAL_YEAR, TWILIGHT, TWOPI, ε_2000 |
Constructor Summary | |
---|---|
Instant(double jd)
Create an instant from a Julian day number in UT. |
|
Instant(int y,
int m,
double d)
Create an instant from a date / time in UT. |
|
Instant(int y,
int m,
int d,
int ho,
int mn,
int se)
Create an instant from a date / time in UT. |
|
Instant(long time)
Create an instant from a Java time in ms since 1 Jan 1970 UTC. |
Method Summary | |
---|---|
static double |
calculateDeltaT(int year,
double month)
Calculate an estimate of the value of ΔT, ie TD - UT in seconds, for a given moment in time. |
static Instant |
fromTd(double td)
Create an instant from a Julian day in TD. |
static Instant |
fromTd(int y,
int m,
double d)
Create an instant from a date / time in TD. |
double |
getGmst()
Get the Greenwich mean sideral time represented by this Instant. |
long |
getJavaTime()
Get the Java time in ms since 1 Jan 1970 UTC represented by this Instant. |
double |
getTd()
Get the Julian date in TD represented by this Instant. |
double |
getUt()
Get the Julian day number in UT represented by this Instant. |
double[] |
getYmd()
Convert this instant to year / month / day. |
double |
getΔT()
Get the ΔT value for this Instant. |
static double |
gstToLst(double GST,
double Λ)
Deprecated. |
static double |
gstToUt(double JD,
double GST)
Deprecated. |
static double |
javaToJulian(long time)
Convert a date/time in Java notation -- milliseconds since 1 Jan, 1970 -- to the Julian day relative to the astronomical epoch of 4713 BC. |
static long |
julianToJava(double julian)
Convert a Julian day relative to the astronomical epoch of 4713 BC to the date/time in Java notation -- milliseconds since 1 Jan, 1970. |
static double[] |
julianToYmd(double jd)
Convert a given Julian day relative to the astronomical epoch of 4713 BC to year / month / day. |
static double |
lstToGst(double LST,
double Λ)
Deprecated. |
static double |
tdToUt(double jd)
Convert a given Julian date from TD to UT. |
static java.lang.String |
timeAsHm(java.lang.Double hv)
Format a decimal time as a string in hours and minutes. |
static java.lang.String |
timeAsHms(java.lang.Double hv)
Format a decimal time as a string in hours, minutes and seconds. |
static double |
utToGmst(double jd)
Deprecated. |
static double |
utToTd(double jd)
Convert a given Julian date from UT to TD. |
static double |
ymdToJulian(int y,
int m,
double d)
Convert a given year / month / day to the Julian day relative to the astronomical epoch of 4713 BC. |
static double |
ymdToJulian(int y,
int m,
double d,
int ho,
int mn,
int se)
Convert a given year / month / day to the Julian day relative to the astronomical epoch of 4713 BC. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Instant(double jd)
jd
- The date to set as a fractional Julian day
number relative to the astronomical epoch
of 4713 BC UT.public Instant(long time)
time
- Java-style time in milliseconds since 1 Jan,
1970 UTC.public Instant(int y, int m, double d)
y
- Year number; BC years are in astronomical form,
so 1 BC = 0, 2 BC = -1, ...m
- Month number; January = 1.d
- Day of the month, including the fraction of
the day; e.g. 0.25 = 6 a.m.public Instant(int y, int m, int d, int ho, int mn, int se)
y
- Year number; BC years in astronomical form.m
- Month number; January = 1.d
- Day of the month.ho
- Hour.mn
- Minute.se
- Second.Method Detail |
---|
public static Instant fromTd(double td)
td
- The date to set as a Julian day number relative
to the astronomical epoch of 4713 BC UT, in
TD.
public static Instant fromTd(int y, int m, double d)
y
- Year number; BC years in astronomical form.m
- Month number; January = 1.d
- Day of the month, including the fraction of
the day; e.g. 0.25 = 6 a.m.
public double getUt()
public double[] getYmd()
public double getTd()
Note that we don't distinguish between TDT(TT) and TDB, which are always within 0.0017 seconds.
public double getGmst()
public long getJavaTime()
public double getΔT()
public static double utToTd(double jd)
Note that we don't distinguish between TDT(TT) and TDB, which are always within 0.0017 seconds.
From AA chapter 10.
jd
- The Julian date in UT.
public static double tdToUt(double jd)
Note that we don't distinguish between TDT(TT) and TDB, which are always within 0.0017 seconds.
From AA chapter 10.
jd
- The Julian date in TD.
public static double ymdToJulian(int y, int m, double d)
y
- Year number; BC years in astronomical form.m
- Month number; January = 1.d
- Day of the month, including the fraction of
the day; e.g. 0.25 = 6 a.m.
public static double ymdToJulian(int y, int m, double d, int ho, int mn, int se)
y
- Year number; BC years in astronomical form.m
- Month number; January = 1.d
- Day of the month.ho
- Hour.mn
- Minute.se
- Second.
public static double[] julianToYmd(double jd)
jd
- The Julian date to convert, relative
to the astronomical epoch of 4713 BC.
public static double javaToJulian(long time)
time
- Java-style time in milliseconds since 1 Jan,
1970.
public static long julianToJava(double julian)
julian
- A Julian date relative to the astronomical
epoch of 4713 BC.
@Deprecated public static double utToGmst(double jd)
jd
- The Julian day number, including fraction.
@Deprecated public static double gstToUt(double JD, double GST)
JD
- The Julian date of midnight on the day of
the given time.GST
- The Greenwich sideral time in decimal hours.
@Deprecated public static double gstToLst(double GST, double Λ)
GST
- The Greenwich sidereal time in decimal hours.Λ
- The observer's geographical longitude in radians;
west longitudes negative, east positive.
@Deprecated public static double lstToGst(double LST, double Λ)
LST
- The local sidereal time in decimal hours.Λ
- The observer's geographical longitude in radians;
west longitudes negative, east positive.
public static java.lang.String timeAsHm(java.lang.Double hv)
hv
- The time to format, as fractional hours.
public static java.lang.String timeAsHms(java.lang.Double hv)
hv
- The time to format, as decimal hours.
public static double calculateDeltaT(int year, double month)
year
- The year for which we want ΔT.month
- The fractional month; 0.5 = mid-Jan. Does not
have to be terribly accurate, given the precision
to which the variation in ΔT is known.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |