Class Astronomy

java.lang.Object
org.astronomie.info.Astronomy

public class Astronomy extends Object
Astronomical Calculations
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static class 
    set of variables for sun calculations
    static class 
    set of variables for sunrise calculations
    static class 
    time calculations
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static double
    calcJD(int day, int month, int year)
     
    ecl2Equ(Astronomy.Coor coor, double TDT)
    Transform ecliptical coordinates (lon/lat) to equatorial coordinates (RA/dec)
    equ2Altaz(Astronomy.Coor coor, double TDT, double geolat, double lmst)
    Transform equatorial coordinates (RA/Dec) to horizonal coordinates (azimuth/altitude) Refraction is ignored
    equPolar2Cart(double lon, double lat, double distance)
    Calculate cartesian from polar coordinates
    static double
    frac(double x)
     
    geoEqu2TopoEqu(Astronomy.Coor coor, Astronomy.Coor observer, double lmst)
    Transform geocentric equatorial coordinates (RA/Dec) to topocentric equatorial coordinates
    static double
    gMST(double JD)
     
    static double
    gMST2LMST(double gmst, double lon)
     
    static double
    gMST2UT(double JD, double gmst)
     
    static int
    Int(double x)
     
    static double
    mod(double a, double b)
     
    static double
    mod2Pi(double x)
     
    moonPosition(Astronomy.Coor sunCoor, double TDT)
    Calculate data and coordinates for the Moon Coordinates are accurate to about 1/5 degree (in ecliptic coordinates)
    moonPosition(Astronomy.Coor sunCoor, double TDT, Astronomy.Coor observer, double lmst)
     
    moonRise(double JD, double deltaT, double lon, double lat, double zone, boolean recursive)
    Find local time of moonrise and moonset JD is the Julian Date of 0h local time (midnight) Accurate to about 5 minutes or better recursive: 1 - calculate rise/set in UTC recursive: 0 - find rise/set on the current local day (set could also be first) returns 0.000000000 for moonrise/set does not occur on selected day
    observer2EquCart(double lon, double lat, double height, double gmst)
    Calculate observers cartesian equatorial coordinates (x,y,z in celestial frame) from geodetic coordinates (longitude, latitude, height above WGS84 ellipsoid) Currently only used to calculate distance of a body from the observer
    static double
    refraction(double alt)
    Rough refraction formula using standard atmosphere: 1015 mbar and 10°C Input true altitude in radians, Output: increase in altitude in degrees
    static double
    round10(double x)
     
    static double
    round100(double x)
     
    static double
    round1000(double x)
     
    static double
    round10000(double x)
     
    static double
    round100000(double x)
     
    static double
    round1000000(double x)
     
    static String
    sign(double lon)
     
    static double
    sqr(double x)
     
    sunPosition(double TDT)
    Calculate coordinates for Sun Coordinates are accurate to about 10s (right ascension) and a few minutes of arc (declination)
    sunPosition(double TDT, double geolat, double lmst)
     
    sunRise(double JD, double deltaT, double lon, double lat, double zone, boolean recursive)
    Find (local) time of sunrise and sunset, and twilights JD is the Julian Date of 0h local time (midnight) Accurate to about 1-2 minutes recursive: 1 - calculate rise/set in UTC in a second run recursive: 0 - find rise/set on the current local day.
    static String
    timeHHMM(double hh)
     
    static String
    timeHHMMdec(double hh)
     
    static String
    timeHHMMSS(double hh)
     
    static String
    timeHHMMSSdec(double hh)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • Astronomy

      public Astronomy()
  • Method Details

    • Int

      public static int Int(double x)
    • sqr

      public static double sqr(double x)
    • frac

      public static double frac(double x)
    • mod

      public static double mod(double a, double b)
    • mod2Pi

      public static double mod2Pi(double x)
    • round1000000

      public static double round1000000(double x)
    • round100000

      public static double round100000(double x)
    • round10000

      public static double round10000(double x)
    • round1000

      public static double round1000(double x)
    • round100

      public static double round100(double x)
    • round10

      public static double round10(double x)
    • timeHHMMSS

      public static String timeHHMMSS(double hh)
      Parameters:
      hh - Decimal Time
      Returns:
      a String of decimal Time HH:MM:SS
    • timeHHMMSSdec

      public static String timeHHMMSSdec(double hh)
      Parameters:
      hh - Decimal Time
      Returns:
      a String of decimal Time HH:MM:SS = Decimal Time
    • timeHHMMdec

      public static String timeHHMMdec(double hh)
      Parameters:
      hh - Decimal Time
      Returns:
      a String of decimal Time HH:MM = Decimal Time
    • timeHHMM

      public static String timeHHMM(double hh)
      Parameters:
      hh - Decimal Time
      Returns:
      a String of decimal Time HH:MM
    • sign

      public static String sign(double lon)
      Parameters:
      lon - geographical longitude in degree
      Returns:
      the name String of a sign
    • calcJD

      public static double calcJD(int day, int month, int year)
      Parameters:
      day -
      month -
      year -
      Returns:
      Julian date: valid only from 1.3.1901 to 28.2.2100
    • gMST

      public static double gMST(double JD)
      Parameters:
      JD - Julian Date
      Returns:
      Julian Date converted to Greenwich Mean Sidereal Time
    • gMST2UT

      public static double gMST2UT(double JD, double gmst)
      Parameters:
      JD - Julian Date
      gmst - Greenwich mean sidereal
      Returns:
      convert Greenweek mean sidereal time to UT
    • gMST2LMST

      public static double gMST2LMST(double gmst, double lon)
      Parameters:
      gmst - Greenwich mean sidereal
      lon - geographical longitude in radians, East is positive
      Returns:
      Local Mean Sidereal Time
    • ecl2Equ

      public static Astronomy.Coor ecl2Equ(Astronomy.Coor coor, double TDT)
      Transform ecliptical coordinates (lon/lat) to equatorial coordinates (RA/dec)
      Parameters:
      coor -
      TDT -
      Returns:
      equatorial coordinate (RA/dec)
    • equ2Altaz

      public static Astronomy.Coor equ2Altaz(Astronomy.Coor coor, double TDT, double geolat, double lmst)
      Transform equatorial coordinates (RA/Dec) to horizonal coordinates (azimuth/altitude) Refraction is ignored
      Parameters:
      coor -
      TDT -
      geolat -
      lmst -
      Returns:
      horizonal coordinates (azimuth/altitude)
    • geoEqu2TopoEqu

      public static Astronomy.Coor geoEqu2TopoEqu(Astronomy.Coor coor, Astronomy.Coor observer, double lmst)
      Transform geocentric equatorial coordinates (RA/Dec) to topocentric equatorial coordinates
      Parameters:
      coor -
      observer -
      lmst -
      Returns:
      topocentric equatorial coordinates
    • equPolar2Cart

      public static Astronomy.Coor equPolar2Cart(double lon, double lat, double distance)
      Calculate cartesian from polar coordinates
      Parameters:
      lon -
      lat -
      distance -
      Returns:
      cartesian
    • observer2EquCart

      public static Astronomy.Coor observer2EquCart(double lon, double lat, double height, double gmst)
      Calculate observers cartesian equatorial coordinates (x,y,z in celestial frame) from geodetic coordinates (longitude, latitude, height above WGS84 ellipsoid) Currently only used to calculate distance of a body from the observer
      Parameters:
      lon -
      lat -
      height -
      gmst -
      Returns:
      observers cartesian equatorial coordinates
    • sunPosition

      public static Astronomy.Coor sunPosition(double TDT)
      Calculate coordinates for Sun Coordinates are accurate to about 10s (right ascension) and a few minutes of arc (declination)
      Parameters:
      TDT -
      Returns:
      coordinates for Sun
    • sunPosition

      public static Astronomy.Coor sunPosition(double TDT, double geolat, double lmst)
      Parameters:
      TDT -
      geolat -
      lmst -
      Returns:
      coordinates for Sun
    • moonPosition

      public static Astronomy.Coor moonPosition(Astronomy.Coor sunCoor, double TDT)
      Calculate data and coordinates for the Moon Coordinates are accurate to about 1/5 degree (in ecliptic coordinates)
      Parameters:
      sunCoor -
      TDT -
      Returns:
      data and coordinates for the Moon
    • moonPosition

      public static Astronomy.Coor moonPosition(Astronomy.Coor sunCoor, double TDT, Astronomy.Coor observer, double lmst)
      Parameters:
      sunCoor -
      TDT -
      observer -
      lmst -
      Returns:
      data and coordinates for the Moon
    • refraction

      public static double refraction(double alt)
      Rough refraction formula using standard atmosphere: 1015 mbar and 10°C Input true altitude in radians, Output: increase in altitude in degrees
      Parameters:
      alt -
      Returns:
      increase in altitude in degrees
    • sunRise

      public static Astronomy.Riseset sunRise(double JD, double deltaT, double lon, double lat, double zone, boolean recursive)
      Find (local) time of sunrise and sunset, and twilights JD is the Julian Date of 0h local time (midnight) Accurate to about 1-2 minutes recursive: 1 - calculate rise/set in UTC in a second run recursive: 0 - find rise/set on the current local day. This is set when doing the first call to this function
      Parameters:
      JD -
      deltaT -
      lon -
      lat -
      zone -
      recursive -
      Returns:
      (local) time of sunrise and sunset, and twilights
    • moonRise

      public static Astronomy.Riseset moonRise(double JD, double deltaT, double lon, double lat, double zone, boolean recursive)
      Find local time of moonrise and moonset JD is the Julian Date of 0h local time (midnight) Accurate to about 5 minutes or better recursive: 1 - calculate rise/set in UTC recursive: 0 - find rise/set on the current local day (set could also be first) returns 0.000000000 for moonrise/set does not occur on selected day
      Parameters:
      JD -
      deltaT -
      lon -
      lat -
      zone -
      recursive -
      Returns:
      local time of moonrise and moonset