Sun

Sunrise and sunset as SQL date, datenum, or unix time stamp. The datenum format is compatible with the Matlab and Python (matplotlib) time stamps.

Below is an overview of all parameters related to the sun:

Sunrise | Sunset | Sunshine Duration | Relative Sunshine Duration | UV Index | Solar Azimuth Angle | Solar Elevation Angle | Day & Night

Each parameter is explained in more detail below.

Sunrise

This parameter returns the date and time of sunrise at a given location. Remember that all times are given in UTC.

sunrise:sql

Note: Some special cases may occur, which give rise to the following outputs (no date/time outputs):

-777: The sun is not visible

-888: The sun is always visible

Examples

  • refer to the next section Sunset

Sunset

This parameter returns the date and time of sunset at a given location. Remember that all times are given in UTC.

sunset:sql

Note: Some special cases may occur, which give rise to the following outputs (no date/time outputs):

-777: The sun is not visible

-888: The sun is always visible

Examples

  • Shows the sunrise and sunset time over a period of one week.

    https://api.meteomatics.com/__replace__0T00:00:00+02:00P7D:P1D/sunrise:sql,sunset:sql/47.423336,9.377225/csv

    validdate;sunrise:sql;sunset:sql
    2020-04-15T22:00:00Z;2020-04-15T04:33:00Z;2020-04-15T18:10:00Z
    2020-04-16T22:00:00Z;2020-04-16T04:31:00Z;2020-04-16T18:12:00Z
    2020-04-17T22:00:00Z;2020-04-17T04:29:00Z;2020-04-17T18:13:00Z
    2020-04-18T22:00:00Z;2020-04-18T04:27:00Z;2020-04-18T18:14:00Z
    2020-04-19T22:00:00Z;2020-04-19T04:25:00Z;2020-04-19T18:16:00Z
    2020-04-20T22:00:00Z;2020-04-20T04:24:00Z;2020-04-20T18:17:00Z
    2020-04-21T22:00:00Z;2020-04-21T04:22:00Z;2020-04-21T18:19:00Z
    2020-04-22T22:00:00Z;2020-04-22T04:20:00Z;2020-04-22T18:20:00Z

Accumulated Sunshine duration

Gives the amount of time the sun was shining within the requested interval.

sunshine_duration_<interval>:<unit>

Available intervals: 1h, 3h, 6h, 12h, 24h

Available Units: h, min

Examples

Relative sunshine duration

The duration of sunshine divided by the amount of time the sun was above the horizon at the queried coordinate and time.

sunshine_duration_24h:p

Examples:

UV Index

The UV Index is computed based on model outputs, most current satellite images and 90m-resolution topography. Instantaneous values as well as maxima within certain time periods can be queried.

uv:idx
uv_max_<interval>:idx

Available intervals: 1h, 2h, 3h, 6h, 12h, 24h

Examples:

Solar Azimuth Angle

The solar azimuth angle defines the Sun's relative direction along the local horizon.

sun_azimuth:d

Examples:

Solar Elevation Angle

The solar elevation angle gives the altitude of the sun above the horizon.

sun_elevation:d

Examples:

Day & Night

These two parameters tell you whether the sun is below or above the horizon.

0: sun below the horizon, 1: sun above the horizon

is_day:idx

0: sun above the horizon, 1: sun below the horizon

is_night:idx

Examples: