2. Weather Service IPM Interface

[2]:
from agroservices.ipm.ipm import IPM
from agroservices.ipm.datadir import datadir
ipm = IPM()

2.1. MetaDataServices

  • Get IPM Platform weather parameters and their description (id, name, description and units)

[3]:
ipm.get_parameter()
[3]:
[{'id': 1001,
  'name': 'Instantaneous temperature at 2m',
  'description': None,
  'unit': 'Celcius',
  'aggregationType': 'AVG'},
 {'id': 1002,
  'name': 'Mean air temperature at 2m',
  'description': None,
  'unit': 'Celcius',
  'aggregationType': 'AVG'},
 {'id': 1003,
  'name': 'Minimum air temperature at 2m',
  'description': None,
  'unit': 'Celcius',
  'aggregationType': 'MIN'},
 {'id': 1004,
  'name': 'Maximum air temperature at 2m',
  'description': None,
  'unit': 'Celcius',
  'aggregationType': 'MAX'},
 {'id': 1021,
  'name': 'Instantaneous temperature in canopy',
  'description': None,
  'unit': 'Celcius',
  'aggregationType': 'AVG'},
 {'id': 1022,
  'name': 'Mean air temperature in canopy',
  'description': None,
  'unit': 'Celcius',
  'aggregationType': 'AVG'},
 {'id': 1023,
  'name': 'Minimum air temperature in canopy',
  'description': None,
  'unit': 'Celcius',
  'aggregationType': 'MIN'},
 {'id': 1024,
  'name': 'Maximum air temperature in canopy',
  'description': None,
  'unit': 'Celcius',
  'aggregationType': 'MAX'},
 {'id': 1101,
  'name': 'Instantaneous temperature at -5cm (Celcius)',
  'description': None,
  'unit': 'Celcius',
  'aggregationType': 'AVG'},
 {'id': 1102,
  'name': 'Mean temperature at -5cm',
  'description': None,
  'unit': 'Celcius',
  'aggregationType': 'AVG'},
 {'id': 1111,
  'name': 'Instantaneous temperature at -10cm (Celcius)',
  'description': None,
  'unit': 'Celcius',
  'aggregationType': 'AVG'},
 {'id': 1112,
  'name': 'Mean temperature at -10cm',
  'description': None,
  'unit': 'Celcius',
  'aggregationType': 'AVG'},
 {'id': 1121,
  'name': 'Instantaneous temperature at -20cm (Celcius)',
  'description': None,
  'unit': 'Celcius',
  'aggregationType': 'AVG'},
 {'id': 1122,
  'name': 'Mean temperature at -20cm',
  'description': None,
  'unit': 'Celcius',
  'aggregationType': 'AVG'},
 {'id': 1131,
  'name': 'Instantaneous temperature at -30cm (Celcius)',
  'description': None,
  'unit': 'Celcius',
  'aggregationType': 'AVG'},
 {'id': 1132,
  'name': 'Mean temperature at -30cm',
  'description': None,
  'unit': 'Celcius',
  'aggregationType': 'AVG'},
 {'id': 1141,
  'name': 'Instantaneous temperature at -40cm (Celcius)',
  'description': None,
  'unit': 'Celcius',
  'aggregationType': 'AVG'},
 {'id': 1142,
  'name': 'Mean temperature at -40cm',
  'description': None,
  'unit': 'Celcius',
  'aggregationType': 'AVG'},
 {'id': 1151,
  'name': 'Instantaneous temperature at -50cm (Celcius)',
  'description': None,
  'unit': 'Celcius',
  'aggregationType': 'AVG'},
 {'id': 1152,
  'name': 'Mean temperature at -50cm',
  'description': None,
  'unit': 'Celcius',
  'aggregationType': 'AVG'},
 {'id': 1901,
  'name': 'Dew point temperature',
  'description': None,
  'unit': 'Celcius',
  'aggregationType': 'AVG'},
 {'id': 2001,
  'name': 'Precipitation',
  'description': None,
  'unit': 'mm',
  'aggregationType': 'SUM'},
 {'id': 3001,
  'name': 'Instantaneous RH at 2m (%)',
  'description': None,
  'unit': '%',
  'aggregationType': 'AVG'},
 {'id': 3002,
  'name': 'Mean RH at 2m',
  'description': None,
  'unit': '%',
  'aggregationType': 'AVG'},
 {'id': 3003,
  'name': 'Minimum RH at 2m',
  'description': None,
  'unit': '%',
  'aggregationType': 'MIN'},
 {'id': 3004,
  'name': 'Maximum RH at 2m',
  'description': None,
  'unit': '%',
  'aggregationType': 'MAX'},
 {'id': 3021,
  'name': 'Instantaneous RH in canopy',
  'description': None,
  'unit': '%',
  'aggregationType': 'AVG'},
 {'id': 3022,
  'name': 'Mean RH in canopy',
  'description': None,
  'unit': '%',
  'aggregationType': 'AVG'},
 {'id': 3023,
  'name': 'Minimum RH in canopy',
  'description': None,
  'unit': '%',
  'aggregationType': 'MIN'},
 {'id': 3024,
  'name': 'Maximum RH in canopy',
  'description': None,
  'unit': '%',
  'aggregationType': 'MAX'},
 {'id': 3101,
  'name': 'Leaf wetness in 2m (minutes/hour)',
  'description': None,
  'unit': 'minutes/hour',
  'aggregationType': 'SUM'},
 {'id': 3102,
  'name': 'Leaf wetness in canopy',
  'description': None,
  'unit': 'minutes/hour',
  'aggregationType': 'SUM'},
 {'id': 3103,
  'name': 'Leaf wetness in grass',
  'description': None,
  'unit': 'minutes/hour',
  'aggregationType': 'SUM'},
 {'id': 4001,
  'name': 'Wind direction at 2m (degrees 0-360)',
  'description': None,
  'unit': 'degrees',
  'aggregationType': 'AVG'},
 {'id': 4002,
  'name': 'Instantaneous wind speed at 2m',
  'description': None,
  'unit': 'm/s',
  'aggregationType': 'AVG'},
 {'id': 4003,
  'name': 'Mean wind speed at 2m',
  'description': None,
  'unit': 'm/s',
  'aggregationType': 'AVG'},
 {'id': 4004,
  'name': 'Max wind speed at 2m',
  'description': None,
  'unit': 'm/s',
  'aggregationType': 'MAX'},
 {'id': 4005,
  'name': 'Min wind speed at 2m',
  'description': None,
  'unit': 'm/s',
  'aggregationType': 'MIN'},
 {'id': 4011,
  'name': 'Wind direction at 10m (degrees 0-360)',
  'description': None,
  'unit': 'degrees',
  'aggregationType': 'AVG'},
 {'id': 4012,
  'name': 'Instantaneous wind speed at 10m',
  'description': None,
  'unit': 'm/s',
  'aggregationType': 'AVG'},
 {'id': 4013,
  'name': 'Mean wind speed at 10m',
  'description': None,
  'unit': 'm/s',
  'aggregationType': 'AVG'},
 {'id': 4014,
  'name': 'Max wind speed at 10m',
  'description': None,
  'unit': 'm/s',
  'aggregationType': 'MAX'},
 {'id': 4015,
  'name': 'Min wind speed at 10m',
  'description': None,
  'unit': 'm/s',
  'aggregationType': 'MIN'},
 {'id': 5001,
  'name': 'Solar radiation (Q0) (W/sqm)',
  'description': None,
  'unit': 'W/sqm',
  'aggregationType': 'SUM'}]
  • Get the controle quality informations (id, name and description)

[3]:
ipm.get_qc()
[3]:
[{'id': 0,
  'name': 'No quality control performed',
  'description': 'There has been no quality control of the parameter'},
 {'id': 1,
  'name': 'OK. Parameter comes from a qualified external source',
  'description': 'The external source has its own quality controls, so we can trust it'},
 {'id': 2,
  'name': 'OK. Quality control performed by IPM Decisions',
  'description': "The parameter has been QC'd by the IPM Decisions platform and found to be OK"},
 {'id': 4,
  'name': 'Failed. Not an actual number',
  'description': 'The value is not a valid number'},
 {'id': 8, 'name': 'Failed. Interval test', 'description': 'TODO'},
 {'id': 16, 'name': 'Failed. Logical test', 'description': 'TODO'},
 {'id': 32, 'name': 'Failed. Step test', 'description': 'TODO'},
 {'id': 64, 'name': 'Failed. Freeze test', 'description': 'TODO'},
 {'id': 128,
  'name': 'Failed. Missing value(s)',
  'description': 'Either empty or NULL values have been detected'}]
  • Get a schema that describes the IPM Decision platform’s format for exchange of weather data

[4]:
ipm.get_schema_weatherdata()
[4]:
{'$schema': 'http://json-schema.org/draft-04/schema#',
 'title': 'Weather Data',
 'type': 'object',
 'additionalProperties': False,
 'description': 'Version 0.1. The schema describes the weather data format for the IPM Decisions platform. See an example here: https://platform.ipmdecisions.net/api/wx/rest/weatheradapter/yr/?longitude=14.3711&latitude=67.2828&altitude=70',
 '$id': 'https://platform.ipmdecisions.net/api/wx/rest/schema/weatherdata',
 'properties': {'timeStart': {'type': 'string',
   'format': 'date-time',
   'description': 'The timestamp of the first weather observation. Format: "yyyy-MM-dd\'T\'HH:mm:ssXXX", e.g. 2020-04-09T18:00:00+02:00',
   'title': "Time start (yyyy-MM-dd'T'HH:mm:ssXXX)"},
  'timeEnd': {'type': 'string',
   'format': 'date-time',
   'description': 'The timestamp of the last weather observation. Format: "yyyy-MM-dd\'T\'HH:mm:ssXXX", e.g. 2020-04-09T18:00:00+02:00',
   'title': "Time end (yyyy-MM-dd'T'HH:mm:ssXXX)"},
  'interval': {'type': 'integer',
   'description': 'The sampling frequency in seconds. E.g. 3600 = hourly values',
   'title': 'Sampling frequency (seconds)'},
  'weatherParameters': {'type': 'array',
   'minItems': 1,
   'maxItems': 2147483647,
   'items': {'type': 'integer'},
   'description': 'The weather parameters. For reference, see https://platform.ipmdecisions.net/api/wx/rest/parameter',
   'title': 'Weather parameters'},
  'locationWeatherData': {'oneOf': [{'type': 'null', 'title': 'Not included'},
    {'type': 'array', 'items': {'$ref': '#/definitions/LocationWeatherData'}}],
   'description': 'The weather data per location.',
   'title': 'Weather data'}},
 'required': ['timeStart', 'timeEnd', 'interval', 'weatherParameters'],
 'definitions': {'LocationWeatherData': {'type': 'object',
   'additionalProperties': False,
   'properties': {'longitude': {'type': 'number',
     'description': 'The longitude of the location. Decimal degrees (WGS84)',
     'title': 'Longitude (WGS84)'},
    'latitude': {'type': 'number',
     'description': 'The latitude of the location. Decimal degrees (WGS84)',
     'title': 'Latitude (WGS84)'},
    'altitude': {'oneOf': [{'type': 'null', 'title': 'Not included'},
      {'type': 'number'}],
     'description': 'The altitude of the location. Measured in meters',
     'title': 'Altitude (Meters)'},
    'qc': {'oneOf': [{'type': 'null', 'title': 'Not included'},
      {'type': 'array', 'items': {'type': 'integer'}}]},
    'amalgamation': {'oneOf': [{'type': 'null', 'title': 'Not included'},
      {'type': 'array', 'items': {'type': 'integer'}}]},
    'data': {'oneOf': [{'type': 'null', 'title': 'Not included.'},
      {'type': 'array',
       'items': {'type': 'array',
        'items': {'anyOf': [{'type': 'number'}, {'type': 'null'}]}}}],
     'description': 'The data. In rows, ordered chronologically. Columns ordered as given in weatherParameters.',
     'title': 'Weather data per location'},
    'length': {'oneOf': [{'type': 'null', 'title': 'Not included'},
      {'type': 'integer'}]},
    'width': {'oneOf': [{'type': 'null', 'title': 'Not included'},
      {'type': 'integer'}]}},
   'required': ['longitude', 'latitude']}}}
  • Validates the posted weather data against the Json schema

[5]:
ipm.post_schema_weatherdata_validate(jsonfile=datadir + 'weather_data.json')
[5]:
{'isValid': True}

2.2. Weather Adapter Services

  • Get a list of WeatherAdapterService available on ipm plateform

[6]:
ws = ipm.get_weatherdatasource()
{k:v['description'] for k,v in ws.items()}
[6]:
{'no.met.locationforecast': '9-day forecasts for the entire planet. 2.5 km resolution in the Nordic-Baltic region, 9km elsewhere',
 'ie.gov.data': '9-day forecasts for Ireland.',
 'dk.dmi.pointweather': 'Seasonal weather data and forecasts for Denmark. Grid based',
 'se.slu.lantmet': 'Seasonal weather data and forecasts for Sweden. Grid based',
 'net.ipmdecisions.dwd.forecast.germany': "27 hour weather forecasts for Germany and surrounding areas. 2.5 km resolution. Pulls data from DWD's Open Data server (https://www.dwd.de/EN/ourservices/opendata/opendata.html). Made available by a custom adapter created by Met Norway and NIBIO.",
 'net.ipmdecisions.dwd.forecast.europe': "30 hour weather forecasts for EU. 7 km resolution. Pulls data from DWD's Open Data server (https://www.dwd.de/EN/ourservices/opendata/opendata.html). Made available by a custom adapter created by Met Norway and NIBIO.",
 'net.ipmdecisions.dwd.euroweather': "Seasonal data and 72 hour weather forecasts for EU. 7 km resolution. Pulls data from DWD's Open Data server (https://www.dwd.de/EN/ourservices/opendata/opendata.html). Made available by a custom adapter created by Met Norway and NIBIO.",
 'net.ipmdecisions.meteofrance.forecast': "40 hour weather forecasts for France and surroundings. 2.5 km resolution. Pulls data from MeteoFrance's Public Data service (https://donneespubliques.meteofrance.fr). Made available by a custom adapter created by Met Norway and NIBIO.",
 'fi.fmi.forecast.location': '36 hour forecasts for Finland from the Finnish Meteorological Institute',
 'fi.fmi.observation.station': 'Weather station network covering Finland. Data availability varies between the stations. The oldest station is from 1844',
 'no.nibio.lmt': 'Weather station network covering major agricultural areas of Norway. Data before 2010 are available by request. Email lmt@nibio.no',
 'com.meteobot': "Network of privately owned weather stations. Access requires permission from each weather station's owner",
 'info.fruitweb': "Network of privately owned weather stations of several types; Davis, Metos and self manufactured. Access requires permission from each weather station's owner",
 'net.ipmdecisions.metos': "Network of privately owned weather stations of several types; Davis, Metos and self manufactured. Access requires permission from each weather station's owner",
 'fr.meteo-concept.api': 'Weather station network covering all of mainland France, with a specially high density of agricultural stations in Brittany. Visit www.meteodata.fr and www.meteo-concept.fr or email us at contact@meteo-concept.fr'}
  • Get weather observations for one weatheradapter service

In this example we choose Finnish Meteorological Institute measured data using endpoint=‘/weatheradapter/fmi/’

This weather resource does not need credentials, so credentials is None
ignone= True
interval=3600
parameters = [1002, 3002] to select weather parameters ‘Mean air temperature at 2m’ and ‘Mean RH at 2m’ see ipm.get_parameters() function for description
timeStart=‘2020-06-12T00:00:00+03:00’
timeEnd=‘2020-07-03T00:00:00+03:00’
weatherStationId=101104
[7]:
source = ipm.get_weatherdatasource('fi.fmi.observation.station')
ipm.get_weatheradapter(source)
[7]:
{'timeStart': '2020-01-01T23:00:00Z',
 'timeEnd': '2020-01-02T00:00:00Z',
 'interval': 3600,
 'weatherParameters': [2001, 1002, 3002],
 'locationWeatherData': [{'longitude': 28.29911,
   'latitude': 68.84928,
   'altitude': 0.0,
   'amalgamation': [0, 0, 0],
   'data': [[0.6, -7.5, 94.0], [0.3, -7.4, 93.0]],
   'length': 2,
   'qc': [1, 1, 1],
   'width': 3}]}

Among Weather resource forecast resources are available. When you choose forecast resource thank to use get_weatheradappter_forecast

[9]:
source = ipm.get_weatherdatasource('no.met.locationforecast')
ipm.get_weatheradapter(source)

[9]:
{'timeStart': '2023-05-22T23:00:00Z',
 'timeEnd': '2023-06-01T12:00:00Z',
 'interval': 3600,
 'weatherParameters': [1001, 3001, 2001, 4002],
 'locationWeatherData': [{'longitude': 110.38587558393341,
   'latitude': 84.32042558195184,
   'altitude': 0.0,
   'amalgamation': [0, 0, 0, 0],
   'data': [[-9.2, 84.7, 0.0, 7.8],
    [-9.9, 84.7, 0.0, 7.8],
    [-9.9, 84.1, 0.0, 7.4],
    [-9.8, 82.7, 0.0, 7.1],
    [-9.6, 81.3, 0.0, 6.8],
    [-9.4, 80.7, 0.0, 6.4],
    [-9.1, 79.1, 0.0, 6.1],
    [-8.9, 77.3, 0.0, 5.6],
    [-8.8, 76.1, 0.0, 5.2],
    [-8.8, 75.9, 0.0, 4.9],
    [-8.8, 74.6, 0.0, 4.5],
    [-8.8, 74.4, 0.0, 3.9],
    [-8.8, 74.2, 0.0, 3.2],
    [-8.9, 73.7, 0.0, 2.4],
    [-9.0, 73.5, 0.0, 1.8],
    [-9.1, 73.6, 0.0, 1.4],
    [-9.2, 73.6, 0.0, 1.5],
    [-9.2, 75.0, 0.0, 2.1],
    [-9.2, 76.1, 0.0, 2.6],
    [-9.1, 77.0, 0.0, 3.1],
    [-9.2, 77.3, 0.0, 3.7],
    [-9.3, 78.3, 0.0, 4.1],
    [-9.3, 78.7, 0.0, 4.7],
    [-9.2, 79.0, 0.0, 5.6],
    [-9.3, 80.5, 0.0, 6.4],
    [-9.2, 80.7, 0.0, 7.2],
    [-9.1, 80.9, 0.0, 7.9],
    [-9.1, 83.0, 0.0, 8.6],
    [-9.0, 84.0, 0.0, 9.4],
    [-8.8, 83.2, 0.0, 10.0],
    [-8.8, 84.9, 0.0, 10.9],
    [-8.6, 85.4, 0.0, 11.5],
    [-8.2, 85.6, 0.0, 11.8],
    [-7.9, 87.6, 0.0, 12.3],
    [-7.7, 89.6, 0.0, 12.4],
    [-7.2, 90.2, 0.3, 13.3],
    [-6.6, 90.9, 1.0, 14.1],
    [-5.5, 92.1, 1.4, 14.4],
    [-4.3, 91.7, 1.1, 14.5],
    [-3.4, 92.6, 0.1, 13.5],
    [-2.5, 95.2, 0.0, 11.0],
    [-1.8, 95.8, 0.0, 9.6],
    [-1.4, 95.6, 0.0, 10.4],
    [-1.1, 95.4, 0.0, 10.5],
    [-0.7, 94.5, 0.0, 10.7],
    [-0.7, 95.1, 0.3, 11.2],
    [-0.6, 95.6, 0.2, 11.3],
    [-0.5, 96.0, 0.2, 10.8],
    [-0.5, 96.4, 0.0, 9.9],
    [-0.6, 96.6, 0.4, 10.2],
    [-1.3, 93.9, 0.3, 10.6],
    [-1.6, 93.1, 0.0, 10.6],
    [-2.1, 89.9, 0.0, 11.3],
    [-2.6, 90.1, 0.0, 11.8],
    [-3.0, 89.3, 0.0, 11.8],
    [-3.2, 88.6, 0.0, 12.0],
    [-3.4, 87.1, 0.0, 12.6],
    [-3.5, 87.7, 0.0, 12.3],
    [-3.5, 88.4, 0.0, 12.3],
    [-3.5, 89.1, 0.0, 12.1],
    [-3.5, 90.6, 0.0, 11.5],
    [-3.6, 91.0, 0.0, 10.4],
    [-3.65, 90.98333333333333, 0.0, 9.4],
    [-3.7, 90.96666666666667, 0.0, 8.4],
    [-3.75, 90.95, 0.0, 7.4],
    [-3.8, 90.93333333333334, 0.0, 6.4],
    [-3.85, 90.91666666666667, 0.0, 5.4],
    [-3.9, 90.9, 0.0, 4.4],
    [-3.533333333333333, 91.80000000000001, 0.0, 5.016666666666667],
    [-3.1666666666666665, 92.7, 0.0, 5.633333333333334],
    [-2.8, 93.6, 0.0, 6.25],
    [-2.433333333333333, 94.5, 0.0, 6.866666666666667],
    [-2.0666666666666664, 95.4, 0.0, 7.483333333333333],
    [-1.7, 96.3, 1.0, 8.1],
    [-1.3499999999999999, 95.75, 0.0, 8.95],
    [-0.9999999999999999, 95.2, 0.0, 9.799999999999999],
    [-0.6499999999999999, 94.65, 0.0, 10.649999999999999],
    [-0.2999999999999998, 94.1, 0.0, 11.5],
    [0.050000000000000266, 93.55, 0.0, 12.35],
    [0.4, 93.0, 3.5, 13.2],
    [0.5, 93.3, 0.0, 12.5],
    [0.6, 93.6, 0.0, 11.799999999999999],
    [0.7, 93.9, 0.0, 11.1],
    [0.8, 94.2, 0.0, 10.4],
    [0.8999999999999999, 94.5, 0.0, 9.7],
    [1.0, 94.8, 0.2, 9.0],
    [0.8833333333333333, 95.31666666666666, 0.0, 8.416666666666666],
    [0.7666666666666667, 95.83333333333333, 0.0, 7.833333333333333],
    [0.65, 96.35, 0.0, 7.25],
    [0.5333333333333334, 96.86666666666667, 0.0, 6.666666666666666],
    [0.41666666666666674, 97.38333333333334, 0.0, 6.083333333333333],
    [0.3, 97.9, 0.0, 5.5],
    [0.3, 97.5, 0.0, 5.0],
    [0.3, 97.10000000000001, 0.0, 4.5],
    [0.3, 96.7, 0.0, 4.0],
    [0.3, 96.3, 0.0, 3.5],
    [0.3, 95.9, 0.0, 3.0],
    [0.3, 95.5, 0.0, 2.5],
    [0.36666666666666664, 95.73333333333333, 0.0, 2.816666666666667],
    [0.43333333333333335, 95.96666666666667, 0.0, 3.1333333333333333],
    [0.5, 96.2, 0.0, 3.45],
    [0.5666666666666667, 96.43333333333334, 0.0, 3.7666666666666666],
    [0.6333333333333333, 96.66666666666667, 0.0, 4.083333333333334],
    [0.7, 96.9, 0.0, 4.4],
    [0.6499999999999999, 96.46666666666667, 0.0, 4.75],
    [0.6, 96.03333333333333, 0.0, 5.1000000000000005],
    [0.55, 95.6, 0.0, 5.45],
    [0.5, 95.16666666666667, 0.0, 5.8],
    [0.45, 94.73333333333333, 0.0, 6.15],
    [0.4, 94.3, 0.1, 6.5],
    [0.38333333333333336, 94.43333333333334, 0.0, 6.65],
    [0.3666666666666667, 94.56666666666666, 0.0, 6.8],
    [0.35, 94.69999999999999, 0.0, 6.95],
    [0.3333333333333333, 94.83333333333333, 0.0, 7.1000000000000005],
    [0.31666666666666665, 94.96666666666667, 0.0, 7.25],
    [0.3, 95.1, 0.3, 7.4],
    [0.3333333333333333, 95.14999999999999, 0.0, 7.416666666666667],
    [0.36666666666666664, 95.2, 0.0, 7.433333333333334],
    [0.4, 95.25, 0.0, 7.45],
    [0.43333333333333335, 95.3, 0.0, 7.466666666666667],
    [0.4666666666666667, 95.35000000000001, 0.0, 7.483333333333333],
    [0.5, 95.4, 0.1, 7.5],
    [0.5, 95.10000000000001, 0.0, 7.183333333333334],
    [0.5, 94.8, 0.0, 6.866666666666666],
    [0.5, 94.5, 0.0, 6.55],
    [0.5, 94.2, 0.0, 6.233333333333333],
    [0.5, 93.89999999999999, 0.0, 5.916666666666666],
    [0.5, 93.6, 0.6, 5.6],
    [0.48333333333333334, 93.89999999999999, 0.0, 5.1],
    [0.4666666666666667, 94.2, 0.0, 4.6],
    [0.45, 94.5, 0.0, 4.1],
    [0.43333333333333335, 94.8, 0.0, 3.5999999999999996],
    [0.4166666666666667, 95.10000000000001, 0.0, 3.1],
    [0.4, 95.4, 0.0, 2.6],
    [0.08333333333333337, 94.18333333333334, 0.0, 3.166666666666667],
    [-0.23333333333333328, 92.96666666666667, 0.0, 3.7333333333333334],
    [-0.5499999999999999, 91.75, 0.0, 4.3],
    [-0.8666666666666666, 90.53333333333333, 0.0, 4.866666666666667],
    [-1.1833333333333331, 89.31666666666666, 0.0, 5.433333333333334],
    [-1.5, 88.1, 0.1, 6.0],
    [-1.45, 89.28333333333333, 0.0, 5.633333333333333],
    [-1.4, 90.46666666666667, 0.0, 5.266666666666667],
    [-1.35, 91.65, 0.0, 4.9],
    [-1.3, 92.83333333333333, 0.0, 4.533333333333333],
    [-1.25, 94.01666666666667, 0.0, 4.166666666666666],
    [-1.2, 95.2, 0.1, 3.8],
    [-1.0, 93.76666666666667, 0.0, 3.8833333333333333],
    [-0.8, 92.33333333333333, 0.0, 3.9666666666666663],
    [-0.6, 90.9, 0.0, 4.05],
    [-0.4, 89.46666666666667, 0.0, 4.133333333333333],
    [-0.20000000000000007, 88.03333333333333, 0.0, 4.216666666666667],
    [0.0, 86.6, 0.1, 4.3],
    [0.06666666666666667, 87.76666666666667, 0.0, 4.2],
    [0.13333333333333333, 88.93333333333332, 0.0, 4.1],
    [0.2, 90.1, 0.0, 4.0],
    [0.26666666666666666, 91.26666666666667, 0.0, 3.9],
    [0.3333333333333333, 92.43333333333332, 0.0, 3.8000000000000003],
    [0.4, 93.6, 0.1, 3.7],
    [0.3, 93.91666666666666, 0.0, 4.5],
    [0.19999999999999998, 94.23333333333333, 0.0, 5.3],
    [0.09999999999999998, 94.55, 0.0, 6.1],
    [-5.551115123125783e-17, 94.86666666666666, 0.0, 6.9],
    [-0.10000000000000009, 95.18333333333334, 0.0, 7.699999999999999],
    [-0.2, 95.5, 0.1, 8.5],
    [-0.30000000000000004, 94.9, 0.0, 8.016666666666666],
    [-0.4, 94.3, 0.0, 7.533333333333333],
    [-0.5, 93.7, 0.0, 7.05],
    [-0.6000000000000001, 93.10000000000001, 0.0, 6.566666666666666],
    [-0.7000000000000002, 92.5, 0.0, 6.083333333333333],
    [-0.8, 91.9, 0.4, 5.6],
    [-0.9833333333333334, 90.61666666666667, 0.0, 6.0],
    [-1.1666666666666667, 89.33333333333334, 0.0, 6.3999999999999995],
    [-1.35, 88.05000000000001, 0.0, 6.8],
    [-1.5333333333333332, 86.76666666666667, 0.0, 7.2],
    [-1.7166666666666668, 85.48333333333333, 0.0, 7.6],
    [-1.9, 84.2, 0.7, 8.0],
    [-2.0166666666666666, 84.03333333333333, 0.0, 8.3],
    [-2.1333333333333333, 83.86666666666667, 0.0, 8.6],
    [-2.25, 83.7, 0.0, 8.9],
    [-2.3666666666666667, 83.53333333333333, 0.0, 9.200000000000001],
    [-2.4833333333333334, 83.36666666666667, 0.0, 9.5],
    [-2.6, 83.2, 0.3, 9.8],
    [-2.65, 84.21666666666667, 0.0, 9.266666666666667],
    [-2.7, 85.23333333333333, 0.0, 8.733333333333334],
    [-2.75, 86.25, 0.0, 8.2],
    [-2.8, 87.26666666666667, 0.0, 7.666666666666666],
    [-2.85, 88.28333333333333, 0.0, 7.133333333333333],
    [-2.9, 89.3, 0.0, 6.6],
    [-2.8166666666666664, 87.93333333333334, 0.0, 6.449999999999999],
    [-2.7333333333333334, 86.56666666666666, 0.0, 6.3],
    [-2.65, 85.19999999999999, 0.0, 6.15],
    [-2.5666666666666664, 83.83333333333333, 0.0, 6.0],
    [-2.4833333333333334, 82.46666666666667, 0.0, 5.85],
    [-2.4, 81.1, 0.1, 5.7],
    [-2.45, 80.58333333333333, 0.0, 5.633333333333334],
    [-2.5, 80.06666666666666, 0.0, 5.566666666666666],
    [-2.55, 79.55, 0.0, 5.5],
    [-2.6, 79.03333333333333, 0.0, 5.433333333333334],
    [-2.6500000000000004, 78.51666666666667, 0.0, 5.366666666666666],
    [-2.7, 78.0, 0.1, 5.3],
    [-2.7333333333333334, 78.41666666666667, 0.0, 5.516666666666667],
    [-2.7666666666666666, 78.83333333333333, 0.0, 5.733333333333333],
    [-2.8, 79.25, 0.0, 5.949999999999999],
    [-2.8333333333333335, 79.66666666666667, 0.0, 6.166666666666666],
    [-2.8666666666666667, 80.08333333333333, 0.0, 6.383333333333333],
    [-2.9, 80.5, 0.1, 6.6],
    [-2.9166666666666665, 81.71666666666667, 0.0, 6.683333333333333],
    [-2.933333333333333, 82.93333333333334, 0.0, 6.766666666666667],
    [-2.95, 84.15, 0.0, 6.85],
    [-2.966666666666667, 85.36666666666666, 0.0, 6.933333333333333],
    [-2.9833333333333334, 86.58333333333333, 0.0, 7.016666666666667],
    [-3.0, 87.8, 0.1, 7.1],
    [-2.9333333333333336, 87.8, 0.0, 6.916666666666666],
    [-2.8666666666666667, 87.8, 0.0, 6.733333333333333],
    [-2.8, 87.8, 0.0, 6.55],
    [-2.7333333333333334, 87.8, 0.0, 6.366666666666666],
    [-2.666666666666667, 87.8, 0.0, 6.183333333333334],
    [-2.6, 87.8, 0.1, 6.0],
    [-2.6333333333333333, 86.23333333333333, 0.0, 5.916666666666667],
    [-2.6666666666666665, 84.66666666666667, 0.0, 5.833333333333333],
    [-2.7, 83.1, 0.0, 5.75],
    [-2.7333333333333334, 81.53333333333333, 0.0, 5.666666666666667],
    [-2.7666666666666666, 79.96666666666667, 0.0, 5.583333333333333],
    [-2.8, 78.4, 0.1, 5.5],
    [-2.65, 79.06666666666668, 0.0, 5.3],
    [-2.5, 79.73333333333333, 0.0, 5.1],
    [-2.3499999999999996, 80.4, 0.0, 4.9],
    [-2.1999999999999997, 81.06666666666668, 0.0, 4.7],
    [-2.05, 81.73333333333333, 0.0, 4.5],
    [-1.9, 82.4, 0.1, 4.3]],
   'length': 230,
   'qc': [1, 1, 1, 1],
   'width': 4}]}

2.3. WeatherDataService

  • Get a list of all the available weather data sources

[10]:
ipm.get_weatherdatasource().keys()
[10]:
dict_keys(['no.met.locationforecast', 'ie.gov.data', 'dk.dmi.pointweather', 'se.slu.lantmet', 'net.ipmdecisions.dwd.forecast.germany', 'net.ipmdecisions.dwd.forecast.europe', 'net.ipmdecisions.dwd.euroweather', 'net.ipmdecisions.meteofrance.forecast', 'fi.fmi.forecast.location', 'fi.fmi.observation.station', 'no.nibio.lmt', 'com.meteobot', 'info.fruitweb', 'net.ipmdecisions.metos', 'fr.meteo-concept.api'])
  • Search for weather data sources that serve the specific location. The location can by any valid Geometry, such as Point or Polygon. Example GeoJson input

[12]:
ipm.post_weatherdatasource_location(tolerance=0,geoJsonfile=datadir + 'GeoJson.json')
[12]:
[{'id': 'no.met.locationforecast',
  'name': 'Met Norway Locationforecast',
  'description': '9-day forecasts for the entire planet. 2.5 km resolution in the Nordic-Baltic region, 9km elsewhere',
  'public_URL': 'https://api.met.no/weatherapi/locationforecast/1.9/documentation',
  'endpoint': '{WEATHER_API_URL}/rest/weatheradapter/yr/',
  'authentication_type': 'NONE',
  'needs_data_control': 'false',
  'access_type': 'location',
  'priority': 0,
  'temporal': {'forecast': 9,
   'historic': {'start': None, 'end': None},
   'intervals': [3600]},
  'parameters': {'common': [1001, 3001, 2001, 4002], 'optional': None},
  'spatial': {'countries': None, 'geoJSON': '{"type": "Sphere"}'},
  'organization': {'name': 'The Norwegian Meteorological Institute',
   'country': 'Norway',
   'address': 'Postboks 43 Blindern',
   'postal_code': '0371',
   'city': 'Oslo',
   'email': 'david.melchior@met.no',
   'url': 'https://www.met.no/en'},
  'active': True,
  'endpointFullPath': 'https://platform.ipmdecisions.net/api/wx/rest/weatheradapter/yr/'},
 {'id': 'se.slu.lantmet',
  'name': 'SLU Lantmet service',
  'description': 'Seasonal weather data and forecasts for Sweden. Grid based',
  'public_URL': 'https://www.slu.se/faltforsk',
  'endpoint': '{WEATHER_API_URL}/rest/weatheradapter/lantmet/',
  'authentication_type': 'NONE',
  'needs_data_control': 'false',
  'access_type': 'location',
  'priority': 8,
  'temporal': {'forecast': 1,
   'historic': {'start': '2021-01-01', 'end': None},
   'intervals': [3600, 86400]},
  'parameters': {'common': [1002,
    1003,
    1004,
    2001,
    3002,
    3003,
    3004,
    4003,
    5001],
   'optional': None},
  'spatial': {'countries': ['SWE'], 'geoJSON': None},
  'organization': {'name': 'SLU Fältforsk',
   'country': 'Sweden',
   'address': 'Institutionen för växtproduktionsekologi. Box 7043',
   'postal_code': '750 07',
   'city': 'Uppsala',
   'email': 'lantmet@slu.se',
   'url': 'https://www.slu.se/faltforsk'},
  'active': True,
  'endpointFullPath': 'https://platform.ipmdecisions.net/api/wx/rest/weatheradapter/lantmet/'},
 {'id': 'net.ipmdecisions.dwd.forecast.europe',
  'name': 'Deutsche Wetterdienst EU Area location forecast by IPM Decisions',
  'description': "30 hour weather forecasts for EU. 7 km resolution. Pulls data from DWD's Open Data server (https://www.dwd.de/EN/ourservices/opendata/opendata.html). Made available by a custom adapter created by Met Norway and NIBIO.",
  'public_URL': 'https://github.com/H2020-IPM-Decisions/Location-Weather-Adapter-DWD-EU',
  'endpoint': 'https://dwd-eu.ipmdecisions.nibio.no',
  'authentication_type': 'NONE',
  'needs_data_control': 'false',
  'access_type': 'location',
  'priority': 5,
  'temporal': {'forecast': 1,
   'historic': {'start': None, 'end': None},
   'intervals': [3600]},
  'parameters': {'common': [1001, 3001, 2001, 4002], 'optional': None},
  'spatial': {'countries': None,
   'geoJSON': '{\n"type": "FeatureCollection",\n"features": [\n  {\n    "type": "Feature",\n    "properties": {},\n    "geometry": {\n      "type": "Polygon",\n      "coordinates": [\n        [\n          [\n            -23.3125,\n            29.5625\n          ],\n          [\n            45.0,\n            29.5625\n          ],\n          [\n            45.0,\n            70.3125\n          ],\n          [\n            -23.3125,\n            70.3125\n          ],\n          [\n            -23.3125,\n            29.5625\n          ]\n        ]\n      ]\n    }\n  }\n ]\n}'},
  'organization': {'name': 'The Norwegian Meteorological Institute',
   'country': 'Norway',
   'address': 'Postboks 43 Blindern',
   'postal_code': '0371',
   'city': 'Oslo',
   'email': 'david.melchior@met.no',
   'url': 'https://www.met.no/en'},
  'active': True,
  'endpointFullPath': 'https://dwd-eu.ipmdecisions.nibio.no'},
 {'id': 'net.ipmdecisions.dwd.euroweather',
  'name': 'Euroweather seasonal gridded weather data and forecasts  by IPM Decisions',
  'description': "Seasonal data and 72 hour weather forecasts for EU. 7 km resolution. Pulls data from DWD's Open Data server (https://www.dwd.de/EN/ourservices/opendata/opendata.html). Made available by a custom adapter created by Met Norway and NIBIO.",
  'public_URL': 'https://github.com/H2020-IPM-Decisions/Euroweather-frontend',
  'endpoint': 'https://euroweather.ipmdecisions.nibio.no/weather_data',
  'authentication_type': 'NONE',
  'needs_data_control': 'false',
  'access_type': 'location',
  'priority': 1,
  'temporal': {'forecast': 3,
   'historic': {'start': '2022-01-01', 'end': None},
   'intervals': [3600, 86400]},
  'parameters': {'common': [1001, 1003, 1004, 3001, 2001, 4012],
   'optional': None},
  'spatial': {'countries': None,
   'geoJSON': '{\n"type": "FeatureCollection",\n"features": [\n  {\n    "type": "Feature",\n    "properties": {},\n    "geometry": {\n      "type": "Polygon",\n      "coordinates": [\n        [\n          [\n            -23.3125,\n            29.5625\n          ],\n          [\n            45.0,\n            29.5625\n          ],\n          [\n            45.0,\n            70.3125\n          ],\n          [\n            -23.3125,\n            70.3125\n          ],\n          [\n            -23.3125,\n            29.5625\n          ]\n        ]\n      ]\n    }\n  }\n ]\n}'},
  'organization': {'name': 'The Norwegian Meteorological Institute',
   'country': 'Norway',
   'address': 'Postboks 43 Blindern',
   'postal_code': '0371',
   'city': 'Oslo',
   'email': 'david.melchior@met.no',
   'url': 'https://www.met.no/en'},
  'active': True,
  'endpointFullPath': 'https://euroweather.ipmdecisions.nibio.no/weather_data'}]
  • Search for weather data sources that serve the specific point

[13]:
ipm.get_weatherdatasource_location_point(
    latitude="59.678835236960765",
    longitude="12.01629638671875",
    tolerance=0)
[13]:
[{'id': 'no.met.locationforecast',
  'name': 'Met Norway Locationforecast',
  'description': '9-day forecasts for the entire planet. 2.5 km resolution in the Nordic-Baltic region, 9km elsewhere',
  'public_URL': 'https://api.met.no/weatherapi/locationforecast/1.9/documentation',
  'endpoint': '{WEATHER_API_URL}/rest/weatheradapter/yr/',
  'authentication_type': 'NONE',
  'needs_data_control': 'false',
  'access_type': 'location',
  'priority': 0,
  'temporal': {'forecast': 9,
   'historic': {'start': None, 'end': None},
   'intervals': [3600]},
  'parameters': {'common': [1001, 3001, 2001, 4002], 'optional': None},
  'spatial': {'countries': None, 'geoJSON': '{"type": "Sphere"}'},
  'organization': {'name': 'The Norwegian Meteorological Institute',
   'country': 'Norway',
   'address': 'Postboks 43 Blindern',
   'postal_code': '0371',
   'city': 'Oslo',
   'email': 'david.melchior@met.no',
   'url': 'https://www.met.no/en'},
  'active': True,
  'endpointFullPath': 'https://platform.ipmdecisions.net/api/wx/rest/weatheradapter/yr/'},
 {'id': 'se.slu.lantmet',
  'name': 'SLU Lantmet service',
  'description': 'Seasonal weather data and forecasts for Sweden. Grid based',
  'public_URL': 'https://www.slu.se/faltforsk',
  'endpoint': '{WEATHER_API_URL}/rest/weatheradapter/lantmet/',
  'authentication_type': 'NONE',
  'needs_data_control': 'false',
  'access_type': 'location',
  'priority': 8,
  'temporal': {'forecast': 1,
   'historic': {'start': '2021-01-01', 'end': None},
   'intervals': [3600, 86400]},
  'parameters': {'common': [1002,
    1003,
    1004,
    2001,
    3002,
    3003,
    3004,
    4003,
    5001],
   'optional': None},
  'spatial': {'countries': ['SWE'], 'geoJSON': None},
  'organization': {'name': 'SLU Fältforsk',
   'country': 'Sweden',
   'address': 'Institutionen för växtproduktionsekologi. Box 7043',
   'postal_code': '750 07',
   'city': 'Uppsala',
   'email': 'lantmet@slu.se',
   'url': 'https://www.slu.se/faltforsk'},
  'active': True,
  'endpointFullPath': 'https://platform.ipmdecisions.net/api/wx/rest/weatheradapter/lantmet/'},
 {'id': 'net.ipmdecisions.dwd.forecast.europe',
  'name': 'Deutsche Wetterdienst EU Area location forecast by IPM Decisions',
  'description': "30 hour weather forecasts for EU. 7 km resolution. Pulls data from DWD's Open Data server (https://www.dwd.de/EN/ourservices/opendata/opendata.html). Made available by a custom adapter created by Met Norway and NIBIO.",
  'public_URL': 'https://github.com/H2020-IPM-Decisions/Location-Weather-Adapter-DWD-EU',
  'endpoint': 'https://dwd-eu.ipmdecisions.nibio.no',
  'authentication_type': 'NONE',
  'needs_data_control': 'false',
  'access_type': 'location',
  'priority': 5,
  'temporal': {'forecast': 1,
   'historic': {'start': None, 'end': None},
   'intervals': [3600]},
  'parameters': {'common': [1001, 3001, 2001, 4002], 'optional': None},
  'spatial': {'countries': None,
   'geoJSON': '{\n"type": "FeatureCollection",\n"features": [\n  {\n    "type": "Feature",\n    "properties": {},\n    "geometry": {\n      "type": "Polygon",\n      "coordinates": [\n        [\n          [\n            -23.3125,\n            29.5625\n          ],\n          [\n            45.0,\n            29.5625\n          ],\n          [\n            45.0,\n            70.3125\n          ],\n          [\n            -23.3125,\n            70.3125\n          ],\n          [\n            -23.3125,\n            29.5625\n          ]\n        ]\n      ]\n    }\n  }\n ]\n}'},
  'organization': {'name': 'The Norwegian Meteorological Institute',
   'country': 'Norway',
   'address': 'Postboks 43 Blindern',
   'postal_code': '0371',
   'city': 'Oslo',
   'email': 'david.melchior@met.no',
   'url': 'https://www.met.no/en'},
  'active': True,
  'endpointFullPath': 'https://dwd-eu.ipmdecisions.nibio.no'},
 {'id': 'net.ipmdecisions.dwd.euroweather',
  'name': 'Euroweather seasonal gridded weather data and forecasts  by IPM Decisions',
  'description': "Seasonal data and 72 hour weather forecasts for EU. 7 km resolution. Pulls data from DWD's Open Data server (https://www.dwd.de/EN/ourservices/opendata/opendata.html). Made available by a custom adapter created by Met Norway and NIBIO.",
  'public_URL': 'https://github.com/H2020-IPM-Decisions/Euroweather-frontend',
  'endpoint': 'https://euroweather.ipmdecisions.nibio.no/weather_data',
  'authentication_type': 'NONE',
  'needs_data_control': 'false',
  'access_type': 'location',
  'priority': 1,
  'temporal': {'forecast': 3,
   'historic': {'start': '2022-01-01', 'end': None},
   'intervals': [3600, 86400]},
  'parameters': {'common': [1001, 1003, 1004, 3001, 2001, 4012],
   'optional': None},
  'spatial': {'countries': None,
   'geoJSON': '{\n"type": "FeatureCollection",\n"features": [\n  {\n    "type": "Feature",\n    "properties": {},\n    "geometry": {\n      "type": "Polygon",\n      "coordinates": [\n        [\n          [\n            -23.3125,\n            29.5625\n          ],\n          [\n            45.0,\n            29.5625\n          ],\n          [\n            45.0,\n            70.3125\n          ],\n          [\n            -23.3125,\n            70.3125\n          ],\n          [\n            -23.3125,\n            29.5625\n          ]\n        ]\n      ]\n    }\n  }\n ]\n}'},
  'organization': {'name': 'The Norwegian Meteorological Institute',
   'country': 'Norway',
   'address': 'Postboks 43 Blindern',
   'postal_code': '0371',
   'city': 'Oslo',
   'email': 'david.melchior@met.no',
   'url': 'https://www.met.no/en'},
  'active': True,
  'endpointFullPath': 'https://euroweather.ipmdecisions.nibio.no/weather_data'}]
[ ]:

[ ]: