Raster Series

A raster series is a collection of individual rasters comprising an entire time series.

List Raster Series

GET /api/series/

List all available raster time series.

Query Parameters:
 
  • slug – search series slugs containing the provided value
  • name – search series names containing the provided value
  • tags – filter on tags
  • page (integer) – page number
  • pagesize (integer) – number of records, default is 10

Raster Series Detail

GET /api/series/{slug}/

Request an individual series with a provided slug. A slug is a URL friendly name of a resource in the API. Each climate dataset or resource has it’s own unique slug. A resource slug is generally composed of {variable}_{period}_{model}_{scenario}.

Example request:

GET /api/series/tasmax_year_CNRM-CM5_rcp45/ HTTP/1.1
Host: api.cal-adapt.org
Accept: application/json

Response:

HTTP/1.1 200 OK
Vary: Accept
Content-Type: application/json

{
"begin": "2006-01-01T00:00:00Z",
"end": "2100-12-31T00:00:00Z",
"name": "yearly average maximum temperature CNRM-CM5 RCP 4.5",
"rasters": [
    "http://api.cal-adapt.org/api/rstores/tasmax_year_CNRM-CM5_rcp45_2006/",
    "http://api.cal-adapt.org/api/rstores/tasmax_year_CNRM-CM5_rcp45_2007/",
    "http://api.cal-adapt.org/api/rstores/tasmax_year_CNRM-CM5_rcp45_2008/"
    ,
]
"slug": "tasmax_year_CNRM-CM5_rcp45",
"tags": [
    "climate",
    "tasmax",
    "temperature"
],
"url": "http://api.cal-adapt.org/api/series/tasmax_year_CNRM-CM5_rcp45/"
}
Parameters:
  • slug – series slug identifier

Time Series

GET /api/series/{slug}/events/

Return the entire time series for any location, with optional temporal and/or rolling aggregations applied. The response consists of columns, data, and index.

The structure of the return is context dependent where a single point returns summary fields (min, mean, max, std, count) when a frequency is provided for temporal aggregation.

Sending a single polygon returns values for all intersecting grid cells, whereas a temporal aggregation is returned when stat= and freq= are provided controlling spatial aggregation and time series resampling respectively.

Example request:

GET /api/series/tasmax_day_HadGEM2-ES_rcp85/events/?g=POINT(-121.46+38.58) HTTP/1.1
Host: api.cal-adapt.org
Accept: application/json

Response:

HTTP/1.1 200 OK
Vary: Accept
Content-Type: application/json

{
"data": [
    284.2241516113,
    283.9797973633,
    283.4098815918
    ,
],
"index": [
    "2006-01-01T00:00:00Z",
    "2006-01-02T00:00:00Z",
    "2006-01-03T00:00:00Z"
    ,
],
"name": "tasmax_day_HadGEM2-ES_rcp85"
}
Parameters:
  • slug – series slug identifier
Query Parameters:
 
  • g – a geometry (point, line, polygon) as GeoJSON, WKT, GML or KML
  • stat – one of max, mean, median, min, sum for spatial aggregation by polygon/line provided by the g param, defaults to mean
  • freq – resampling frequency string such as M, A, 10A, or any Pandas offset
  • rolling – rolling statistic, one of max, mean, median, min, sum
  • window (integer) – rolling window size
  • thresh (float) – only return values above a given threshold
  • imperial (boolean) – use imperial units, defaults to false
  • formatjson or csv
Request Headers:
 
  • Accept – the response content type depends on Accept header
Response Headers:
 
Status Codes:
POST /api/series/{slug}/events/

Use POST when providing a feature set to return data for multiple locations. The same parameters as with GET are available.

Query Parameters:
 
  • features – file upload to provide multiple geometries as part of a feature set, any OGR supported format or zip file

Return monthly data aggregated from daily values for a point location using freq:

GET /api/series/tasmax_day_HadGEM2-ES_rcp85/events/?g=POINT(-121.46+38.58)&freq=M HTTP/1.1
Host: api.cal-adapt.org
Accept: application/json

Response:

HTTP/1.1 200 OK
Vary: Accept
Content-Type: application/json

{
"columns": [
    "min",
    "mean",
    "max",
    "std",
    "count"
],
"data": [
    [
        275.4864807129,
        283.8988342285,
        288.8237304688,
        3.3650608063,
        31
    ],
    [
        283.4172058105,
        290.7746276855,
        298.8256835938,
        3.4072315693,
        28
    ],
    [
        286.8976745605,
        293.8493652344,
        300.5709533691,
        4.2584190369,
        31
    ]
    ,
],
"index": [
    "2006-01-31T00:00:00Z",
    "2006-02-28T00:00:00Z",
    "2006-03-31T00:00:00Z"
    ,
]}

List Series Rasters

GET /api/series/{slug}/rasters/

List all rasters in the series. See the Raster Store description.

Example request:

GET /api/series/tasmax_year_CNRM-CM5_rcp45/rasters/ HTTP/1.1
Host: api.cal-adapt.org
Accept: application/json

Example response:

HTTP/1.1 200 OK
Allow: GET, POST, OPTIONS
Content-Type: application/json
Vary: Accept

{
  "count": 95,
  "next": "https://api.cal-adapt.org/api/series/tasmax_year_CNRM-CM5_rcp45/rasters/?page=2",
  "previous": null,
  "results": [{
      "id": 10521,
      "tileurl": "https://api.cal-adapt.org/tiles/tasmax_year_CNRM-CM5_rcp45_2006/{z}/{x}/{y}.png",
      "url": "https://api.cal-adapt.org/api/rstores/tasmax_year_CNRM-CM5_rcp45_2006/",
      "image": "https://api.cal-adapt.org/media/img/tasmax_year_CNRM-CM5_rcp45_r1i1p1_2006.LOCA_2016-04-02.16th.CA_NV.tif",
      "width": 179,
      "height": 195,
      "geom": "POLYGON ((-124.5625 31.5625, -113.375 31.5625, -113.375 43.75, -124.5625 43.75, -124.5625 31.5625))",
      "event": "2006-01-01",
      "srs": "GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563,AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6326\"]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433],AUTHORITY[\"EPSG\",\"4326\"]]",
      "minval": 279.1251220703125,
      "maxval": 307.180908203125,
      "nodata": 1.0000000150474662e+30,
      "xpixsize": 0.0625,
      "ypixsize": -0.0625,
      "name": "yearly average maximum temperature CNRM-CM5 RCP 4.5",
      "slug": "tasmax_year_CNRM-CM5_rcp45_2006",
      "units": "K"
  }, {
      "id": 10522,
      "tileurl": "https://api.cal-adapt.org/tiles/tasmax_year_CNRM-CM5_rcp45_2007/{z}/{x}/{y}.png",
      "url": "https://api.cal-adapt.org/api/rstores/tasmax_year_CNRM-CM5_rcp45_2007/",
      "image": "https://api.cal-adapt.org/media/img/tasmax_year_CNRM-CM5_rcp45_r1i1p1_2007.LOCA_2016-04-02.16th.CA_NV.tif",
      "width": 179,
      "height": 195,
      "geom": "POLYGON ((-124.5625 31.5625, -113.375 31.5625, -113.375 43.75, -124.5625 43.75, -124.5625 31.5625))",
      "event": "2007-01-01",
      "srs": "GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563,AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6326\"]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433],AUTHORITY[\"EPSG\",\"4326\"]]",
      "minval": 278.38330078125,
      "maxval": 307.52490234375,
      "nodata": 1.0000000150474662e+30,
      "xpixsize": 0.0625,
      "ypixsize": -0.0625,
      "name": "yearly average maximum temperature CNRM-CM5 RCP 4.5",
      "slug": "tasmax_year_CNRM-CM5_rcp45_2007",
      "units": "K"
  }
  ,
  ]
}
Parameters:
  • slug – series slug identifier
Query Parameters:
 
  • g – a geometry (point, line, polygon) as GeoJSON, WKT, GML or KML
  • bbox – a bounding box in the form of x1,y1,x2,y2
  • pagesize – number of records, default is 10
  • formatjson or tif.zip
  • stat – one of mean, max, min, count, median, std, var for spatial aggregation by polygon/line geometry provided by the g param.
Request Headers:
 
  • Accept – the response content type depends on Accept header
Response Headers:
 
Status Codes:
GET /api/series/{slug}/{begin}/{end}/

Filter series rasters from start to end date

Parameters:
  • slug – series slug identifier
  • begin (date) – starting date
  • end (date) – ending date

A time slice or subset can be retrieved by adding start and end dates to the URL.

curl https://api.cal-adapt.org/api/series/tasmax_year_CNRM-CM5_rcp45/2030-01-01/2040-01-01/