diff --git a/api/noaa/assets/highlight.css b/api/noaa/assets/highlight.css index bc36a19..c7af87d 100644 --- a/api/noaa/assets/highlight.css +++ b/api/noaa/assets/highlight.css @@ -5,6 +5,18 @@ --dark-hl-1: #D4D4D4; --light-hl-2: #A31515; --dark-hl-2: #CE9178; + --light-hl-3: #AF00DB; + --dark-hl-3: #C586C0; + --light-hl-4: #001080; + --dark-hl-4: #9CDCFE; + --light-hl-5: #0000FF; + --dark-hl-5: #569CD6; + --light-hl-6: #0070C1; + --dark-hl-6: #4FC1FF; + --light-hl-7: #098658; + --dark-hl-7: #B5CEA8; + --light-hl-8: #008000; + --dark-hl-8: #6A9955; --light-code-background: #FFFFFF; --dark-code-background: #1E1E1E; } @@ -13,6 +25,12 @@ --hl-0: var(--light-hl-0); --hl-1: var(--light-hl-1); --hl-2: var(--light-hl-2); + --hl-3: var(--light-hl-3); + --hl-4: var(--light-hl-4); + --hl-5: var(--light-hl-5); + --hl-6: var(--light-hl-6); + --hl-7: var(--light-hl-7); + --hl-8: var(--light-hl-8); --code-background: var(--light-code-background); } } @@ -20,6 +38,12 @@ --hl-0: var(--dark-hl-0); --hl-1: var(--dark-hl-1); --hl-2: var(--dark-hl-2); + --hl-3: var(--dark-hl-3); + --hl-4: var(--dark-hl-4); + --hl-5: var(--dark-hl-5); + --hl-6: var(--dark-hl-6); + --hl-7: var(--dark-hl-7); + --hl-8: var(--dark-hl-8); --code-background: var(--dark-code-background); } } @@ -27,6 +51,12 @@ --hl-0: var(--light-hl-0); --hl-1: var(--light-hl-1); --hl-2: var(--light-hl-2); + --hl-3: var(--light-hl-3); + --hl-4: var(--light-hl-4); + --hl-5: var(--light-hl-5); + --hl-6: var(--light-hl-6); + --hl-7: var(--light-hl-7); + --hl-8: var(--light-hl-8); --code-background: var(--light-code-background); } @@ -34,10 +64,22 @@ --hl-0: var(--dark-hl-0); --hl-1: var(--dark-hl-1); --hl-2: var(--dark-hl-2); + --hl-3: var(--dark-hl-3); + --hl-4: var(--dark-hl-4); + --hl-5: var(--dark-hl-5); + --hl-6: var(--dark-hl-6); + --hl-7: var(--dark-hl-7); + --hl-8: var(--dark-hl-8); --code-background: var(--dark-code-background); } .hl-0 { color: var(--hl-0); } .hl-1 { color: var(--hl-1); } .hl-2 { color: var(--hl-2); } +.hl-3 { color: var(--hl-3); } +.hl-4 { color: var(--hl-4); } +.hl-5 { color: var(--hl-5); } +.hl-6 { color: var(--hl-6); } +.hl-7 { color: var(--hl-7); } +.hl-8 { color: var(--hl-8); } pre, code { background: var(--code-background); } diff --git a/api/noaa/classes/GeoLocation.html b/api/noaa/classes/GeoLocation.html index 54645b0..79b6c30 100644 --- a/api/noaa/classes/GeoLocation.html +++ b/api/noaa/classes/GeoLocation.html @@ -2,7 +2,7 @@ elevation field may not be used by some calculation engines and would be ignored if set.

© Eliyahu Hershfeld 2004 - 2016

1.1

-

Methods

  • Method to get the elevation in Meters.

    +

Returns GeoLocation

Methods

  • Method to get the elevation in Meters.

    Returns number

    Returns the elevation in Meters.

    -
  • Returns number

    Returns the latitude.

    -
  • Returns null | string

    Returns the location name.

    -
  • Returns number

    Returns the longitude.

    -
  • Returns string

    Returns the timeZone.

    -
  • Method to set the elevation in Meters above sea level.

    +
  • Returns number

    Returns the latitude.

    +
  • Returns null | string

    Returns the location name.

    +
  • Returns number

    Returns the longitude.

    +
  • Returns string

    Returns the timeZone.

    +
  • Method to set the elevation in Meters above sea level.

    Parameters

    • elevation: number

      The elevation to set in Meters. An Error will be thrown if the value is a negative.

      -

    Returns void

  • Parameters

    • latitude: number

    Returns void

  • Parameters

    • name: null | string

      The setter method for the display name.

      -

    Returns void

  • Parameters

    • longitude: number

    Returns void

  • Method to set the TimeZone.

    +

Returns void

  • Parameters

    • latitude: number

    Returns void

  • Parameters

    • name: null | string

      The setter method for the display name.

      +

    Returns void

  • Parameters

    • longitude: number

    Returns void

  • Method to set the TimeZone.

    Parameters

    • timeZoneId: string

      The timeZone to set.

      -

    Returns void

\ No newline at end of file +

Returns void

\ No newline at end of file diff --git a/api/noaa/classes/NOAACalculator.html b/api/noaa/classes/NOAACalculator.html index 4c42995..773597d 100644 --- a/api/noaa/classes/NOAACalculator.html +++ b/api/noaa/classes/NOAACalculator.html @@ -8,7 +8,7 @@ to account for elevation. The algorithm can be found in the Wikipedia Sunrise Equation article.

© Eliyahu Hershfeld 2011 - 2019

-

Constructors

Constructors

Properties

Constructors

Properties

ASTRONOMICAL_ZENITH: number = 108

Sun's zenith at astronomical twilight (108°).

-
CIVIL_ZENITH: number = 96

Sun's zenith at civil twilight (96°).

-
NAUTICAL_ZENITH: number = 102

Sun's zenith at nautical twilight (102°).

-

Methods

  • Adjusts the zenith of astronomical sunrise and sunset to account for solar refraction, solar radius and +

  • date: PlainDate

Returns NOAACalculator

Properties

ASTRONOMICAL_ZENITH: number = 108

Sun's zenith at astronomical twilight (108°).

+
CIVIL_ZENITH: number = 96

Sun's zenith at civil twilight (96°).

+
NAUTICAL_ZENITH: number = 102

Sun's zenith at nautical twilight (102°).

+

Methods

  • Adjusts the zenith of astronomical sunrise and sunset to account for solar refraction, solar radius and elevation. The value for Sun's zenith and true rise/set Zenith (used in this class and subclasses) is the angle that the center of the Sun makes to a line perpendicular to the Earth's surface. If the Sun were a point and the Earth were without an atmosphere, true sunset and sunrise would correspond to a 90° zenith. Because the Sun @@ -70,24 +70,24 @@ and elevation adjustment. This will only be adjusted for sunrise and sunset (if the zenith == 90°)

    getElevationAdjustment

    -
  • A method that returns the beginning of astronomical twilight using a zenith of * 108°.

    +
  • A method that returns the beginning of astronomical twilight using a zenith of * 108°.

    Returns null | ZonedDateTime

    The Date of the beginning of astronomical twilight using a zenith of 108°. If the calculation can't be computed, null will be returned. See detailed explanation on top of the page.

    ASTRONOMICAL_ZENITH

    -
  • A method that returns the beginning of civil twilight (dawn) using a zenith of 96°.

    +
  • A method that returns the beginning of civil twilight (dawn) using a zenith of 96°.

    Returns null | ZonedDateTime

    The Date of the beginning of civil twilight using a zenith of 96°. If the calculation can't be computed, null will be returned. See detailed explanation on top of the page.

    CIVIL_ZENITH

    -
  • A method that returns the beginning of nautical twilight using a zenith of 102°.

    +
  • A method that returns the beginning of nautical twilight using a zenith of 102°.

    Returns null | ZonedDateTime

    The Date of the beginning of nautical twilight using a zenith of 102°. If the calculation can't be computed null will be returned. See detailed explanation on top of the page.

    NAUTICAL_ZENITH

    -
  • Protected

    A method that returns a Date from the time passed in as a parameter.

    +
  • Protected

    A method that returns a Date from the time passed in as a parameter.

    Parameters

    • time: number

      The time to be set as the time for the Date. The time expected is in the format: 18.75 for 6:45:00 PM.

    • isSunrise: boolean

      true if the time is sunrise, and false if it is sunset

    Returns null | ZonedDateTime

    The Date.

    -
  • Method to return the adjustment to the zenith required to account for the elevation. Since a person at a higher +

  • Method to return the adjustment to the zenith required to account for the elevation. Since a person at a higher elevation can see farther below the horizon, the calculation for sunrise / sunset is calculated below the horizon used at sea level. This is only used for sunrise and sunset and not times before or after it such as () nautical twilight since those @@ -104,20 +104,20 @@ elevationAdjustment = 0.0347 * Math.sqrt(elevationMeters);

    Parameters

    • elevation: number

      elevation in Meters.

    Returns number

    the adjusted zenith

    -
  • A method that returns the end of astronomical twilight using a zenith of 108°.

    +
  • A method that returns the end of astronomical twilight using a zenith of 108°.

    Returns null | ZonedDateTime

    The Date of the end of astronomical twilight using a zenith of * 108°. If the calculation can't be computed, null will be returned. See detailed explanation on top of the page.

    ASTRONOMICAL_ZENITH

    -
  • A method that returns the end of civil twilight using a zenith of 96°.

    +
  • A method that returns the end of civil twilight using a zenith of 96°.

    Returns null | ZonedDateTime

    The Date of the end of civil twilight using a zenith of 96°. If the calculation can't be computed, null will be returned. See detailed explanation on top of the page.

    CIVIL_ZENITH

    -
  • A method that returns the end of nautical twilight using a zenith of 102°.

    +
  • A method that returns the end of nautical twilight using a zenith of 102°.

    Returns null | ZonedDateTime

    The Date of the end of nautical twilight using a zenith of 102° . If the calculation can't be computed, null will be returned. See detailed explanation on top of the page.

    NAUTICAL_ZENITH

    -
  • A method that returns the sunrise without elevation. Non-sunrise and sunset calculations such as dawn and dusk, depend on the amount of visible light, +

  • A method that returns the sunrise without elevation. Non-sunrise and sunset calculations such as dawn and dusk, depend on the amount of visible light, something that is not affected by elevation. This method returns sunrise calculated at sea level. This forms the base for dawn calculations that are calculated as a dip below the horizon before sunrise.

    Returns null | ZonedDateTime

    the Date representing the exact sea-level sunrise time. If the calculation can't be computed @@ -128,7 +128,7 @@

  • getUTCSeaLevelSunrise
  • getSeaLevelSunset()
-
  • A method that returns the sunset without elevation. Non-sunrise and sunset calculations such as dawn and dusk, depend on the amount of visible light, +

  • A method that returns the sunset without elevation. Non-sunrise and sunset calculations such as dawn and dusk, depend on the amount of visible light, something that is not affected by elevation. This method returns sunset calculated at sea level. This forms the base for dusk calculations that are calculated as a dip below the horizon after sunset.

    Returns null | ZonedDateTime

    The Date representing the exact sea-level sunset time. If the calculation can't be computed @@ -138,7 +138,7 @@

  • getSunset
  • getUTCSeaLevelSunset
-
  • A method that returns sundial or solar noon. It occurs when the Sun is

  • A method that returns sundial or solar noon. It occurs when the Sun is transiting the celestial meridian. In this class it is calculated as halfway between the sunrise and sunset passed to this method. This time can be slightly off the @@ -150,7 +150,7 @@

Returns null | ZonedDateTime

The Date representing Sun's transit. If the calculation can't be computed such as in the Arctic Circle where there is at least one day a year where the sun does not rise, and one where it does not set, null will be returned. See detailed explanation on top of the page.

-
  • The getSunrise method Returns a Date representing the +

  • The getSunrise method Returns a Date representing the elevation adjusted sunrise time. The zenith used for the calculation uses GEOMETRIC_ZENITH geometric zenith of 90° plus getElevationAdjustment. This is adjusted @@ -164,7 +164,7 @@

  • getSeaLevelSunrise()
  • getUTCSunrise
-
  • A utility method that returns the time of an offset by degrees below or above the horizon of +

  • A utility method that returns the time of an offset by degrees below or above the horizon of () sunrise. Note that the degree offset is from the vertical, so for a calculation of 14° before sunrise, an offset of 14 + GEOMETRIC_ZENITH = 104 would have to be passed as a parameter.

    Parameters

    • offsetZenith: number

      the degrees before getSunrise to use in the calculation. For time after sunrise use @@ -175,7 +175,7 @@ can't be computed such as in the Arctic Circle where there is at least one day a year where the sun does not rise, and one where it does not set, a null will be returned. See detailed explanation on top of the page.

      -
  • The getSunset method Returns a Date representing the +

  • The getSunset method Returns a Date representing the elevation adjusted sunset time. The zenith used for the calculation uses GEOMETRIC_ZENITH geometric zenith of 90° plus getElevationAdjustment. This is adjusted @@ -193,7 +193,7 @@

  • getSeaLevelSunset()
  • getUTCSunset
-
  • A utility method that returns the time of an offset by degrees below or above the horizon of (). Note that the degree offset is from the vertical, so for a calculation of 14° after sunset, an +

  • A utility method that returns the time of an offset by degrees below or above the horizon of (). Note that the degree offset is from the vertical, so for a calculation of 14° after sunset, an offset of 14 + GEOMETRIC_ZENITH = 104 would have to be passed as a parameter.

    Parameters

    • offsetZenith: number

      the degrees after getSunset to use in the calculation. For time before sunset use negative numbers. Note that the degree offset is from the vertical, so for a calculation of 14° after @@ -202,7 +202,7 @@ be computed such as in the Arctic Circle where there is at least one day a year where the sun does not rise, and one where it does not set, a null will be returned. See detailed explanation on top of the page.

      -
  • A utility method that will allow the calculation of a temporal (solar) hour based on the sunrise and sunset +

  • A utility method that will allow the calculation of a temporal (solar) hour based on the sunrise and sunset passed as parameters to this method. An example of the use of this method would be the calculation of a non-elevation adjusted temporal hour by passing in () sea level sunrise and () sea level sunset as parameters.

    @@ -211,7 +211,7 @@

Returns number

the long millisecond length of the temporal hour. If the calculation can't be computed a NaN will be returned. See detailed explanation on top of the page.

getTemporalHour()

-
  • A method that returns the sunrise in UTC time without correction for time zone offset from GMT and without using +

  • A method that returns the sunrise in UTC time without correction for time zone offset from GMT and without using daylight savings time. Non-sunrise and sunset calculations such as dawn and dusk, depend on the amount of visible light, something that is not affected by elevation. This method returns UTC sunrise calculated at sea level. This forms the base for dawn calculations that are calculated as a dip below the horizon before sunrise.

    @@ -223,7 +223,7 @@
  • getUTCSunrise
  • getUTCSeaLevelSunset
-
  • A method that returns the sunset in UTC time without correction for elevation, time zone offset from GMT and +

  • A method that returns the sunset in UTC time without correction for elevation, time zone offset from GMT and without using daylight savings time. Non-sunrise and sunset calculations such as dawn and dusk, depend on the amount of visible light, something that is not affected by elevation. This method returns UTC sunset calculated at sea level. This forms the base for dusk calculations that are calculated as a dip below the horizon after @@ -236,7 +236,7 @@

  • getUTCSunset
  • getUTCSeaLevelSunrise
-
  • A method that calculates UTC sunrise as well as any time based on an angle above or below sunrise.

    +
  • A method that calculates UTC sunrise as well as any time based on an angle above or below sunrise.

    Parameters

    • date: PlainDate

      Used to calculate day of year.

    • geoLocation: GeoLocation

      The location information used for astronomical calculating sun times.

    • zenith: number

      the azimuth below the vertical zenith of 90 degrees. for sunrise typically the * zenith used for the calculation uses geometric zenith of 90° and adjusts @@ -247,13 +247,13 @@

    Returns number

    The UTC time of sunrise in 24 hour format. 5:45:00 AM will return 5.75.0. If an error was encountered in the calculation (expected behavior for some locations such as near the poles, NaN will be returned.

    -
  • A method that returns the sunrise in UTC time without correction for time zone offset from GMT and without using +

  • A method that returns the sunrise in UTC time without correction for time zone offset from GMT and without using daylight savings time.

    Parameters

    • zenith: number

      the degrees below the horizon. For time after sunrise use negative numbers.

    Returns number

    The time in the format: 18.75 for 18:45:00 UTC/GMT. If the calculation can't be computed such as in the Arctic Circle where there is at least one day a year where the sun does not rise, and one where it does not set, NaN will be returned. See detailed explanation on top of the page.

    -
  • A method that calculates UTC sunset as well as any time based on an angle above or below sunset.

    +
  • A method that calculates UTC sunset as well as any time based on an angle above or below sunset.

    Parameters

    • date: PlainDate

      Used to calculate day of year.

    • geoLocation: GeoLocation

      The location information used for astronomical calculating sun times.

    • zenith: number

      the azimuth below the vertical zenith of 90°. For sunset typically the * zenith used for the calculation uses geometric zenith of 90° and adjusts @@ -264,31 +264,31 @@

    Returns number

    The UTC time of sunset in 24 hour format. 5:45:00 AM will return 5.75.0. If an error was encountered in the calculation (expected behavior for some locations such as near the poles, NaN will be returned.

    -
  • A method that returns the sunset in UTC time without correction for time zone offset from GMT and without using +

  • A method that returns the sunset in UTC time without correction for time zone offset from GMT and without using daylight savings time.

    Parameters

    • zenith: number

      the degrees below the horizon. For time after sunset use negative numbers.

    Returns number

    The time in the format: 18.75 for 18:45:00 UTC/GMT. If the calculation can't be computed such as in the Arctic Circle where there is at least one day a year where the sun does not rise, and one where it does not set, NaN will be returned. See detailed explanation on top of the page.

    getUTCSeaLevelSunset

    -
  • 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

    • date: ZonedDateTime

      time of calculation

    • latitude: number

      latitude of location for calculation

    • lon: number

      longitude of location for calculation

      -

    Returns number

  • Return the Solar Elevation for the +

Returns number

  • 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

    • date: ZonedDateTime

      time of calculation

    • lat: number

      latitude of location for calculation

    • lon: number

      longitude of location for calculation

    Returns number

    solar elevation in degrees - horizon is 0 degrees, civil twilight is -6 degrees

    -
  • A utility method that returns a date offset by the offset time passed in. Please note that the level of light +

  • A utility method that returns a date offset by the offset time passed in. Please note that the level of light during twilight is not affected by elevation, so if this is being used to calculate an offset before sunrise or after sunset with the intent of getting a rough "level of light" calculation, the sunrise or sunset time passed to this method should be sea level sunrise and sunset.

    Parameters

    • time: null | ZonedDateTime

      the start time

    • offset: number

      the offset in milliseconds to add to the time.

    Returns null | ZonedDateTime

    the Date with the offset in milliseconds added to it

    -
\ No newline at end of file +
\ No newline at end of file diff --git a/api/noaa/index.html b/api/noaa/index.html index bef9dcc..2c8326a 100644 --- a/api/noaa/index.html +++ b/api/noaa/index.html @@ -4,4 +4,7 @@
$ npm install @hebcal/noaa
 
-
\ No newline at end of file +
import {GeoLocation, NOAACalculator} from '@hebcal/noaa';
import {Temporal} from 'temporal-polyfill';

const latitude = 39.73915;
const longitude = -104.9847;
const elevtion = 1636;
const tzid = 'America/Denver';
const gloc = new GeoLocation(null, latitude, longitude, elevtion, tzid);
const plainDate = new Temporal.PlainDate(2020, 6, 5); // Friday June 5 2020
const noaa = new NOAACalculator(gloc, plainDate);

const zdt = noaa.getSunset();
console.log(zdt.toString()); // '2020-06-05T20:32:57.848-06:00[America/Denver]' +
+ +
\ No newline at end of file