Record Class JulianDate

java.lang.Object
java.lang.Record
net.e175.klaus.solarpositioning.JulianDate

public record JulianDate(double julianDate, double deltaT) extends Record
Calculate Julian date for a given point in time. This follows the algorithm described in Reda, I.; Andreas, A. (2003): Solar Position Algorithm for Solar Radiation Applications. NREL Report No. TP-560-34302, Revised January 2008.
Author:
Klaus Brunner
  • Constructor Details

    • JulianDate

      public JulianDate(ZonedDateTime date)
      Construct a Julian date, assuming deltaT to be 0.
      Parameters:
      date - date and time
    • JulianDate

      public JulianDate(ZonedDateTime date, double deltaT)
      Construct a Julian date, observing deltaT.
      Parameters:
      date - date and time
      deltaT - Difference between earth rotation time and terrestrial time (or Universal Time and Terrestrial Time), in seconds. See https://maia.usno.navy.mil/products/deltaT. For the years 2023–2028, a reasonably accurate default would be 69.
    • JulianDate

      public JulianDate(double julianDate, double deltaT)
      Creates an instance of a JulianDate record class.
      Parameters:
      julianDate - the value for the julianDate record component
      deltaT - the value for the deltaT record component
  • Method Details

    • julianEphemerisDay

      public double julianEphemerisDay()
    • julianCentury

      public double julianCentury()
    • julianEphemerisCentury

      public double julianEphemerisCentury()
    • julianEphemerisMillennium

      public double julianEphemerisMillennium()
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • julianDate

      public double julianDate()
      Returns the value of the julianDate record component.
      Returns:
      the value of the julianDate record component
    • deltaT

      public double deltaT()
      Returns the value of the deltaT record component.
      Returns:
      the value of the deltaT record component