Airquality expert service

Name

Airquality expert services - Air-quality data for Norway of the past years for expert users, and a simple scenario calculator for emission reductions

Version 0.2

Add scenario calculator

Minor updates to initial version of air quality data

License

This API is licensed under a Creative Commons Attribution 4.0 License: https://creativecommons.org/licenses/by/4.0/

Description

General description

This API implements air quality model data of the past years for Norway at 100 m spatial resolution. It is intended for expert users to understand the magnitude and variability (in space and from year to year) in air pollution levels. It also includes a simple scenario calculator which allows the user to check the effect of emission reductions.

The database contains data on particulate matter (PM10 and PM2.5) and nitrogen dioxide (NO₂). In addition to the total concentrations, the contributions from different sources are estimated (see section "Description of source contributions").

The data has been generated by running the same air quality model as is used for operational air quality forecasting for Norway at the Norwegian Meteorological Instite. For more information about the model, you may read the model fact sheet: https://www.met.no/prosjekter/luftkvalitet/dokumentasjon-av-luftkvalitetsmodellen

The original model output is given for each day. From the daily data, different statistics have been calculated for each year, and these can be accessed through this API. These statistics are defined in the section "Description of statistics".

Currently, the years 2016-2019 are available. Note that these years have all been run with the same emission inventories and emission factors for human activities. Therefore, the differences seen between years are only caused by differences in meteorological conditions and not changes in human technology or behaviour patterns. The only exception from this is that NOₓ emissions have a trend of -7.5 % per year, following estimates by Statistics Norway (SSB). Population exposure is calculated based on the registered residence addresses of 2017.

The data is given per year and per Norwegian municipality. Data is available for all of Norway's 356 municipalities. All data paths therefore require the parameters 'areacode' and 'timelabel':

The user of the API should first call /available to find out which pairs (areacode, timelabel) are available. The user then selects one such pair and gives it as input parameters to the API calls which return data. The statistics can be accessed as maps or as histograms of population exposure. In addition, total emissions in the municipality can be accessed. These different data access methods are documented below.

Description of source contributions

The air quality model uses a "tagging method" to track the origins of pollution in the model. The total concentration of each pollutant is therefore separated into contributions, which add up to the total concentration.

The local emissions from these anthropogenic sources are tracked:

'Local' here means that the emission is closer than about 6 km away (within a 10 km x 10 km square centred at the location of interest). All natural sources (except seasalt), and all anthropogenic sources emitted outside the 10 km x 10 km square or coming from other sectors than those mentioned above, are grouped together in a source called 'non-local' or 'background'. Seasalt contributions to particulate matter is given as a separate contribution, however, because these particles are not dangerous but may cause high PM concentrations in coastal areas.

You can read more (in Norwegian) about the source apportionment here: https://www.met.no/prosjekter/luftkvalitet/kildebidrag

The API call /contribution_description defines the names of the source contribution variables.

Description of statistics (the name parameter)

The {name} parameter passed to the API calls below defines one of the following statistics:

Annual mean concentration

{c}_concentration_annualmean ({c} is pm10, pm25 or no2)

Annual mean concentrations are averages from 1 January to 31 December, both for total concentration and source contributions. The variable name for total concentration is {c}_concentration. Source contributions are also averaged over the whole calendar year.

Short-time mean of PM10 concentration

pm10_concentration_31_highest_daily_value_inyear

Norwegian air quality regulations define a limit value for daily mean PM10 of 50 µg/m³, which should not be exceeded more than 30 days per year. Daily mean here means a 24-h average from midnight to midnight. This limit can be assessed in two ways with this API:

This statistic gives the highest value that is exceeded by 31 daily mean PM10 concentrations in the coarse of the year. Consequently, if the value is higher than 50 µg/m³, there are too many exceedances. When these datasets come with source contributions, the contributions are averages over all the 31 highest days (rather than the specific day that is ranked 31st, which would be very arbitrary). Then, the variable pm10_concentration refers to the average total concentration of the 31 days (which is the sum of the contributions). In contrast, the variable pm10_concentration_31_highest_daily_value_inyear is the value exceeded by all of the 31 days, and it is this variable that can be used to assess if there are too many exceedances.

Short-time mean of NO₂ concentration

no2_concentration_19_highest_hourly_value_inyear

For NO₂, the hourly mean concentration should not exceed 200 µg/m³ more than 18 times per year. To assess this, the value exceeded by 19 single hours during the year has been calculated. If the values is higher than 200 µg/m³, there are too many exceedances. Note that there may be multiple exceedances on the same day.

To estimate hourly concentrations from daily mean NO₂ concentration, a parametrisation of the diurnal cycle has been used. However, source contributions are only provided for the daily mean. When source contributions are provided, they are averaged over the daily means of all days that contain at least one of the 19 highest hourly concentrations. The variable no2_concentration is the sum of these contributions (total daily mean concentration for these days), while the variable no2_concentration_19_highest_hourly_value_inyear (which is often significantly higher) contains the value exceeded by 19 hourly concentrations.

Luftsonekart

Luftsonekart (map of air zones) is used in spatial planning in municipalities. Levels of PM10 and NO₂ pollution determines whether a given location falls into a yellow or red zone. For more information, see https://www.luftkvalitet-nbv.no/

Further definitions of the luftsonekart data and associated variables are given in the API call /luftsone_description.

Description of the scenario calculator

This API also includes a scenario calculator whcih can test generalized mitigations to see how these will affect the emissions and concentrations. Scenario calculation is done for a single year and municipality. Use /scenario/available to see which combinations of year and municipality are available for scenario calculation (the availability for scenario calculation may be smaller than the availability of data itself).

The scenario calculator is used in two steps. In step 1, mitigations are selected from a predefined set, and the combined effect of the mitigations on total emissions within the municipality is calculated. This computation is quick and therefore synchronized. In step 2, the emission changes are used to create modified concentration maps and statistics for the municipality. These results can then be accessed in the same format as the original data described above. Step 2 involves heavier calculations than step 1 and may take a few minutes. It is therefore done asynchronically. Once step 2 is finished, data from the scenario may be accessed and compared to the original data. The idea is that step 1 can be repeated many times with different combinations of mitigations before the user decides to go on to step 2.

The mitigations that are selected in step 1 can be of three main types.

Usage: Get metadata

Data availability

/available

Overview of available years and municipalities. Provides a list of (areacode, timelabel) pairs for which data are available. In addition, it defines which version of the Norwegian municipality division is used.

/scenario/available works in exactly the same way, but returns the (more limited) list of (areacode, timelabel) pairs that are available for scenario calculation.

Parameters

None

Request URL

https://airquality-expert.met.no/airqualityexpert/0.2/available

Return structure

Return structure is documented here: https://airquality-expert.met.no/airqualityexpert/0.2/swagger.json#/definitions/AvailableDataModel

A compressed example:

{
  "areadefinition": {
    "name": "Kommuneinndeling januar 2020",
    "url": "https://www.ssb.no/klass/klassifikasjoner/131/versjon/1160"
  },
  "last_updated_utc": "2020-02-04 10:10:59",
  "available": [
    {
      "areacode": "0301",
      "areaclass": "kommune",
      "areaname": "Oslo",
      "timelabel": "2016"
    },
    // ...many more (areacode, timelabel) pairs
  ]
}

Description of source contributions

/contribution_description

Defines the source contributions, and the colors and order in which they should appear in a figure/table.

Parameters

None

Request URL

https://airquality-expert.met.no/airqualityexpert/0.2/contribution_description

Return structure

Return structure is documented here: https://airquality-expert.met.no/airqualityexpert/0.2/swagger.json#/definitions/ContributionDescriptionModel

A compressed example:

{
  "variables": {
    "pm10_nonlocal_contribution": {
      "nameNO": "bakgrunn",
      "nameEN": "background",
      "color": "#008000",
      "units": "µg/m³"
    },
    // ...many more variable names (including pm10, pm25 and no2 variables)
  },
  "contribution_order": {
    "pm10_concentration": [
      "pm10_nonlocal_contribution",
      // ...more pm10 variable names
    ],
    "pm25_concentration": [
      "pm25_nonlocal_contribution",
      // ...more pm25 variables names
    ],
    "no2_concentration": [
      "no2_nonlocal_contribution",
      // ..more no2 variable names
    ]
  }
}

Description of emission variables

/emission_description

Defines the emission variables returned in /dataset/{areacode}/{timelabel}/emissions, and the colors and order in which they should appear in a figure/table.

Parameters

None

Request URL

https://airquality-expert.met.no/airqualityexpert/0.2/emission_description

Return structure

Return structure is documented here: https://airquality-expert.met.no/airqualityexpert/0.2/swagger.json#/definitions/EmissionDescriptionModel

A compressed example:

{
  "variables": {
    "pm10_emission_traffic_exhaust": {
      "nameNO": "eksos",
      "nameEN": "exhaust",
      "color": "#800080",
      "units": "Mg/year"
    },
    // ...many more emission variables (pm10, pm25 and nox)
  },
  "emission_order": {
    "pm10_emission": [
      "pm10_emission_traffic_exhaust",
      // ...more pm10 emissions
    ],
    "pm25_emission": [
      "pm25_emission_traffic_exhaust",
      // ...more pm25 emissions
    ],
    "nox_emission": [
      "nox_emission_traffic",
      // ...more nox emissions
    ]
  }
}

Description of air quality zones

/luftsone_description

Description of the variables returned by the "luftsonekart" API calls. The "flags" define the meanings of the values of the variable "luftsonekart".

Parameters

None

Request URL

https://airquality-expert.met.no/airqualityexpert/0.2/luftsone_description

Return structure

Return structure is documented here: https://airquality-expert.met.no/airqualityexpert/0.2/swagger.json#/definitions/LuftsoneDescriptionModel

{
  "flags": {
    "0": {
      "nameNO": "ingen data",
      "nameEN": "no data"
    },
    "1": {
      "nameNO": "ingen sone",
      "nameEN": "no zone"
    },
    "2": {
      "nameNO": "gul sone",
      "nameEN": "yelow zone"
    },
    "3": {
      "nameNO": "rød sone",
      "nameEN": "red zone"
    }
  },
  "variables": {
    "no2_concentration_annualmean": {
      "nameNO": "Årsmiddel av NO₂-konsentrasjon",
      "nameEN": "Annual mean NO₂ concentration",
      "units": "µg/m³"
    },
    "no2_concentration_wintermean": {
      "nameNO": "Vintermiddel av NO₂-konsentrasjon",
      "nameEN": "Winter mean NO₂ concentration",
      "units": "µg/m³"
    },
    "pm10_concentration_8_highest_daily_value_inyear": {
      "nameNO": "8. høyeste PM10 døgnmiddelkonsentrasjon",
      "nameEN": "8. highest PM10 daily mean concentration",
      "units": "µg/m³"
    }
  }
}

Usage: Get data

Maps

/map/{areacode}/{timelabel}/{name}.{format}

Map file of air pollution levels of PM10, PM2.5 or NO₂, or map of air zones (luftsonekart). The map can be given either as a pure image file (.png), or as a geotiff color image file (.tiff), or as a geotiff file with values (.tif). For the image formats, concentration intervals for the colors are provided in the corresponding colorscale call (see below). The returned file only contains a single field (as indicated in parantheses below) and no source contributions.

Parameters

Sample Request URL

https://airquality-expert.met.no/airqualityexpert/0.2/map/0301/2018/no2_concentration_19_highest_hourly_value_inyear.png

Geographical coordinates and population aggregation statistics

/ccoords/{areacode}/{timelabel}

Geographical coordinates of the images returned by /map/{areacode}/{timelabel}/{name}.png, and statistics on the population aggregation in the municipality.

Parameters

Sample Request URL

https://airquality-expert.met.no/airqualityexpert/0.2/ccoords/0301/2018

Return structure

Return structure is documented here: https://airquality-expert.met.no/airqualityexpert/0.2/swagger.json#/definitions/CcoordsModel

An example:

{
  "areacode": "0301",
  "areaclass": "kommune",
  "areaname": "Oslo",
  "crs": "EPSG:32633",
  "llcx": 248700,
  "llcy": 6637400,
  "urcx": 273900,
  "urcy": 6674500,
  "population_centre_x": 264295.7282570417,
  "population_centre_y": 6650153.925849215,
  "population_stdev": 5984.809360170769
}

Colorscales

/colorscale/{areacode}/{timelabel}/{name}

The concentration intervals corresponding to the colors of the colormap used in the corresponding image file /map/{areacode}/{timelabel}/{name}.{format} (where {format} is .png or .tiff)

Note that the color scale should not depend on "areacode" or "timelabel", but it does depend on "name". "areacode" and "timelabel" are still required inputs because each image has been pre-created in the database and is linked to a unique colorscale json file.

The colorscale is defined by a number of adjacent intervals, the first one starting from 0 µg/m³. Each interval contains a list of colors. Each of these colors cover an equally large subinterval of the interval, in the given order. In the example shown below, the first interval goes from 0 µg/m³ to 30 µg/m³ and contains 12 colors. Thus, each color gets a subinterval of (30-0)/12 = 2.5 (µg/m³). Therefore, the first color "#1a801a" will indicate values 0-2.5 µg/m³, the next color "#268a17" indicates 2.5-5 µg/m³, etc. Note that the intervals may be of unequal width and have an unequal number of colors.

Parameters

Sample Request URL

https://airquality-expert.met.no/airqualityexpert/0.2/colorscale/0301/2018/pm10_concentration_31_highest_daily_value_inyear

Return structure

Return structure is documented here: https://airquality-expert.met.no/airqualityexpert/0.2/swagger.json#/definitions/ColorscaleModel

{
  "color_intervals": [
    {
      "bounds": {
        "lower_bound": {
          "value": 0,
          "units": "ug/m3"
        },
        "upper_bound": {
          "value": 30,
          "units": "ug/m3"
        }
      },
      "wms_colors": [
        "#1a801a",
        "#268a17",
        "#339415",
        "#409f13",
        "#4da911",
        "#59b40f",
        "#66be0d",
        "#73c80b",
        "#80d309",
        "#8cdd06",
        "#99e804",
        "#a6f202"
      ]
    },
    // ...more intervals (the next one will start from 30 ug/m3)
  ]
}

Values at specific coordinates

/point_dataset/{areacode}/{timelabel}/{name}

Access to data at a certain geolocated point. For all names except 'luftsonekart', get both total concentration and all source contributions. For luftsonekart, get the air zone code and the three variables that define it.

The chosen point must be within the borders of the municipality.

Parameters

Sample Request URL

https://airquality-expert.met.no/airqualityexpert/0.2/point_dataset/0301/2018/no2_concentration_19_highest_hourly_value_inyear?lat=59.9&lon=10.7

Return structure

The return structure is documented here: https://airquality-expert.met.no/airqualityexpert/0.2/swagger.json#/definitions/PointDataLocationModel

An example:

{
  "meta": {
    "timelabel": "2018",
    "areaname": "Oslo",
    "areacode": "0301",
    "dataset": "no2_concentration_19_highest_hourly_value_inyear",
    "location": {
      "longitude": "10.70000",
      "latitude": "59.90000"
    }
  },
  "data": {
    "variables": {
      "no2_concentration": {
        "value": 46.058937072753906,
        "units": "ug/m3"
      },
      "no2_concentration_19_highest_hourly_value_inyear": {
        "value": 73.45207214355469,
        "units": "ug/m3"
      },
      "no2_local_contribution_heating": {
        "value": 0.08084702491760254,
        "units": "ug/m3"
      },
      // ...more no2 source contributions
    }
  }
}

Population exposure to concentration levels

/dataset/{areacode}/{timelabel}/{name}_cumdist

The number of people exposed to different levels of concentrations (annual mean or short-time mean). For adjacent intervals of concentrations (concentration_intervals), the number of people (population_count) in the municipality (at residence address) exposed to a concentration above a threshold value (bounds -> lower_bound). In addition, average concentration and source contributions are given for the population above each threshold.

The population-weighted average of the whole municipality (concentrations_population_weighted) and the health-related threshold value for the concentration (threshold) are also given.

Parameters

Sample Request URL

https://airquality-expert.met.no/airqualityexpert/0.2/dataset/0301/2018/no2_concentration_19_highest_hourly_value_inyear_cumdist

Return structure

The return structure is documented here: https://airquality-expert.met.no/airqualityexpert/0.2/swagger.json#/definitions/ConcentrationDistModel

A compressed example:

{
  "areacode": "0301",
  "areaclass": "kommune",
  "areaname": "Oslo",
  "timelabel": "2018",
  "dataset": "no2_concentration_19_highest_hourly_value_inyear_cumdist",
  "threshold": {
    "value": 200.0,
    "units": "ug/m3"
    },
  "concentrations_population_weighted": {
    "no2_concentration": {
      "value": 54.677032470703125,
      "units": "ug/m3"
    },
    "no2_concentration_19_highest_hourly_value_inyear": {
      "value": 89.7247085571289,
      "units": "ug/m3"},
    "no2_local_contribution_heating": {
      "value": 0.12069454789161682,
      "units": "ug/m3"
      },
      // ... more source contributions
  },
  "concentration_intervals": [
    // ...intervals with lower bound below 60 ug/m3
    {
      "bounds": {
        "lower_bound": {
          "value": 60.0,
          "units": "ug/m3"
        }
      },
      "population_count": 616342,
      "no2_concentration": {
        "value": 56.66566848754883,
        "units": "ug/m3"
        },
      "no2_concentration_19_highest_hourly_value_inyear": {
        "value": 92.94145202636719,
        "units": "ug/m3"
      },
      "no2_local_contribution_heating": {
        "value": 0.12020888924598694,
        "units": "ug/m3"
      },
      // ...more no2 source contributions
    },
    // ...intervals with lower bound higher than 60 ug/m3
  ]
}

Population exposure with more detailed source contributions

/dataset/{areacode}/{timelabel}/{comp}_concentration_annualmean_sources

In 2022, new endpoints have been added which provide population-weighted exposure to annual mean concentrations with more detail concerning the background concentration. This data is available for PM10 and PM2.5, and for NOₓ instead of NO₂. The data are only available for 2021, and therefore there is a separate endpoint for checking data availability for these endpoints: /sources/available (output formatted same way as the /available endpoint).

The endpoint returns the contributions to PM or NOₓ concentration from each sector from within the municipality itself and from the rest of Norway (Andre kommuner). In some cases up to four other municipalities are shown separately from the rest of Norway (rest of Norway only includes the municipalities not given explicitly). The endpoint finally returns the contributions from other sources: For NOₓ this is just the anthropogenic contribution from abroad, while for PM it is also seasalt, other naturals and secondary PM from precursors in Norway. (Secondary PM from natural and foreign anthropogenic precursors are put into the categories other natural and abroad, respectively.)

Unlike the other endpoints, the numbers are rounded off to one decimal.

Parameters

Sample Request URL

https://airquality-expert.met.no/airqualityexpert/0.2/dataset/0301/2021/pm10_concentration_annualmean_sources

Return structure

Return structure is documented here: https://airquality-expert.met.no/airqualityexpert/0.2/swagger.json#/definitions/SourcesDatasetModel

Example output:

{
  "areacode": "0301",
  "areaclass": "kommune",
  "areaname": "Oslo",
  "timelabel": "2021",
  "dataset": "pm10_concentration_annualmean_sources",
  "total_concentration": {
    "value": 11.200000000000001,
    "units": "ug/m3"
  },
  "source_contributions": {
    "municipalities": [
      {
        "areacode": "0301",
        "areaclass": "kommune",
        "areaname": "Oslo",
        "total_contribution": {
          "value": 3.9000000000000004,
          "units": "ug/m3"
        },
        "sector_contributions": {
          "traffic_exhaust": {
            "value": 0.1,
            "units": "ug/m3"
          },
          "traffic_nonexhaust": {
            "value": 1.8,
            "units": "ug/m3"
          },
          "heating": {
            "value": 1.8,
            "units": "ug/m3"
          },
          "shipping": {
            "value": 0,
            "units": "ug/m3"
          },
          "industry": {
            "value": 0,
            "units": "ug/m3"
          },
          "others": {
            "value": 0.2,
            "units": "ug/m3"
          }
        }
      },
      {
        "areaname": "Andre kommuner",
        "total_contribution": {
          "value": 1.2000000000000002,
          "units": "ug/m3"
        },
        "sector_contributions": {
          "traffic_exhaust": {
            "value": 0,
            "units": "ug/m3"
          },
          "traffic_nonexhaust": {
            "value": 0.30000000000000004,
            "units": "ug/m3"
          },
          "heating": {
            "value": 0.7000000000000001,
            "units": "ug/m3"
          },
          "shipping": {
            "value": 0.1,
            "units": "ug/m3"
          },
          "industry": {
            "value": 0,
            "units": "ug/m3"
          },
          "others": {
            "value": 0.1,
            "units": "ug/m3"
          }
        }
      }
    ],
    "others": {
      "abroad": {
        "value": 2.2,
        "units": "ug/m3"
      },
      "seasalt": {
        "value": 1.4000000000000001,
        "units": "ug/m3"
      },
      "other_natural": {
        "value": 1.7000000000000002,
        "units": "ug/m3"
      },
      "secondary_Norway": {
        "value": 0.8,
        "units": "ug/m3"
      }
    }
  }
}

Emissions

/dataset/{areacode}/{timelabel}/emissions

Total emissions from inside the borders of the municipality, in tons per year, from each sector. The sectors are defined in /emission_description.

NB: Natural sources and smaller anthropogenic sources are not included.

Parameters

Sample Request URL

https://airquality-expert.met.no/airqualityexpert/0.2/dataset/0301/2018/emissions

Return structure

The return structure is documented here: https://airquality-expert.met.no/airqualityexpert/0.2/swagger.json#/definitions/EmissionsModel

A compressed example:

{
  "areacode": "0301",
  "areaclass": "kommune",
  "areaname": "Oslo",
  "timelabel": "2018",
  "dataset": "emissions",
  "emissions": {
    "nox_emission_traffic": {
      "value": 2723.7911132812496,
      "units": "Mg/year"
    },
    // ...more emissions
  }

}

Usage: Scenario calculator

Selection of mitigations

/scenario/scale

Get the full list of available mitigations. Optionally, activate some of the mitigations and get the effects they have on emissions. This endpoint can be used with either POST or GET (it makes no difference). The typical usage is to first call the endpoint with only the three required parameters to get the metadata and default input values for all the mitigations, and then show these default values to the user and

You need to specify which municipality and year you want to work with. Use /scenario/available to see which municipality-year combinations are available for the scenario calculator.

Parameters

Required parameters:

In addition, each value that the user can insert in a mitigation may be given as an optional parameter. The parameters are documented here: https://airquality-expert.met.no/airqualityexpert/0.2/swagger.json#/definitions/ScalingArgumentsModel

Sample Request URL

In this example, the user only activates one mitigation, namely the modification of total traffic with passenger cars:

https://airquality-expert.met.no/airqualityexpert/0.2/scenario/scale?timelabel=2018&areacode=0301&language=NO&scale_PC=-10

Return structure description

The return structure is documented here: https://airquality-expert.met.no/airqualityexpert/0.2/swagger.json#/definitions/ScalingResultModel

It contains three parts:

Return structure example

Below follows an example of the return from /scenario/scale corresponding to the sample request URL above. The json structure has been compressed so that we only show one example of each type of mitigation: One scaling mitigation ("scale_PC"), one share mitigation ("PC_share", which has submitigations) and one on/off-mitigation ("remove_seasalt").

  {
  "mitigation_table": {
    "groups": [
      {
        "id": "traffic",
        "name": "Trafikk",
        "mitigations": [
          {
            "id": "scale_PC",
            "is_boolean": false,
            "name": "Trafikkvolum, personbiler",
            "description": "Øk eller reduser trafikkvolumet av personbiler i kommunen, med en gitt prosent. Positivt tall gir økt trafikk, mens negativt tall gir redusert trafikk.",
            "dynamic_infotext": "Original: 2129.6 mill. km. Ny: 1916.6 mill. km",
            "value": -10,
            "min": -100,
            "max": 500,
            "step": 1,
            "units": "%",
            "value_name": "endring",
            "error": false,
            "submitigations": null
          },
          {
            "id": "PC_share",
            "is_boolean": false,
            "name": "Fordeling av drivstoff, personbiler",
            "description": "Endre andelen av personbiler som går på hvert drivstoff (vektet med antall kjørte kilometer)",
            "dynamic_infotext": "",
            "value": null,
            "min": 100,
            "max": 100,
            "step": null,
            "units": null,
            "value_name": null,
            "error": false,
            "submitigations": [
              {
                "id": "PC_percent_PC-diesel",
                "is_boolean": false,
                "name": "Diesel",
                "description": "Prosentandel av personbilene som går på diesel (vektet med antall kjørte kilometer)",
                "dynamic_infotext": "Original: 56 %",
                "value": 56,
                "min": 0,
                "max": 100,
                "step": 1,
                "units": "%",
                "value_name": "ny andel",
                "error": false
              },
              {
                "id": "PC_percent_PC-petrol",
                "is_boolean": false,
                "name": "Bensin",
                "description": "Prosentandel av personbilene som går på bensin (vektet med antall kjørte kilometer)",
                "dynamic_infotext": "Original: 30 %",
                "value": 30,
                "min": 0,
                "max": 100,
                "step": 1,
                "units": "%",
                "value_name": "ny andel",
                "error": false
              },
              {
                "id": "PC_percent_PC-electric",
                "is_boolean": false,
                "name": "Elektrisk",
                "description": "Prosentandel av personbilene som er elbiler (vektet med antall kjørte kilometer)",
                "dynamic_infotext": "Original: 7 %",
                "value": 7,
                "min": 0,
                "max": 100,
                "step": 1,
                "units": "%",
                "value_name": "ny andel",
                "error": false
              },
              {
                "id": "PC_percent_PC-hybrid-diesel",
                "is_boolean": false,
                "name": "Hybrid-diesel",
                "description": "Prosentandel av personbilene som er hybridbiler med elektrisitet og diesel (vektet med antall kjørte kilometer)",
                "dynamic_infotext": "Original: 0 %",
                "value": 0,
                "min": 0,
                "max": 100,
                "step": 1,
                "units": "%",
                "value_name": "ny andel",
                "error": false
              },
              {
                "id": "PC_percent_PC-hybrid-petrol",
                "is_boolean": false,
                "name": "Hybrid-bensin",
                "description": "Prosentandel av personbilene som er hybridbilier med elektrisitet og bensin (vektet med antall kjørte kilometer)",
                "dynamic_infotext": "Original: 7 %",
                "value": 7,
                "min": 0,
                "max": 100,
                "step": 1,
                "units": "%",
                "value_name": "ny andel",
                "error": false
              }
            ]
          },
          /// .... more mitigations in group "traffic"
        ]
      },
      {
        "id": "other",
        "name": "Annet",
        "mitigations": [
          {
            "id": "remove_seasalt",
            "is_boolean": true,
            "name": "Fjern sjøsalt fra PM",
            "description": "Aktivér dette tiltaket for å fjerne sjøsaltets bidrag til konsentrasjonen av PM (både PM10 og PM2.5)",
            "dynamic_infotext": "Sjøsalt er ikke fjernet",
            "value": 0,
            "min": null,
            "max": null,
            "step": null,
            "units": null,
            "value_name": null,
            "error": false,
            "submitigations": null
          },
        // ... more mitigations in group "other"
        ]
      },
      // ... more mitigation groups
    ]
  },
  "scenario_definition": {
    "areacode": "0301",
    "timelabel": "2018",
    "factors": {
      "nox_local_contribution_heating": [
        {
          "factor": 1.0
        }
      ],
      "nox_local_contribution_industry": [
        {
          "factor": 1.0
        }
      ],
      "nox_local_contribution_shipping": [
        {
          "factor": 1.0
        }
      ],
      // ... more factors, including also for pm10 and pm25
    },
    "scale_input": {
      "timelabel": "2018",
      "areacode": "0301",
      "language": "NO",
      "scale_PC": -10
    }
  },
  "emission_change_table": {
    "sector_names": [
      {
        "id": "nonlocal",
        "name": "bakgrunn",
        "description": "Endring i bakgrunnskonsentrasjon som følge av tiltakene, i prosent"
      },
      {
        "id": "seasalt",
        "name": "sjøsalt",
        "description": "Endring i bidraget fra sjøsalt til konsentrasjonen som følge av tiltakene, i prosent"
      },
      // ..... more sector descriptions
    ],
    "component_names": [
      {
        "id": "pm10",
        "name": "PM10"
      },
      {
        "id": "pm25",
        "name": "PM2,5"
      },
      {
        "id": "nox",
        "name": "NOₓ"
      }
    ],
    "emission_changes": [
      {
        "sector_id": "nonlocal",
        "component_id": "pm10",
        "value": 0.0,
        "units": "%"
      },
      {
        "sector_id": "seasalt",
        "component_id": "pm10",
        "value": 0.0,
        "units": "%"
      },
      {
        "sector_id": "exhaust",
        "component_id": "pm10",
        "value": 0.0,
        "units": "%"
      },
      // ... more emission change entries to the table
    ]
  }
}

Start calculation of results for the scenario

/scenario/scale_and_calculate

Select mitigations and start an async calculation of new concentrations and statistics

Parameters

The same as those given to /scenario/scale, written as a json structure in a POST request. The structure is documented here: https://airquality-expert.met.no/airqualityexpert/0.2/swagger.json#/definitions/ScalingArgumentsModel

Return structure

The call starts an async calculation and returns the initial status of this calculation.

The return structure is documented here: https://airquality-expert.met.no/airqualityexpert/0.2/swagger.json#/definitions/ScenarioJobModel

The fields 'error' and 'progressmessage' in ScenarioJobModel will not be included in the initial status, but may occur when checking the status later. The field 'id' is a universally unique identifier (UUID) that is used to identify this particular calculation and its results.

In addition, the response headers will include "location", which gives a link to where the updated status of the calculation can be checked. This is equivalent to using the /scenario/status/{id} endpoint.

A calculation can also be started using the POST endpoint /scenario/calculate. This alternative endpoint starts a calculation in the same way as /scenario/scale_and_calculate, but it takes the emission scaling factors directly as input rather than calculating them from the set of mitigations. The payload should be on the same format as given in the field 'scenario_definition' returned by /scenario/scale. The endpoint /scenario/calculate should not be used in a web service, though, since the structure of 'scenario_definition' may change and is considered an internal step. It is only meant for testing purposes and may be removed in a future version of the API.

Check the status of your calculation

/scenario/status/{id}

Check the status of an async calculation (job).

Parameters

Sample Request URL

https://airquality-expert.met.no/airqualityexpert/0.2/scenario/status/abc123

Return structure

The return structure is documented here: https://airquality-expert.met.no/airqualityexpert/0.2/swagger.json#/definitions/ScenarioJobModel

The field 'status' is one of these:

The field 'progress' is an integer indicating the percentage of the job that has been done so far, and 'progressmessage' indicates which part of the calculation is currently being worked on. These two infos are meant to be shown in the front-end.

This is an example of a return when the job is running:

{
  "id": "033c7223-07ee-48c1-b251-17477b96dfea",
  "status": "STARTED",
  "progress": 20,
  "progressmessage": "Beregner luftsonekart: regner ut percentil av PM10"
}

Check which inputs were given in a scenario

/scenario/definition/{id}

Get info on the mitigations that were inserted in a scenario whose calculation has finished.

Parameters

Sample request URL

https://airquality-expert.met.no/airqualityexpert/0.2/scenario/definition/abc123

Return structure

The return structure is documented here: https://airquality-expert.met.no/airqualityexpert/0.2/swagger.json#/definitions/ScenarioDefinitionModel

{
  "areacode": "0301",
  "timelabel": "2018",
  "factors": {
    "nox_local_contribution_traffic_exhaust": [
      {
        "factor": 0.9373800540502276
      }
    ],
    "pm10_local_contribution_traffic_exhaust": [
      {
        "factor": 0.9540730464734517
      }
    ],
    // ... more factors
  },
  "scale_input": {
    "timelabel": "2018",
    "areacode": "0301",
    "language": "NO",
    "scale_PC": -10,
    "scale_LCV": 5,
    "scale_HDV": -15,
    "scale_bus": 10
  },
  "id": "abc123"
}

Usage: Get data from calculated mitigation scenarios

Most of the maps and other statistics that are available for the original data can be accessed also for the scenario once its calculation has completed successfully. An exception is the short-time statistic of NO₂, which is not calculated for the scenario.

In addition, you may also access "difference maps", which show the difference between the original data and the mitigation scenario.

Maps

/scenario/map/{id}/{name}.{format}

Map file of air pollution levels of PM10, PM2.5 or NO₂ or map of air zones (luftsonekart) in the calculated scenario. It works the same ways as /map/{areacode}/{timelabel}/{name}.{format}, except that the UUID of the scenario calculation must be given instead of the areacode and timelabel. However, the name "no2_concentration_19_highest_hourly_value_inyear" is not available, and as format only ".png" is available.

Difference Maps

/scenario/map/{id}/{name}_{difftype}.{format}

Map file of the difference in air pollution levels in the calculated scenario relative to the original data. There are two types of maps: absolute difference (in µg/m³) and relative difference (in %). Let {difftype} be either 'absdiff' or 'reldiff'. Otherwise, it works the same way as /scenario/map/{id}/{name}.{format}.

Geographical coordinates and population aggregation statistics

/scenario/ccoords/{id}

This endpoint gives exactly the same output as /ccoords/{areacode}/{timelabel} when insering the areacode and timelabel for which the mitigation scenario was calculated. When using the endpoint /scenario/ccoords/{id}, give the UUID of the calculation instead of the areacode and timelabel. Both difference maps and ordinary concentration maps use the same corner coordinates.

Colorscales

/sceario/colorscale/{id}/{name}

Get a json structure defining the colors used in the maps for scenario statistics. It works the same way as /colorscale/{areacode}/{timelabel}/{name}, except that the UUID of the scenario calculation is given as input instead of areacode and timelabel. The output has the same format as for the colorscales of the original data. {name} can also include the "_absdiff" or "_reldiff" at the end, in order to get the colorscales for the difference maps.

Values at specific coordinates

/scenario/point_dataset/{id}/{name}

Access to data at a certain geolocated point. It works the same way as the endpoints /point_dataset/{areacode}/{timelabel}/{name}, except you give the UUID of the scenario instead of the areacode and timelabel.

Population exposure to concentration levels

/scenario/dataset/{id}/{name}_cumdist

Get data on population exposure. They work the same way as /dataset/{areacode}/{timelabel}/{name}_cumdist, except you give the UUID of the scenario instead of the areacode and timelabel.

Emissions

/scenario/dataset/{id}/emissions

Total emissions from inside the border of the municipality in the scenario. It works the same way as /dataset/{areacode}/{timelabel}/emissions, except you give the UUID of the scenario instead of areacode and timelabel.

Schema

The schema for the request-parameters for this product is available from https://airquality-expert.met.no/airqualityexpert/0.2/swagger.json

The API calls can be tested with swagger here: https://airquality-expert.met.no/airqualityexpert/0.2/swagger/

Changelog

version 0.1

version 0.2

CAVEATS

This server is currently in beta version. It will evolve in the future.