Analysis Ready Data example queries

This article demonstrates how to query Open Data Cube.

 

On this page

Example 1 - Analysis Ready Data product

Example 2 - NBAR product

Example 3 - NBART product

 


Example 1 – Analysis Ready Data product

The following Python code is an example Open Data Cube query to return the following properties:

  • green, red and near-infrared measurements from the Surface Reflectance NBAR 3 (Landsat 5 TM) and Surface Reflectance NBART 3 (Landsat 5 TM) products
  • Fmask layer from the Surface Reflectance OA 3 (Landsat 5 TM) product
  • Region of Interest (ROI): Longitude 146.54 → 147.94; latitude -19.42 → -21.03
  • Acquisition time of interest: 1990-07-20

All products are nestled under the parent product Surface Reflectance 3 (Landsat 5 TM) (Open Data Cube product ID: ga_ls5t_ard_3).

data = dc.load(
    product='ga_ls5t_ard_3',
    measurements=['nbart_swir_2', 'nbart_blue', 'nbart_green', 'nbart_red', 'nbart_nir', 'nbar_green', 'nbar_red', 'nbar_nir', 'oa_fmask', 'nbart-contiguity'],
    lon=(146.54, 147.94),
    lat=(-19.42, -21.03),
    time=('1990-07-20', '1990-07-21'),
    output_crs='EPSG:3577',
    resolution=(-30, 30)
)

The Data Cube query produces the following images:

ARD AB

Image A is the false colour composite ['nbart_nir', 'nbart_red', 'nbart_green'] displayed as [Red, Green, Blue] from the Surface Reflectance NBART 3 (Landsat 5 TM) product.

Image B is the false colour composite ['nbar_nir', 'nbar_red', 'nbar_green'] displayed as [Red, Green, Blue] from the Surface Reflectance NBAR 3 (Landsat 5 TM) product.

ARD CD

Image C is another Surface Reflectance NBART 3 (Landsat 5 TM)  false colour composite, but uses a different combination of spectral bands ['nbart_swir_2', 'nbart_nir', 'nbart_blue'] displayed as [Red, Green, Blue].

Image D is the relative slope dataset.

ARD E

Image E is the Fmask classification result from the Surface Reflectance NBART 3 (Landsat 5 TM) product. The colours for the Fmask classification are displayed as:

  • Black = clear
  • Magenta = cloud
  • Yellow = cloud shadow
  • Cyan = snow
  • Dark blue = water

ARD FG

Images F and G represent the Surface Reflectance NBART 3 (Landsat 5 TM) false colour composite, with pre- and post-application of the contiguity mask, respectively.

Note that the different spectral bands have different data extents at the edges of the scene (denoted by yellow and red strips). When using the contiguity mask, the data edges have been cut back to where data coexists for all spectral bands.

 


Example 2 – NBAR product

The following Python code is an example Open Data Cube query to return the following properties:

  • green, red and near-infrared measurements from the Surface Reflectance NBAR 3 (Landsat 5 TM) product
  • Fmask layer from the Surface Reflectance OA 3 (Landsat 5 TM) product
  • Region of Interest (ROI): Longitude 146.54 → 147.94; latitude -19.42 → -21.03
  • Acquisition time of interest: 1990-07-20

Both products are nestled under the parent product Surface Reflectance 3 (Landsat 5 TM) (Open Data Cube product ID: ga_ls5t_ard_3).

data = dc.load(
    product='ga_ls5t_ard_3',
    measurements=['nbar_green', 'nbar_red', 'nbar_nir', 'oa_fmask'],
    lon=(146.54, 147.94),
    lat=(-19.42, -21.03),
    time=('1990-07-20', '1990-07-21'),
    output_crs='EPSG:3577',
    resolution=(-30, 30)
)

The Data Cube query produces the following image, which is the false colour composite ['nbar_nir', 'nbar_red', 'nbar_green'] displayed as [Red, Green, Blue].

ARD NBAR

 


Example 3 – NBART product

The following Python code is an example Open Data Cube query to return the following properties:

  • green, red and near-infrared measurements from the Surface Reflectance NBART 3 (Landsat 5 TM) product
  • Fmask layer from the Surface Reflectance OA 3 (Landsat 5 TM) product
  • Region of Interest (ROI): Longitude 146.54 → 147.94; latitude -19.42 → -21.03
  • Acquisition time of interest: 1990-07-20

Both products are nestled under the parent product Surface Reflectance 3 (Landsat 5 TM) (Open Data Cube product ID: ga_ls5t_ard_3).

data = dc.load(
    product='ga_ls5t_ard_3',
    measurements=['nbart_green', 'nbart_red', 'nbart_nir', 'oa_fmask'],
    lon=(146.54, 147.94),
    lat=(-19.42, -21.03),
    time=('1990-07-20', '1990-07-21'),
    output_crs='EPSG:3577',
    resolution=(-30, 30)
)

The Data Cube query produces the following images:

ARD NBART

Image A is the false colour composite ['nbart_nir', 'nbart_red', 'nbart_green'] displayed as [Red, Green, Blue].

Image B is the Fmask classification result. The colours for the Fmask classification are displayed as:

  • Black = clear
  • Magenta = cloud
  • Yellow = cloud shadow
  • Cyan = snow
  • Dark blue = water