Skip to content
Frank Thomas Tveter edited this page Aug 8, 2019 · 5 revisions

cgi-bin/small.pl returns a smaller version of the XML-output from cgi-bin/short.pl.

USAGE cgi-bin/small.pl:

Parameters

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)

Example URLs

New York (test), Blindern-Oslo without DST (test), polar midsummer in Novaya Zemlya, start of polar night in Hopen-Svalbard (test).

Output format

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, azimuth, visible)

  • solarmidnight (time, elevation, azimuth, visible)

  • 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, azimuth, illumination)

  • moonset (time, azimuth, illumination)

  • high_moon (time, elevation, azimuth, visible, illumination)

  • low_moon (time, elevation, azimuth, visible, illumination)

  • polardayend (time)

  • polardaystart (time)

  • polarnightend (time)

  • polarnightstart (time)

Example

Oslo: https://api.met.no/weatherapi/sunrise/2.0?lat=59.933333&lon=10.716667&date=2018-05-11&offset=+01:00 (test).

  <astrodata xsi:noNamespaceSchemaLocation="http://schema.api.met.no/schemas/astrodata-2.0.xsd">
     <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.993"/>
           <moonshadow time="2018-05-11T00:00:00+01:00" elevation="-32.253" azimuth="271.265"/>
           <moonposition time="2018-05-11T00:00:00+01:00" elevation="-25.267" azimuth="56.467" range="392860.1" phase="84.0"/>
           <solarmidnight time="2018-05-11T00:13:10+01:00" elevation="-12.268" azimuth="359.918" visible="false"/>
           <moonrise time="2018-05-11T03:26:15+01:00" azimuth="101.139" illumination="22.1"/>
           <sunrise time="2018-05-11T03:50:00+01:00" azimuth="50.479"/>
           <high_moon time="2018-05-11T09:02:58+01:00" elevation="24.775" azimuth="181.448" illumination="20.4" visible="true"/>
           <solarnoon time="2018-05-11T12:13:43+01:00" elevation="47.993" azimuth="180.081" visible="true"/><moonset time="2018-05-11T14:43:59+01:00" azimuth="263.051" illumination="18.8"/>
           <sunset time="2018-05-11T20:38:41+01:00" azimuth="309.961"/>
           <low_moon time="2018-05-11T21:15:28+01:00" elevation="-32.989" azimuth="358.503" illumination="16.3" visible="false"/>
        </time>
        <time date="2018-05-12">
           <moonposition time="2018-05-12T00:00:00+01:00" elevation="-25.431" azimuth="43.264" range="387470.3" phase="87.3"/>
        </time>
     </location>
  </astrodata>