astro
Class Astro

java.lang.Object
  extended by astro.Astro

public class Astro
extends Object

Class Astro contains certain routines, that are everyday's need in an astronomer's life. All routines are static. Some methods are very old and use deprecated java methods.


Nested Class Summary
static class Astro.Distance
          Prints out the distance between two points.
static class Astro.HeliacalRise
          Prints the date when the sun rises with the target in Germany.
static class Astro.Jd
          Prints out current jd or, if a parameter is given, the jd of the date given in the first argument.
static class Astro.Mjd
          Prints out current jd or, if a parameter is given, the jd of the date given in the first argument.
 
Field Summary
static double ACCURACY
           
static char ARCMIN
          Char for arcminutes.
static char ARCSEC
          Char for arcseconds.
static double AU
           
static double C
           
static double COSEKL
          The cosine of the inclination of the eclitic.
static double EKL
          Inclination of ecliptic in radians.
static double JULIANCENTURY
          The number of days in a julian century.
private static DateFormat[] KNOWN
          A mixture of different date parsers.
static double MS100YEAR
          The number of ms in 100 years.
static double MS1DAY
          The number of ms in a day.
static DateFormat PARSE
          Default date parser.
static double RFLUX
          Photon flux above atmosphere in R per 1m diameter (circular) per sec.
static double SIDEREALYEAR
          The number of days in one sidereal year.
static double SIDSOL
          Conversion factor from sidereal time to solar time.
static double SINEKL
          The sine of the inclination of the eclitic.
static double SOL_TO_SID
          Conversion factor from solar time to sidereal time.
static double TROPICALYEAR
          The number of days in one tropical year.
static double VFLUX
          Photon flux above atmosphere in V per 1m diameter (circular) per sec.
 
Constructor Summary
Astro()
           
 
Method Summary
static String americanDate(double jd)
          Converts the julian date into a Date String following the American locale.
static Date culminatesWhen(double ra)
          Returns the date at which the target culminated at local midnight in the year 2000.
static double culminatesWith(double de, double phi)
          Calculates the culmination height of a target given the declination and longitude.
static double distance(Position p1, Position p2)
          Calcualtes the distance of two sky positions, given by their ra and dec.
static Date heliacalRise(double ra, double de, double lat, double h, double solh)
          Given a right ascension and a declination of the target, this method calculates the date when the object first reaches the target height for the given solar elevation.
static Date heliacalRise(double ra, double de, double lat, double h, double solh, double sec)
          Given a right ascension and a declination of the target, this method calculates the date when the object first reaches its target height at least the stated number of seconds before the sun rises to the given solar elevation.
static Date heliacalSet(double ra, double de, double lat, double h, double solh)
          Given a right ascension and a declination of the target, this method calculates the date when the object last reaches the target height for the given solar elevation.
static Date heliacalSet(double ra, double de, double lat, double h, double solh, double sec)
          Given a right ascension and a declination of the target, this method calculates the date when the object last reaches the target height for the given solar elevation.
static double JD(Date datum)
          Gets the julian date from a Dateobject.
static Date JD(double jd)
          Converts the julian date into a Dateobject.
static double JD(String datumstring)
          Gets the julian date from a date string.
static double mjd(Date datum)
          Gets the modified julian date from a Dateobject.
static Date mjd(double mjd)
          Converts the modified julian date into a Dateobject.
static double mjd(String datumstring)
          Gets the modified julian date from a date string.
static double overlap(double theta1, double span1, double theta2, double span2)
          Given two positions in a 24-h angle and given two half-intervals, this method returns the overlap.
static Date riseWithSunRise(double ra, double de, double lat)
          Returns the date when a specified target at a specified latitude rises with the sun.
static Date riseWithSunSet(double ra, double de, double lat)
          Returns the date when a specified target at a specified latitude rises with the sun.
static Date setWithSunRise(double ra, double de, double lat)
          Returns the date when a specified target at a specified latitude rises with the sun.
static Date setWithSunSet(double ra, double de, double lat)
          Returns the date when a specified target at a specified latitude rises with the sun.
static double toLT(double jd, Location site)
          Converts a julian date to the local time.
private static Date tryParse(String datumstring)
          We try various date parser and return the first successful one.
static double visibleFor(double de, double phi, double h)
          Returns the time a target is visible in seconds.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

EKL

public static final double EKL
Inclination of ecliptic in radians.

See Also:
Constant Field Values

SINEKL

public static final double SINEKL
The sine of the inclination of the eclitic.

See Also:
Constant Field Values

COSEKL

public static final double COSEKL
The cosine of the inclination of the eclitic.

See Also:
Constant Field Values

MS1DAY

public static final double MS1DAY
The number of ms in a day.

See Also:
Constant Field Values

MS100YEAR

public static final double MS100YEAR
The number of ms in 100 years.

See Also:
Constant Field Values

JULIANCENTURY

public static final double JULIANCENTURY
The number of days in a julian century.

See Also:
Constant Field Values

SIDEREALYEAR

public static final double SIDEREALYEAR
The number of days in one sidereal year.

See Also:
Constant Field Values

TROPICALYEAR

public static final double TROPICALYEAR
The number of days in one tropical year.

See Also:
Constant Field Values

SOL_TO_SID

public static final double SOL_TO_SID
Conversion factor from solar time to sidereal time.

See Also:
Constant Field Values

SIDSOL

public static final double SIDSOL
Conversion factor from sidereal time to solar time.

See Also:
Constant Field Values

AU

public static final double AU
See Also:
Constant Field Values

C

public static final double C
See Also:
Constant Field Values

VFLUX

public static final double VFLUX
Photon flux above atmosphere in V per 1m diameter (circular) per sec.

See Also:
Constant Field Values

RFLUX

public static final double RFLUX
Photon flux above atmosphere in R per 1m diameter (circular) per sec.

See Also:
Constant Field Values

ACCURACY

public static final double ACCURACY
See Also:
Constant Field Values

ARCSEC

public static final char ARCSEC
Char for arcseconds.

See Also:
Constant Field Values

ARCMIN

public static final char ARCMIN
Char for arcminutes.

See Also:
Constant Field Values

PARSE

public static final DateFormat PARSE
Default date parser.


KNOWN

private static final DateFormat[] KNOWN
A mixture of different date parsers.

Constructor Detail

Astro

public Astro()
Method Detail

JD

public static double JD(String datumstring)
Gets the julian date from a date string. Returned value is jd.fjd.

Parameters:
datumstring - The date as a string
Returns:
The jd as a double.

mjd

public static double mjd(String datumstring)
Gets the modified julian date from a date string. Returned value is jd.fjd.

Parameters:
datumstring - The date as a string
Returns:
The jd as a double.

tryParse

private static Date tryParse(String datumstring)
We try various date parser and return the first successful one.


JD

public static double JD(Date datum)
Gets the julian date from a Dateobject.

Parameters:
datum - The Date object
Returns:
The jd as a double.

mjd

public static double mjd(Date datum)
Gets the modified julian date from a Dateobject.

Parameters:
datum - The Date object
Returns:
The jd as a double.

mjd

public static Date mjd(double mjd)
Converts the modified julian date into a Dateobject.

Parameters:
mjd - The modified julian date as a double.
Returns:
The Date object matching the parameter mjd.

JD

public static Date JD(double jd)
Converts the julian date into a Dateobject.

Parameters:
jd - The julian date as a double.
Returns:
The Date object matching the parameter jd.

americanDate

public static String americanDate(double jd)
Converts the julian date into a Date String following the American locale.

Parameters:
jd - The julian date as a double.
Returns:
The date as an american-local String.

toLT

public static double toLT(double jd,
                          Location site)
Converts a julian date to the local time.

Parameters:
jd - The julian date (UT0).
site - The location of the observer
Returns:
double The local time in hours and fractional hours.

culminatesWith

public static double culminatesWith(double de,
                                    double phi)
Calculates the culmination height of a target given the declination and longitude. Returned value is in degrees.

Parameters:
de - Declination in degrees.
phi - Latitude in degrees.
Returns:
The culmination height in degrees.

visibleFor

public static double visibleFor(double de,
                                double phi,
                                double h)
Returns the time a target is visible in seconds.

Parameters:
de - Declination in degrees.
phi - Latitude in degrees.

culminatesWhen

public static Date culminatesWhen(double ra)
Returns the date at which the target culminated at local midnight in the year 2000. Strictly speaking, the day in the year 2000 is calculated when the sun had the opposition in right ascension to the target.

Parameters:
ra - Right ascension in degrees.

riseWithSunRise

public static Date riseWithSunRise(double ra,
                                   double de,
                                   double lat)
Returns the date when a specified target at a specified latitude rises with the sun.

Parameters:
ra - Right ascension of target in degrees.
de - Declination of target in degrees.
lat - Latitude of location in degrees.

riseWithSunSet

public static Date riseWithSunSet(double ra,
                                  double de,
                                  double lat)
Returns the date when a specified target at a specified latitude rises with the sun.

Parameters:
ra - Right ascension of target in degrees.
de - Declination of target in degrees.
lat - Latitude of location in degrees.

setWithSunRise

public static Date setWithSunRise(double ra,
                                  double de,
                                  double lat)
Returns the date when a specified target at a specified latitude rises with the sun.

Parameters:
ra - Right ascension of target in degrees.
de - Declination of target in degrees.
lat - Latitude of location in degrees.

setWithSunSet

public static Date setWithSunSet(double ra,
                                 double de,
                                 double lat)
Returns the date when a specified target at a specified latitude rises with the sun.

Parameters:
ra - Right ascension of target in degrees.
de - Declination of target in degrees.
lat - Latitude of location in degrees.

overlap

public static double overlap(double theta1,
                             double span1,
                             double theta2,
                             double span2)
Given two positions in a 24-h angle and given two half-intervals, this method returns the overlap. A target at ra1 with a visibility span of ± Δt1 can be intersected with a solar ra2 and a twilight span of Δt2 by taking into account that the sidereal time &theta1 = ra1 and &theta2 = ra2-12 and then issuing the numbers to this method.

Parameters:
theta1 - First (sidereal) time, any intervall
span1 - First half span, i.e. from theta1-span1 to theta1+span1
theta2 - Second (sidereal) time, any intervall
span2 - Second half span
Returns:
The overlap in hours.

heliacalRise

public static Date heliacalRise(double ra,
                                double de,
                                double lat,
                                double h,
                                double solh)
Given a right ascension and a declination of the target, this method calculates the date when the object first reaches the target height for the given solar elevation. For target and solar height zero, this method delivers the same as riseWithSunRise(double, double, double).


heliacalRise

public static Date heliacalRise(double ra,
                                double de,
                                double lat,
                                double h,
                                double solh,
                                double sec)
Given a right ascension and a declination of the target, this method calculates the date when the object first reaches its target height at least the stated number of seconds before the sun rises to the given solar elevation. For target and solar height zero, this method delivers the same as riseWithSunRise(double, double, double).


heliacalSet

public static Date heliacalSet(double ra,
                               double de,
                               double lat,
                               double h,
                               double solh)
Given a right ascension and a declination of the target, this method calculates the date when the object last reaches the target height for the given solar elevation. For target and solar height zero, this method delivers the same as setWithSunSet(double, double, double).


heliacalSet

public static Date heliacalSet(double ra,
                               double de,
                               double lat,
                               double h,
                               double solh,
                               double sec)
Given a right ascension and a declination of the target, this method calculates the date when the object last reaches the target height for the given solar elevation. For target and solar height zero, this method delivers the same as setWithSunSet(double, double, double).


distance

public static double distance(Position p1,
                              Position p2)
Calcualtes the distance of two sky positions, given by their ra and dec. The returned value is in degrees.

Returns:
-1 If either position is null, NaN if either position is invalid.