Skip to content

Weather data

Henriette Steenhoff edited this page Jun 19, 2018 · 7 revisions

Open weather data provides data on both current weather and forecasts based on location. This data is needed for calculations regarding solar irradiation and Wet Bulb Globe Temperature (WBGT).

This information can be fetched from Open Weather Map through their API providing only the user's location like the following example:

http://api.openweathermap.org/data/2.5/weather?lat=<userLatitude>&lon=<userLongitude>s&appid=<developerAppID>

The data received in response is formatted as a JSON object from which it is possible to extract the needed information as described in the documentation section below, where it is also possible to see examples of the received data type.

The different parameters needed, and fetched from OWM, is listed below and will be discussed in more detail separately:

  • Solar Irradiation

    • fog
    • rain
    • cloud fraction
  • WBGT calculations (based on results from solar irradiation calculations)

    • pressure
    • humidity
    • wind speed

Solar irradiation

Rain

When calculating solar irradiation it is needed to know whether it is raining. The documentation on weather conditions provides a full overview of the different weather conditions available specifying whether it is raining. These can all be inferred using the weather ID, weather.id.

At the moment, the following weather ID's have been chosen as indicators of rain:

  • 200, 201, 202, 230, 231, 232
  • 3xx
  • 5xx
  • 615, 616

For the full overview, follow the link to the documentation of all Open Weather Map weather conditions below.

Fog

Using the same weater.id as above, one can infer whether it is foggy. At the moment, the following weather ID's have been chosen as indicators of fog:

  • 701 (mist), 714 (fog)

Cloud fraction

The amount of clouds is given as a percentage and given as a part of the received JSON object under the tag clouds.all.

On a clear day, the cloudiness would be 0 whereas a fully cloud-covered sky is 100.

Cloud type (not implemented yet)

An indicator for the type of cloud, which gives an idea of which atmospheric layer the clouds are a a part of.

WBGT

Wind speed

Tag: wind.speed

Wind speed given in SI-unit m/s

Pressure

Tag: main.pressure

The atmospheric pressure given in SI-units ATM.

Humidity

Tag: main.humidity

Relative humidity as a percentage.

Documentation

Links to online documentation from Open Weather Map and description of the data fetched from the OWM API.

Webpage title and link Description Comment
API doc - current weather Current weather information at user's location
API doc - 3 hour forecast Full 5-day forecast every 3 hour at users location
Doc - weather conditions All weather conditions provided by Open Weather Map

Examples

Current weather

Sample output on current weather

5-day 3 hour forecast

Sample output on 5 day forecast

How does it look?

In the app, the data is currently visualized as below:

Above the location, description of weather, humidity, wind speed, cloudiness and a visualization of the weather is shown. All of this information, including the image, is extracted from Open Weather Map's JSON response object from using their API.

Where in the code?

Clone this wiki locally