mhuss utils 1.1.5ws

com.mhuss.AstroLib
Class LunarCalc

java.lang.Object
  extended by com.mhuss.AstroLib.LunarCalc

public class LunarCalc
extends java.lang.Object

LunarCalc is a class that does lunar calculations that do not directly depend on the lunar fundamentals (although some do need to call functions in Lunar).

The code in this class also uses other classes outside of Lunar (and some of these classes in turn use Lunar), so these functions are in a separate class, to avoid circular dependencies.

Based in part on C code by Bill Gray (www.projectpluto.com)


Field Summary
static double SYNODIC_MONTH
          Exact number of days from one new moon to the next new moon.
 
Constructor Summary
LunarCalc()
           
 
Method Summary
static double ageOfMoonInDays()
          Calculate the present age of the moon in days.
static double ageOfMoonInDays(double jd)
          Calculate the age of the moon in days for the given Julian day.
static double ageOfMoonInDays(java.util.GregorianCalendar cal)
          Calculate the age of the moon in days for the given Calendar instance.
static int lunation()
          Calculate the lunation at the present time.
static int lunation(java.util.GregorianCalendar cal)
          Calculate the lunation for specified GregorianCalendar instance.
static int lunation(long jd)
          Calculate the lunation for specified Julian day.
static void main(java.lang.String[] args)
          (for unit testing only)
static double quarterChange(double jd, ObsInfo loc)
          Calculate the relatively exact time of the lunar quarter change (NM, 1Q, FM, or 3Q).
static java.lang.String summary(ObsInfo oi)
          Build a current lunar information summary String.
static java.lang.String summaryPHL()
          Build a current lunar information summary String for Phila, PA, USA (a shameless convenience function for dvaa.org).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SYNODIC_MONTH

public static final double SYNODIC_MONTH
Exact number of days from one new moon to the next new moon.

See Also:
Constant Field Values
Constructor Detail

LunarCalc

public LunarCalc()
Method Detail

ageOfMoonInDays

public static double ageOfMoonInDays(double jd)
Calculate the age of the moon in days for the given Julian day.

Parameters:
jd - - Julian day for which lunar age is required
Returns:
The lunar age in days (0.0 to 29.5306)

ageOfMoonInDays

public static double ageOfMoonInDays(java.util.GregorianCalendar cal)
Calculate the age of the moon in days for the given Calendar instance.

Parameters:
cal - - java.util.GregorianCalendar holding date for which lunar age is required
Returns:
The lunar age in days (0.0 to 29.5306)

ageOfMoonInDays

public static double ageOfMoonInDays()
Calculate the present age of the moon in days.

Returns:
The lunar age in days (0.0 to 29.5306)

lunation

public static int lunation(long jd)
Calculate the lunation for specified Julian day.

A "lunation" is E. W. Brown's numbered series of lunar cycles. Lunation 1 was on January 16, 1923.

Parameters:
jd - Julian day
Returns:
Lunation number

lunation

public static int lunation(java.util.GregorianCalendar cal)
Calculate the lunation for specified GregorianCalendar instance.

A "lunation" is E. W. Brown's numbered series of lunar cycles. Lunation 1 was on January 16, 1923.

Parameters:
cal - java.util.GregorianCalendar to use
Returns:
Lunation number

lunation

public static int lunation()
Calculate the lunation at the present time.

A "lunation" is E. W. Brown's numbered series of lunar cycles. Lunation 1 was on January 16, 1923.

Returns:
Lunation number

summary

public static java.lang.String summary(ObsInfo oi)
Build a current lunar information summary String.

The summary contains the lunation, age in days, rise, and set times.

Parameters:
oi - - The observer's location
Returns:
The summary string

summaryPHL

public static java.lang.String summaryPHL()
Build a current lunar information summary String for Phila, PA, USA (a shameless convenience function for dvaa.org).

The default summary contains the lunation, age in days, rise, and set times for Philadelphia, PA, USA as the observer's location.

Returns:
The summary string

quarterChange

public static double quarterChange(double jd,
                                   ObsInfo loc)
Calculate the relatively exact time of the lunar quarter change (NM, 1Q, FM, or 3Q).

Input must be less than one day before the exact change

Parameters:
jd - Approximate Julian day number of change
loc - Observer location
Returns:
The relatively exact time

main

public static void main(java.lang.String[] args)
(for unit testing only)


mhuss utils 1.1.5ws

bottom text