Class LunarCalc
- java.lang.Object
-
- com.mhuss.AstroLib.LunarCalc
-
public class LunarCalc extends java.lang.ObjectLunarCalc 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
Fields Modifier and Type Field and Description static doubleSYNODIC_MONTHExact number of days from one new moon to the next new moon.
-
Constructor Summary
Constructors Constructor and Description LunarCalc()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method and Description static doubleageOfMoonInDays()Calculate the present age of the moon in days.static doubleageOfMoonInDays(double jd)Calculate the age of the moon in days for the given Julian day.static doubleageOfMoonInDays(java.util.GregorianCalendar cal)Calculate the age of the moon in days for the given Calendar instance.static intlunation()Calculate the lunation at the present time.static intlunation(java.util.GregorianCalendar cal)Calculate the lunation for specified GregorianCalendar instance.static intlunation(long jd)Calculate the lunation for specified Julian day.static voidmain(java.lang.String[] args)(for unit testing only)static doublequarterChange(double jd, ObsInfo loc)Calculate the relatively exact time of the lunar quarter change (NM, 1Q, FM, or 3Q).static java.lang.Stringsummary(ObsInfo oi)Build a current lunar information summary String.static java.lang.StringsummaryPHL()Build a current lunar information summary String for Phila, PA, USA (a shameless convenience function for dvaa.org).
-
-
-
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
-
-
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 changeloc- Observer location- Returns:
- The relatively exact time
-
main
public static void main(java.lang.String[] args)
(for unit testing only)
-
-
DMelt 3.0 © DataMelt by jWork.ORG