Thermal statistics tutorial

Read this tutorial if you are looking for a step-by-step guide on how to retrieve thermal statistics from scenes in the historical data catalog.

The Thermal Statistics API asks for the scene and geometry you want to retrieve statistics for. With that, performing a successful request to Thermal Statistics API will include two steps:

  1. Searching for the images of interest.
  2. Retrieving statistics.

Finding the ID of the image you want to get statistics from depends on your use case. In this tutorial, we will use the catalog search functionality. However, you can consider collecting the information about available scenes for the entire geography of interest and then not using catalog search API for every single thermal statistics request.

Catalog search

For this tutorial, we will perform a catalog search for a small sub-plant area limiting our response to 5 images.

curl -X POST "https://api.satellitevu.com/archive/v2/{contract_id}/search/" 
-H "Authorization: Bearer <Access Token>" 
-H "Content-Type: application/json" 
-d '{
  "intersects": {
    "coordinates": [
      [
        [
          2.2735492755462303,
          51.02842553981742
        ],
        [
          2.2741813779507254,
          51.02831459517145
        ],
        [
          2.2734316750987773,
          51.0268491763874
        ],
        [
          2.272858372916488,
          51.02696937020826
        ],
        [
          2.2735492755462303,
          51.02842553981742
        ]
      ]
    ],
    "type": "Polygon"
  },
  "limit": 5
}'

You need to extract the IDs of returned items so that you can use them in the thermal statistics query.

Running thermal statistics

The thermal statistics endpoint supports either point or polygon geometry definition and up to 100 scenes that overlap with the geometry.

Here is an example of the query for the same geometry:

curl -X POST "https://api.satellitevu.com/insights/thermal/experimental_statistics/v2/{contract_id}/" 
-H "Authorization: Bearer <Access Token>" 
-H "Content-Type: application/json" 
-d '{
  "ids": [
    "<id>", "<id>", "<id>", "<id>", "<id>"
  ],
  "geometry": {
    "coordinates": [
      [
        [
          2.2735492755462303,
          51.02842553981742
        ],
        [
          2.2741813779507254,
          51.02831459517145
        ],
        [
          2.2734316750987773,
          51.0268491763874
        ],
        [
          2.272858372916488,
          51.02696937020826
        ],
        [
          2.2735492755462303,
          51.02842553981742
        ]
      ]
    ],
    "type": "Polygon"
  }
}'

The query usually takes around one second to provide you with extensive thermal statistic information. The response is a GeoJSON FeatureCollection, so that you can easily integrate it into any geospatial tool.

{
  "type": "FeatureCollection",
  "features": [
    {
      "type": "Feature",
      "geometry": {
        "type": "Polygon",
        "coordinates": ...
      },
      "properties": {
        "id": "<id>",
        "created": "2023-05-11T10:54:38.057138+00:00",
        "updated": "2023-05-11T10:54:38.057138+00:00",
        "platform": "<Platform>",
        "gsd": 3.5,
        "datetime": "2023-01-20T22:01:00+00:00",
        "view:off_nadir": 3.8,
        "view:sun_elevation": -49.8685848468146,
        "view:sun_azimuth": 307.68885131078287,
        "eo:cloud_cover": 0,
        "view:azimuth": 82.8,
        "link": {
          "href": "https://...",
          "rel": "self",
          "type": "application/geo+json",
          "title": null
        },
        "p10": 273.58502807617185,
        "p25": 273.93817138671875,
        "p50": 274.24517822265625,
        "p75": 274.4551086425781,
        "p90": 274.5744995117187,
        "mean": 274.1530456542969,
        "min": 273.0336608886719,
        "max": 274.7195129394531,
        "std": 0.38541826605796814,
        "no_data": 0,
        "pix_count": 345
      }
    },
    {...},
    {...},
    {...},
    {...}
  ]
}