Class NOAACalculator

    • Method Detail

      • getJulianDay

        private static double getJulianDay​(Calendar calendar)
        Return the Julian day from a Java Calendar
        Parameters:
        calendar - The Java Calendar
        Returns:
        the Julian day corresponding to the date Note: Number is returned for start of day. Fractional days should be added later.
      • getJulianCenturiesFromJulianDay

        private static double getJulianCenturiesFromJulianDay​(double julianDay)
        Convert Julian day to centuries since J2000.0.
        Parameters:
        julianDay - the Julian Day to convert
        Returns:
        the centuries since 2000 Julian corresponding to the Julian Day
      • getJulianDayFromJulianCenturies

        private static double getJulianDayFromJulianCenturies​(double julianCenturies)
        Convert centuries since J2000.0 to Julian day.
        Parameters:
        julianCenturies - the number of Julian centuries since J2000.0
        Returns:
        the Julian Day corresponding to the Julian centuries passed in
      • getSunGeometricMeanLongitude

        private static double getSunGeometricMeanLongitude​(double julianCenturies)
        Returns the Geometric Mean Longitude of the Sun.
        Parameters:
        julianCenturies - the number of Julian centuries since J2000.0
        Returns:
        the Geometric Mean Longitude of the Sun in degrees
      • getSunGeometricMeanAnomaly

        private static double getSunGeometricMeanAnomaly​(double julianCenturies)
        Returns the Geometric Mean Anomaly of the Sun.
        Parameters:
        julianCenturies - the number of Julian centuries since J2000.0
        Returns:
        the Geometric Mean Anomaly of the Sun in degrees
      • getSunEquationOfCenter

        private static double getSunEquationOfCenter​(double julianCenturies)
        Returns the equation of center for the sun.
        Parameters:
        julianCenturies - the number of Julian centuries since J2000.0
        Returns:
        the equation of center for the sun in degrees
      • getSunTrueLongitude

        private static double getSunTrueLongitude​(double julianCenturies)
        Return the true longitude of the sun
        Parameters:
        julianCenturies - the number of Julian centuries since J2000.0
        Returns:
        the sun's true longitude in degrees
      • getSunApparentLongitude

        private static double getSunApparentLongitude​(double julianCenturies)
        Return the apparent longitude of the sun
        Parameters:
        julianCenturies - the number of Julian centuries since J2000.0
        Returns:
        sun's apparent longitude in degrees
      • getMeanObliquityOfEcliptic

        private static double getMeanObliquityOfEcliptic​(double julianCenturies)
        Returns the mean obliquity of the ecliptic (Axial tilt).
        Parameters:
        julianCenturies - the number of Julian centuries since J2000.0
        Returns:
        the mean obliquity in degrees
      • getObliquityCorrection

        private static double getObliquityCorrection​(double julianCenturies)
        Returns the corrected obliquity of the ecliptic (Axial tilt).
        Parameters:
        julianCenturies - the number of Julian centuries since J2000.0
        Returns:
        the corrected obliquity in degrees
      • getSunDeclination

        private static double getSunDeclination​(double julianCenturies)
        Return the declination of the sun.
        Parameters:
        julianCenturies - the number of Julian centuries since J2000.0
        Returns:
        the sun's declination in degrees
      • getEquationOfTime

        private static double getEquationOfTime​(double julianCenturies)
        Return the Equation of Time - the difference between true solar time and mean solar time
        Parameters:
        julianCenturies - the number of Julian centuries since J2000.0
        Returns:
        equation of time in minutes of time
      • getSunHourAngleAtSunrise

        private static double getSunHourAngleAtSunrise​(double lat,
                                                       double solarDec,
                                                       double zenith)
        Return the hour angle of the sun at sunrise for the latitude.
        Parameters:
        lat - , the latitude of observer in degrees
        solarDec - the declination angle of sun in degrees
        zenith - the zenith
        Returns:
        hour angle of sunrise in radians
      • getSunHourAngleAtSunset

        private static double getSunHourAngleAtSunset​(double lat,
                                                      double solarDec,
                                                      double zenith)
        Returns the hour angle of the sun at sunset for the latitude. TODO: use - getSunHourAngleAtSunrise(double, double, double) implementation to avoid duplication of code.
        Parameters:
        lat - the latitude of observer in degrees
        solarDec - the declination angle of sun in degrees
        zenith - the zenith
        Returns:
        the hour angle of sunset in radians
      • getSolarElevation

        public static double getSolarElevation​(Calendar cal,
                                               double lat,
                                               double lon)
        Return the Solar Elevation for the horizontal coordinate system at the given location at the given time. Can be negative if the sun is below the horizon. Not corrected for altitude.
        Parameters:
        cal - time of calculation
        lat - latitude of location for calculation
        lon - longitude of location for calculation
        Returns:
        solar elevation in degrees - horizon is 0 degrees, civil twilight is -6 degrees
      • getSolarAzimuth

        public static double getSolarAzimuth​(Calendar cal,
                                             double lat,
                                             double lon)
        Return the Solar Azimuth for the horizontal coordinate system at the given location at the given time. Not corrected for altitude. True south is 0 degrees.
        Parameters:
        cal - time of calculation
        lat - latitude of location for calculation
        lon - longitude of location for calculation
        Returns:
        FIXME
      • getSunriseUTC

        private static double getSunriseUTC​(double julianDay,
                                            double latitude,
                                            double longitude,
                                            double zenith)
        Return the Universal Coordinated Time (UTC) of sunrise for the given day at the given location on earth
        Parameters:
        julianDay - the Julian day
        latitude - the latitude of observer in degrees
        longitude - the longitude of observer in degrees
        zenith - the zenith
        Returns:
        the time in minutes from zero UTC
      • getSolarNoonUTC

        private static double getSolarNoonUTC​(double julianCenturies,
                                              double longitude)
        Return the Universal Coordinated Time (UTC) of solar noon for the given day at the given location on earth.
        Parameters:
        julianCenturies - the number of Julian centuries since J2000.0
        longitude - the longitude of observer in degrees
        Returns:
        the time in minutes from zero UTC
      • getSunsetUTC

        private static double getSunsetUTC​(double julianDay,
                                           double latitude,
                                           double longitude,
                                           double zenith)
        Return the Universal Coordinated Time (UTC) of sunset for the given day at the given location on earth
        Parameters:
        julianDay - the Julian day
        latitude - the latitude of observer in degrees
        longitude - longitude of observer in degrees
        zenith - zenith
        Returns:
        the time in minutes from zero Universal Coordinated Time (UTC)