Porting Guide for wsKlima Users

This porting guide is for users that have experience with use of wsKlima and plan to use frost.met.no instead. http://frost.met.no is a new api for observations and climate data from  Norwegian Meteorological Institute.

wsKlima will be supported to 01.03.2019.

In the left column you can find example of use of frost.met.no corresponding to functionality in wsKlima examples in right column.

Use of frost.met.no Use of wsKlima

A JSON API.

The frost.met.no Frost API specification is an XHTML/RDFa document that defines the classes and terms of the JSON-LD format used by the API. https://frost.met.no/schema

Overview of what endpoints and variables and corresponding attributes that are available in this JSON API is: https://frost.met.no/swagger.json 

The documentation is in swagger after https://en.wikipedia.org/wiki/OpenAPI_Specification

If an input variable is not given, all possibilities will be given as default.

A SOAP based API, but also possible to use like a rest"alike" API. Read more about the three services that are available: http://eklima.met.no/wsKlima/start/start_no.html

Reference description: http://eklima.met.no/metdata/MetDataService?WSDL 

METADATA METADATA
New naming convention Timeserietypes

frost.met.no has applied a new naming convention for the observations and the derived statistics. The naming convention follows (as much as possible) the CF-standard. Both the methods and time-resolution involved in the element_id's make use of the timeserie-concept unnecessary.

The concept timeserietype divide the the different types of data into timeseries. A timeserie is to example data that comes from airports, or data with a special timeresolution as daily data or monthly data.http://eklima.met.no/metdata/MetDataService?invoke=getTimeserieTypesProperties&language=&timeserieTypes=

Elements ElementProperties

https://frost.met.no/elements/v0.jsonld?lang=en-US gives all elements with name and description and information.

It is possible to limit the request, searching for specific element_id's or legacy element codes. Use an asterix * to filter the request.

The output gives also information about the connection to the legacy naming Convention at Met Norway, and to the CF-convention.

Backwards compatibilty gives the possibility to request on the old element code, e.g: https://frost.met.no/elements/v0.jsonld?oldElementCodes=TAN&lang=en-US 

But it is the corresponding new elementID that is used in the request for data.

http://eklima.met.no/metdata/MetDataService?invoke=getElementsProperties&language=&elem_codes=

gives all elements:

elemNo - number of element (used in the data flow)
elemCode - short name code for element, used for identification
name - name of element
description - description of element
unit - unit for element
fromdate - observed from this date for a given station
todate - observed until this date for a given station
language - language in which element information is shown.

Or give information about one element:

http://eklima.met.no/metdata/MetDataService?invoke=getElementsProperties&language=&elem_codes=TAN

Available timeseries (source, element and period with data) Information about elements for a station:

To see what elements a source/station observes; use the possibility to find which timeseries that are available, using the /observations/availableTimeSeries

eg:

https://frost.met.no/observations/availableTimeSeries/v0.jsonld?sources=SN18700&referencetime=2017-01-01 

  • source (optional)
  • referencetime (required)
  • element (optional)

Returns information about the source, the element and in which period that this combination contains data.

That means that you have to use the /elements endpoint to get the details about the elements from the output above, as for the example:

https://frost.met.no/elements/v0.jsonld?ids=mean(air_temperature P1M)&lang=en-US 

Returns all elements (with information and observational period) for a given station and timeseries types.

http://eklima.met.no/metdata/MetDataService?invoke=getElementsFromTimeserieTypeStation&timeserietypeID=2&stnr=18700 

Information about sources (stations) Station Properties

/sources

Retrieves stations information if type=SensorSystem

https://frost.met.no/sources/v0.jsonld?types=SensorSystem 

It is possible to filter the request on many parameters.

Get stations filtered by geometry:

https://frost.met.no/concepts/index.html#geometry_specification

 

Remark that frost.met.no does not give you utm coordinates.

getStationsProperties 

Retrieves station information.

name - official name of station
stnr - Norwegian station number, depending on location of major rivers.
wmoNo - WMO's station number, if the station is a SYNOP station, otherwise 0.
fromDay, fromMonth, fromYear - stations/elements operational time is available from this date. If 0, date is not specified.
toDay, toMonth, toYear - stations/elements operational time is available until this date. If 0, date is not specified. If toYear is 0, station is still operational.
amsl (average meter above sea level) - height above sea level for station
municipalityNo - municipality number
department - administrative region or country if other than Norway.
latDec, lonDec, latLonFmt - breddegrader, lengdegrader og format (desimalgrader)
utm_n, utm_e, utm_zone - utm kordinater
Available timeseries (source, element and period with data) Available stations with constraint on timeserietype, element and station

To see what sources that have data; use the possibility to find which timeseries that are available, using the /observations/availabaleTimeSeries

  • source
  • referencetime (required)
  • element (It should be possible to search with * That means that you can search for e.g. *P1D* to get elements as daily values. Or filter on element names as *temperature*

e.g:

https://frost.met.no/observations/availableTimeSeries/v0.jsonld?sources=SN4460&referencetime=2017-03-01

Returns information about the source, the element and in which period that this combination contains data.

getStationsFromTimeserieType

Returns all stations with data for the specified time serie types.

getStationsFromTimeserieTypeElemCodes 

Returns all stations with data for given type of timeserie types and at least one of the elements. Operational time are from the elements (minimum fromdate -> maximum todate).  getStationsFromTimeserieTypeStationsElemCode 

Returns all stations with data for given timeserie type, stations and element code. Operational time is for the element but the station can live longer. A station can provide more informationset because different sensors have observed the element.

Qualityinformation FlagProperties

In addition to the qualitylevel(code) you can get information about which quality flags that are possible:

https://frost.met.no/observations/availableQualityCodes/v0.jsonld?lang=en-US

To get information only about the summarized flags (flaglevels) use filtering on fields: https://frost.met.no/observations/availableQualityCodes/v0.jsonld?lang=en-US&fields=summarized 

In additional it is possible to check the meaning behind a qualityFlag, eg. 70000: https://frost.met.no/observations/quality/v0.jsonld?flags=70000&lang=en-US

http://eklima.met.no/metdata/MetDataService?invoke=getFlagProperties&language=&flagsId=

flagID - number, used for identification
flagCode - short name for the flag
flagName - the name used for
flagDescription - description of quality flag
language - language that they are shown in.
Language Language

Language is specified in the requestParameter “lang” in all endPoints that contain text in the output. Available languages are:

  • en-US (english, default)
  • nb-NO (bokmål Norwegian primary official language)
  • nn-NO (nynorsk Norwegian secondary official language)

 http://eklima.met.no/metdata/MetDataService?invoke=getValidLanguages

  • en (english)
  • no  (default, bokmmål Norwegian primary official language)
  • ny (nynorsk Norwegian secondary official language)
WeatherCodes (code values in general) WeatherCode

This functionality is not implemented yet, but is planned to be a service to provide description and additional info for all elements which observes in codes. code tables are included in the output from elements e.g, the weather observations from manned stations:

https://frost.met.no/elements/v0.jsonld?oldElementCodes=WW&lang=en-US 

gives you the elementId=weather_type with corresponding codeTable=present_weather_manned

The content of this codetable can be found from the endpoint /elements/codeTables: https://frost.met.no/elements/codeTables/v0.jsonld?ids=present_weather_manned&lang=en-US So this is the lookup table for what the values mean when you get them from observations, e.g:

https://frost.met.no/observations/v0.jsonld?sources=SN18700&referencetime=2017-01-01/2017-02-01&elements=weather_type 

Provides description of number codes of precipitation type (element=SLAG/V4/V5/V6).

http://eklima.met.no/metdata/MetDataService?invoke=getPrecipitationTypes&language=&precipitationTypesId= 

DateFormat Period

Timespesification follows ISO-8601 with some extentions (if needed)

https://frost.met.no/reference/index.html#time_specification

http://eklima.met.no/metdata/MetDataService?invoke=getDateFormat

yyyy-MM-dd

 

Location County

The location endpoint will be developed to contain more information about locations, as a service for the location based data provided from the api.

 

CountyId and countyName are included in the /sources endpoint.

Information about id and name of counties referred to in wsKlima.

http://eklima.met.no/metdata/MetDataService?invoke=getCountyTypes&language=&countiesId=

DATA DATA

All observations are now found using /observations specifying:

  • sources
  • referenceTime
  • elements
  • performanceCategory (optional)
  • sensorLevel (#to be implemented)

In this /observations you will find data for the elements (corresponding to timeseies from wsKlima).

output:

  • source
  • level
  • referenceTime
  • observations: element, value, flag, codeTable

The timeseries (observations) method from wsKlima getMetData :

timeserietypeID* - is given as a number. Timeserie types can be retrieved from method getTimeSerietypesProperties("","")

format, from and to is used only for timeserietypeID: 0, 1, 2, 7, 8, 9, 11, 13, 14, 15 and 16
format - for date (see java SimpleDateFormat). Blank ("") uses the default format: yyyy-MM-dd
from - from start of date is given in date format. Blank ("") gives today's date.
to - to end of date is given in date format. Blank ("") gives today's date.

stations* - is given as a comma-separated list of station numbers. Stations can be retrieved from getStationsFromTimeserieType("","")
elements* - is given as a comma-separated list of character-based element codes. Elements can be retrieved from method getElementFromTimeserieType(""). Elements from a timeserie type can be retrieved from method getElementsFromTimeserieType(timeserie type).

hours* is only used for timeserietypeID=2, 8, 9, 13, 14, 15 and 16(hours data)
hours - [0,..,23] are given as a comma-separated list. hours are in UTC-time. s

months can be used by all timeserie types. Blank ("") returns all months in a time intervall.
months - [1,..,12] is given as a comma-separated list .
username - is left blank (null or "") for ordinary users. For some external station owners, brukernavn(username) can be used. In this case, the user name is the same as in eKlima.

Output is timestamp - location-element- value and quality

0 - diurnal values

https://frost.met.no/observations/v0.jsonld?sources=SN18700,SN50540&referencetime=R3/2004-08-01T00:00/2004-10-01T00:00/P1Y&elements=max(air_temperature P1D),min(air_temperature P1D),sum(precipitation_amount P1D)

0 - diurnal values

getMetData("0","","2004-07-01","2006-12-31","18700,50540","rr,tan,tax","","8,9","")
Returns daily values for August and September in the specified period. In the output only year, month and day are current in 'from'=date of daily values (time set to 0).

http://eklima.met.no/met/MetService?invoke=getMetData&timeserietypeID=0&format=&from=2004-07-01&to=2006-12-31&stations=18700,50540&elements=rr,tan,tax&hours=&months=8,9&username=

1 - monthly values

https://frost.met.no/observations/v0.jsonld?sources=SN18700,SN50540&referencetime=R1/2005-07-01T00:00/2006-07-01T00:00/P1Y&elements=max(air_temperature P1M),min(air_temperature P1M),sum(precipitation_amount P1M)


1 - monthly values

getMetData("1","","2005-07-01","2006-07-01","18700,50540","rr,tan,tax","","","")

Returns monthly values for all months from July 2005 to July 2006. In the output only year and month are current in 'from'=date of daily values (time set to 0).

http://eklima.met.no/met/MetService?invoke=getMetData&timeserietypeID=1&format=&from=2005-07-01&to=2006-07-01&stations=18700,50540&elements=rr,tan,tax&hours=&months=&username=

7 - homogenous monthly values

https://frost.met.no/observations/v0.jsonld?sources=SN18700&referencetime=R1/2005-07-01T00:00/2006-07-01T00:00/P1Y&elements=best_estimate_mean(air_temperature P1M)

Using the method best_estimate_* on the elements we indicate the homogenisation method applied on the data. Both monthly, seasonal, yearly and some diurnal data are available.

7 - homogenous monthly values

getMetData("7","","","","18700","tam","","","")

Returns homogeneous monthly values for all months from July 2005 to July 2006.

http://eklima.met.no/met/MetService?invoke=getMetData&timeserietypeID=1&format=&from=2005-07-01&to=2006-07-01&stations=18700,50540&elements=rr,tan,tax&hours=&months=&username=

2 - observations

https://frost.met.no/observations/v0.jsonld?sources=SN18700:0&referencetime=R124/2006-01-01T00:00:00.000Z/2006-01-01T00:00:00.000Z/PT6H&elements=mean(air_temperature PT1H),max(air_temperature PT1H)

These elements are the now values on the measurements stations, nowadays most of them are automatic, reporting data every hour.

https://frost.met.no/observations/v0.jsonld?sources=SN18700:1&referencetime=2006-12-17T00:00:00.000Z/2006-12-31T00:00:00.000Z&elements=max(air_temperature%20PT12H)

SN18700: 1 is sensor number 1, ie of old type of parameter starting with X1, eg: X1TA

The default sensor is 0. It is the same as if you are writing SN18700 or SN18700: 0 .

2 - observations

getMetData("2","","2006-01-01","2006-02-01","18700,50540","ra,tam,tax","0,6,12,18","","")

Returns observations for the times 0,6,12 and 18 UTC in the specified period. In output for time, Z means UTC-time.

http://eklima.met.no/met/MetService?invoke=getMetData&timeserietypeID=2&format=&from=2006-01-01&to=2006-02-01&stations=18700,50540&elements=ra,tam,tax&hours=0,6,12,18&months=&username=

http://eklima.met.no/met/MetService?invoke=getMetData&timeserietypeID=2&format=&from=2006-12-17&to=2006-12-31&stations=18700&elements=X1TA&hours=0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,21,23&months=&username=

14- ten minutes values

https://frost.met.no/observations/v0.jsonld?sources=SN25112&referencetime=2015-01-15T00:00:00.000Z/2015-02-15T00:00:00.000Z&elements=wind_from_direction,wind_speed

14- ten minutes values

getMetData("14","","2015-01-15","2015-02-15","25112","dd,ff","12","","")

Returns observations for the times 12 UTC in the specified period. In output for time, Z means UTC-time.

http://eklima.met.no/met/MetService?invoke=getMetData&timeserietypeID=14&format=&from=2015-01-15&to=2015-02-15&stations=25112&elements=dd,ff&hours=12&months=&username=

9 - environmental data from platforms

https://frost.met.no/observations/v0.jsonld?sources=SN76920:0&referencetime=R31/2008-09-01T12:00:00.000Z/2008-09-01T12:00:00.000Z/PT24H&elements=air_temperature

These data come from a set of station numbers and contain observations e.g. for sea surface elements.

9 - environmental data from platforms

getMetData("8","","2008-09-01","2008-10-01","76920","ta","12","","")

Gives environmental data for 12 UTC in the given period. The output of the time stamp indicates that Z is UTC time.

http://eklima.met.no/met/MetService?invoke=getMetData&timeserietypeID=9&format=&from=2008-09-01&to=2008-10-01&stations=76920&elements=ta&hours=12&months=&username=

The data are quality controlled manually, so the data are somewhat delayed.

15 - ten minutes values from environmental stations/platforms

https://frost.met.no/observations/v0.jsonld?sources=SN76920:0&referencetime=R29/2013-10-03T12:00:00.000Z/2013-10-03T12:00:00.000Z/PT24H&elements=air_temperature

These data come from a set of station numbers and contain observations e.g. for sea surface elements. The data are automatically controlled.

15 - ten minutes values from environmental stations/platforms

getMetData("15","","2013-10-03","2013-11-01","76920","ta","12","","")

Returns observations for the times 12 UTC in the specified period. In output for time, Z means UTC-time.

http://eklima.met.no/met/MetService?invoke=getMetData&timeserietypeID=15&format=&from=2013-10-03&to=2013-11-01&stations=76920&elements=ta&hours=12&months=&username=

13 - Data from the road agency, as performancecategory=C

https://frost.met.no/observations/v0.jsonld?sources=SN27415:0&referencetime=2016-03-01T00:00:00.000Z/2016-03-06T12:00:00.000Z&elements=air_temperature&performancecategories=C

These data come from stations which does not perform after the WMO (and Met Norway) standard as performanceCategory A. But the  measurements are freely available, but are flagged as performanceCategory=C.

The available timeseries for this timeserietype can therefore be found from: https://frost.met.no/observations/availableTimeSeries/v0.jsonld?performancecategories=C

The controlInfo method is not yet implemented.

13 - Data from the road agency

http://wsklima/met/MetService?invoke=getMetData&timeserietypeID=13&format=&from=2016-03-01&to=2016-03-06&stations=5495&elements=ta&hours=12&months=&username=useracces

  This timeserietype has been restricted to those users with a username with access to the data, in agreement with the data owner.

getControlInfo - method for road agency to get detailed quality information about the measurements.


5 - daily extremes

Daily extremes are not in use (because of lack of datacoverage) and will therefore not be implemented at the time being.

5 - daily extremes

Gives the extreme values in the station period, each day, for one station.

http://eklima.met.no/met/MetService?invoke=getMetData×erietypeID=5&format=&from=&to=&stations=18700&elements=rr,tax&hours=&months=&username

10 - extremes per county

Extremes for counties can be found from the endpoint:

/record/

https://frost.met.no/record/countyExtremes/v0.jsonld?counties=Oslo&elements=min(air_temperature P1D)

10 - extremes per county

getMetData("10","","","","3","tan","","","")

Inputparameter stations are in the county types (countyID) that can be obtained from a method called getCountyTypes. In the output: 'from' - the date that says what year and day records were set for each month, 'id' - stationnumber for which records were set and 'type' - provides county type.

http://eklima.met.no/met/MetService?invoke=getMetData&timeserietypeID=10&format=&from=&to=&stations=3&elements=tan&hours=&months=&username=

8 - Metar data: (observed from aerodromes)

https://frost.met.no/observations/v0.jsonld?sources=SN4780:0&referencetime=2008-09-01T00:00:00.000Z/2008-10-01T00:00:00.000Z&elements=air_temperature

8 - Metar data: (observed from aerodromes)

getMetData("8","","2008-09-01","2008-10-01","4780","ta","12","","")

Provides metardata for 12 UTC in the given period. The output of the time stamp indicates that Z is UTC time.

http://eklima.met.no/met/MetService?invoke=getMetData&timeserietypeID=8&format=&from=2008-09-01&to=2008-10-01&stations=4780&elements=ta&hours=12&months=&username=

11 - Data coverage

This datacoverage functionality will not be provided in the first version of frost.met.no

11 - Data coverage

getMetData("8","","2008-09-01","2008-10-01","4780","ta","12","","")

Provides metardata for 12 UTC in the given period. The output of the time stamp indicates that Z is UTC time.

http://eklima.met.no/met/MetService?invoke=getMetData&timeserietypeID=11&format=&from=2011-01-01&to=2011-07-01&stations=18700&elements=tan&hours=&months=&username=

16=Projectdata. Special data from project stations(special parameters)
These data will be provided, but are not accessible right now.

16=Projectdata. Special data from projekt stations(special parameters)

http://eklima.met.no/met/MetService?invoke=getMetData&timeserietypeID=16&format=&from=2017-01-01&to=2017-01-0&1stations=85560&elements=ta&hours=0,6,12,18&months=&username=

Frequencies Intensity-duration-frequency

The endpoint/frequencies/rainfall gives the intensity-duration and frequency data for stations.

https://frost.met.no/frequencies/rainfall/v0.jsonld?sources=SN18701

It is also possible to filter on durations, frequencies and unit

See: https://frost.met.no/reference#!/frequencies/getRainfallIDF 

It is also possible to get the IDF value for a certain location (from 1x1 km grid) e.g: https://frost.met.no/frequencies/rainfall/v0.jsonld?sources=idf_bma1km&location=point(10%2060) 

A visualisation of the data can be found at the Climate Service Center website:

https://klimaservicesenter.no/faces/desktop/idf.xhtml 

Timeserietype 17 = IDF-data:

http://eklima.met.no/met/MetService?invoke=getMetData&timeserietypeID=17&format=&from=&to=&stations=18701&elements=&hours=&months=&username=

wsKlima did also have a Graph service which gave a visualization of the IDF-data:

Graph- > idf

Climatology normals Climatology normals

3 - monthly normals

https://frost.met.no/climatenormals/v0.jsonld?sources=SN18700,SN50540&elements=mean(air_temperature P1M),sum(precipitation_amount P1M)&period=1961/1990

4 - diurnal normals

https://frost.met.no/climatenormals/v0.jsonld?sources=SN18700,SN50540&elements=mean(air_temperature P1D)&period=1961/1990

3 - monthly normals

getMetData("3","","","","18700,50540","rr,tam","","","")

For default normal period [1961-01-01 -> 1990-12-31] can input parameters 'from' and 'two ' be blank. Another normal period [1931-01-01 -> 1960-12-31] is also available. Method returns month normals. In the output for date 'from' shows year = (start normal period) and (month and day) = (start of the current month). Date 'to ' shows years = (end normal period) and (month and day) = (end of current month).

http://eklima.met.no/met/MetService?invoke=getMetData&timeserietypeID=3&format=&from=&to=&stations=18700%2C50540&elements=rr%2Ctam&hours=&months=&username=

4 - diurnal normals

getMetData("4","","","","18700,50540","tam","","","")

Input parameters 'from' and 'to ' can be blank because it's just one normal period [1961-01-01 -> 1990-12-31] (default). The method returns daily normals for normal period. In the output for date 'from' shows year = (start normal period) and (month and day) = (start of the current day). Date 'to ' shows years = (end normal period) and (month and day) = (end of the current day).

http://eklima.met.no/met/MetService?invoke=getMetData&timeserietypeID=4&format=&from=&to=&stations=18700%2C50540&elements=tam&hours=&months=&username=

This functionality is planned to be integrated in frost.met.no in 2019.

Region data - to get climate data information for a region.
As you can find from a distinct endpoint in  wsKlima:

http://eklima.met.no/wsKlima/complete/cData_en.html

http://eklima.met.no/met/MetService?invoke=getRegionHistoryTrend&region_type=GR&region_no=1&element=tam&fromYear=1900&toYear=2017&month=4&language=