|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.hermit.astro.Observation
public class Observation
This class represents a particular set of circumstances for a calculation, for example at a particular location and moment in time. It provides methods to access information about all the celestial bodies relating to this observation.
There may be multiple Observations in existence at one time, each one representing a particular set of circumstances -- for example, a particular time of observation. Each Observation has its own set of Body objects associated with it.
Nested Class Summary | |
---|---|
static class |
Observation.OField
This enumeration defines the data fields that are stored for each body. |
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 | |
---|---|
Observation()
Create an observation for right now. |
|
Observation(double jd)
Create an observation for a given Julian day. |
|
Observation(Instant i)
Create an observation for a given Julian day. |
|
Observation(Instant i,
Position pos)
Create an observation for a given Julian day. |
|
Observation(long time)
Create an observation for a given Java time. |
|
Observation(long time,
Position pos)
Create an observation for a given Java time. |
Method Summary | |
---|---|
static java.lang.String |
angleAsDms(java.lang.Double ar)
Deprecated. |
static java.lang.String |
angleAsHms(java.lang.Double ar)
Deprecated. |
void |
apparentEquatorialToEcliptic(double α,
double δ,
double[] pos)
Convert apparent equatorial co-ordinates (right ascension and declination) to ecliptic co-ordinates for the circumstances of this Observation. |
void |
eclipticToApparentEquatorial(double λ,
double β,
double[] pos)
Convert ecliptic co-ordinates to apparent equatorial co-ordinates (right ascension and declination) for the circumstances of this Observation. |
void |
eclipticToMeanEquatorial(double λ,
double β,
double[] pos)
Convert ecliptic co-ordinates to mean equatorial co-ordinates (right ascension and declination) for the circumstances of this Observation. |
double |
get(Observation.OField key)
Get the value of one of the data fields of this Observation. |
Body |
getBody(Body.Name which)
Get the named celestial body. |
double |
getDaysSince(double epoch)
Get the number of days since a given epoch. |
Moon |
getMoon()
Get the Moon. |
double |
getObserverAltitude()
Get the observer's altitude. |
Position |
getObserverPosition()
Get the observer's geographical position. |
Planet |
getPlanet(Body.Name which)
Get a planet. |
Sun |
getSun()
Get the Sun. |
double |
getTd()
Get the Julian date in TD of this Observation. |
Instant |
getTime()
Get the time of this Observation. |
double |
getUt()
Get the UT1 Julian date of this Observation. |
protected void |
invalidate()
Invalidate all of the data caches associated with this Observation. |
void |
meanEquatorialToEcliptic(double α,
double δ,
double[] pos)
Convert mean equatorial co-ordinates (right ascension and declination) to ecliptic co-ordinates for the circumstances of this Observation. |
protected void |
put(Observation.OField key,
java.lang.Double val)
Save a specified value in the data cache. |
void |
setDate(int y,
int m,
double d)
Set the date / time of this Observation. |
void |
setJavaTime(long time)
Set the time of this Observation. |
void |
setJulian(double jd)
Set the time for calculations as a UTC Julian date. |
void |
setObserverAltitude(double alt)
Set the observer's altitude for this observation. |
void |
setObserverPosition(Position pos)
Set the observer's position for this observation. |
void |
setTime(Instant time)
Set the time for calculations. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Observation(Instant i)
i
- The Instant of time for this observation.public Observation(Instant i, Position pos)
i
- The Instant of time for this observation.pos
- The observer's geographical position.public Observation(long time)
time
- Java-style time in milliseconds since 1 Jan,
1970.public Observation(long time, Position pos)
time
- Java-style time in milliseconds since 1 Jan,
1970.pos
- The observer's geographical position.public Observation()
public Observation(double jd)
jd
- The date to set as a Julian date relative
to the astronomical epoch of 4713 BC UTC.Method Detail |
---|
public Instant getTime()
public double getUt()
public double getTd()
Note that we don't distinguish between TDT(TT) and TDB, which are always within 0.0017 seconds.
public void setTime(Instant time)
time
- The time to use for all calculations on this
Observation.public void setDate(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 void setJavaTime(long time)
time
- Java-style time in milliseconds since 1 Jan,
1970.public void setJulian(double jd)
jd
- The date to set as a Julian date relative
to the astronomical epoch of 4713 BC UTC.public double getDaysSince(double epoch)
epoch
- Epoch of interest (e.g. Instant.JD_1990).
public Position getObserverPosition()
public void setObserverPosition(Position pos)
pos
- The observer's geographical position.public double getObserverAltitude()
public void setObserverAltitude(double alt)
alt
- The observer's altitude above sea level in metres.public Body getBody(Body.Name which)
Bear in mind that there may be multiple Observations in use; each one has its own set of associated Body objects.
which
- Which body to get.
public Sun getSun()
This is essentially a convenience routine which calls getBody() and casts the return to the correct type.
public Moon getMoon()
This is essentially a convenience routine which calls getBody() and casts the return to the correct type.
public Planet getPlanet(Body.Name which)
This is essentially a convenience routine which calls getBody() and casts the return to the correct type.
which
- Which planet to get.
public double get(Observation.OField key)
key
- The field we want.
protected void put(Observation.OField key, java.lang.Double val)
key
- The name of the value to save.val
- The value.protected void invalidate()
public void eclipticToMeanEquatorial(double λ, double β, double[] pos)
Note the returned ascension is in radians, not hours, for internal consistency.
From AA chapter 13.
λ
- The ecliptic longitude, in radians.β
- The ecliptic latitude, in radians.pos
- An array { α, δ } in which the right ascension
in radians and the declination in radians will
be placed.public void eclipticToApparentEquatorial(double λ, double β, double[] pos)
Note the returned ascension is in radians, not hours, for internal consistency.
From AA chapter 13.
λ
- The ecliptic longitude, in radians.β
- The ecliptic latitude, in radians.pos
- An array { α, δ } in which the right ascension
in radians and the declination in radians will
be placed.public void meanEquatorialToEcliptic(double α, double δ, double[] pos)
Note the given ascension is in radians, not hours, for internal consistency.
From AA chapter 13.
α
- The mean right ascension, in radians.δ
- The mean declination, in radians.pos
- An array { λ, β } in which the ecliptic longitude
and the ecliptic latitude in radians will
be placed.public void apparentEquatorialToEcliptic(double α, double δ, double[] pos)
Note the given ascension is in radians, not hours, for internal consistency.
From AA chapter 13.
α
- The mean right ascension, in radians.δ
- The mean declination, in radians.pos
- An array { λ, β } in which the ecliptic longitude
and the ecliptic latitude in radians will
be placed.@Deprecated public static java.lang.String angleAsDms(java.lang.Double ar)
ar
- The angle to format, in radians.
@Deprecated public static java.lang.String angleAsHms(java.lang.Double ar)
ar
- The angle to format, in radians.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |