-
Notifications
You must be signed in to change notification settings - Fork 11
short
cgi-bin/short.pl
supports the legacy calls to api.met.no/sunrise
and should be replaced by cgi-bin/event
.
The following parameters are supported:
- lat (latitude), in decimal degrees, mandatory
- lon (longtitude), in decimal degrees, mandatory
- height altitude above ellipsoide, in km (default 0)
- date given as YYYY-MM-DD, mandatory
- offset timezone offset, on the format +HH:MM or -HH:MM mandatory
- days number of days forward to include (default 1, max 15)
New York, Blindern-Oslo without DST, polar midsummer in Novaya Zemlya, start of polar night in Hopen-Svalbard.
See also https://github.com/FrankThomasTveter/astro-api/wiki/event for more info on returned values Output format
In contrast to previous versions, the new XML format only contains event that actually are occuring. This means that sunrise/sunset may not occur in polar regions, and there may be 0, 1 or 2 moonrise/moonsets.
The data are sorted per location and time. For each date, 0..n of the following elements may be included (attributes given in parens), sorted chronologically:
-
sunrise (time)
-
sunset (time)
-
solarnoon (time, elevation)
-
solarmidnight (time, elevation)
-
moonphase (time, value), value representing:
0..25: "waxing crescent" 25..50: "waxing gibbous" 50..75: "waning gibbous" 75..100: "waning crescent"
-
moonshadow (time, elevation, azimuth)
-
moonposition (time, elevation, azimuth, range)
-
moonrise (time)
-
moonset (time)
-
high_moon (time, elevation)
-
low_moon (time, elevation)
-
polardayend (time)
-
polardaystart (time)
-
polarnightend (time)
-
polarnightstart (time)
A desc attribute may also be present to explain the correct scientific term for the event. This should not be used for computational purposes as it may change without warning. Example
Oslo: https://api.met.no/weatherapi/sunrise/2.0?lat=59.933333&lon=10.716667&date=2018-05-11&offset=+01:00
<astrodata>
<meta licenseurl="https://api.met.no/license_data.html"/>
<location latitude="59.933333" longitude="10.716667" height="0">
<time date="2018-05-11">
<moonphase time="2018-05-11T00:00:00+01:00" value="83.993572055"
desc="LOCAL MOON STATE * MOON PHASE= 84.0 (waning crescent)"/>
<moonshadow time="2018-05-11T00:00:00+01:00" elevation="-32.253039217" azimuth="271.265661838"
desc="LOCAL MOON STATE * SHADOW ANGLES (azi=271.3,ele=-32.3)"/>
<moonposition time="2018-05-11T00:00:00+01:00" elevation="-25.267017305" azimuth="56.467253658" range="392860.059469108"
desc="LOCAL MOON POSITION Elv: -25.267 deg, Azi: 56.467, Rng: 392860.1 km"/>
<solarmidnight time="2018-05-11T00:13:10+01:00" elevation="-12.268744841"
desc="LOCAL DIURNAL MINIMUM SOLAR ELEVATION (Min= -12.26874)"/>
<moonrise time="2018-05-11T03:26:15+01:00"
desc="LOCAL DIURNAL MOON RISE"/>
<sunrise time="2018-05-11T03:49:59+01:00"
desc="LOCAL DIURNAL SUN RISE"/>
<high_moon time="2018-05-11T09:02:58+01:00" elevation="25.034235521"
desc="LOCAL DIURNAL MAXIMUM MOON ELEVATION (Max= 25.03424)"/>
<solarnoon time="2018-05-11T12:13:43+01:00" elevation="47.993878848"
desc="LOCAL DIURNAL MAXIMUM SOLAR ELEVATION (Max= 47.99388)"/>
<moonset time="2018-05-11T14:43:59+01:00"
desc="LOCAL DIURNAL MOON SET"/>
<sunset time="2018-05-11T20:38:41+01:00"
desc="LOCAL DIURNAL SUN SET"/>
<low_moon time="2018-05-11T21:15:27+01:00" elevation="-32.732948918"
desc="LOCAL DIURNAL MINIMUM MOON ELEVATION (Min= -32.73295)"/>
</time>
</location>
</astrodata>