List Products & Measurements

Requirements:

You need to run the following commands from the command line prior to launching jupyter notebook from the same terminal so that the required libraries and paths are set.

module use /g/data/v10/public/modules/modulefiles

module load dea

First we will pull in the modules as described in the previous notebook Getting Started.

[1]:
%matplotlib inline
import datacube
import pandas
pandas.set_option('display.max_colwidth', 200)
pandas.set_option('display.max_rows', None)
[2]:
dc = datacube.Datacube()

List Products

We can get all the products in datacube as a pandas DataFrame:

[3]:
products = dc.list_products()
[4]:
products.columns.tolist()
[4]:
['name',
 'description',
 'format',
 'instrument',
 'gqa_abs_xy',
 'lon',
 'gsi',
 'platform',
 'sat_row',
 'lat',
 'creation_time',
 'label',
 'gqa_stddev_xy',
 'product_type',
 'gqa_cep90',
 'gqa_iterative_stddev_xy',
 'gqa_mean_xy',
 'time',
 'ancillary_quality',
 'gqa_abs_iterative_mean_xy',
 'sat_path',
 'gqa_final_gcp_count',
 'orbit',
 'gqa',
 'gqa_error_message',
 'gqa_iterative_mean_xy',
 'gqa_ref_source',
 'crs',
 'resolution',
 'tile_size',
 'spatial_dimensions']

We don’t want to see most of these columns, so we will limit the DataFrame to just a few, and show the rows with a product_type of nbar:

[5]:
display_columns = ['name', 'description', 'platform', 'instrument', 'crs', 'resolution']
nbar_products = products[products['product_type'] == 'nbar'][display_columns].dropna()
nbar_products
[5]:
name description platform instrument crs resolution
id
6 ls5_nbar_albers Landsat 5 Surface Reflectance NBAR 25 metre, 100km tile, Australian Albers Equal Area projection (EPSG:3577) LANDSAT_5 TM EPSG:3577 [-25, 25]
21 ls7_nbar_albers Landsat 7 Surface Reflectance NBAR 25 metre, 100km tile, Australian Albers Equal Area projection (EPSG:3577) LANDSAT_7 ETM EPSG:3577 [-25, 25]
19 ls8_nbar_albers Landsat 8 Surface Reflectance NBAR 25 metre, 100km tile, Australian Albers Equal Area projection (EPSG:3577) LANDSAT_8 OLI_TIRS EPSG:3577 [-25, 25]
60 ls8_nbar_oli_albers Landsat 8 Surface Reflectance NBAR 25 metre, 100km tile, Australian Albers Equal Area projection (EPSG:3577) LANDSAT_8 OLI EPSG:3577 [-25, 25]

List Measurements

[6]:
measurements = dc.list_measurements()
[7]:
measurements.columns.tolist()
[7]:
['aliases',
 'dtype',
 'flags_definition',
 'name',
 'nodata',
 'spectral_definition',
 'units']
[8]:
display_columns = ['units', 'nodata', 'aliases']

We can look at the measurements for just one product, such as ls5_nbar_albers:

[9]:
measurements[display_columns].loc['ls5_nbar_albers']
[9]:
units nodata aliases
measurement
blue 1 -999 [band_1, blue]
green 1 -999 [band_2, green]
red 1 -999 [band_3, red]
nir 1 -999 [band_4, nir]
swir1 1 -999 [band_5, swir1]
swir2 1 -999 [band_7, swir2]

Or we can look at a list of them:

[10]:
product_list = nbar_products.name.tolist()
product_list
[10]:
['ls5_nbar_albers',
 'ls7_nbar_albers',
 'ls8_nbar_albers',
 'ls8_nbar_oli_albers']
[11]:
measurements[display_columns].loc[product_list]
[11]:
units nodata aliases
product measurement
ls5_nbar_albers blue 1 -999 [band_1, blue]
green 1 -999 [band_2, green]
red 1 -999 [band_3, red]
nir 1 -999 [band_4, nir]
swir1 1 -999 [band_5, swir1]
swir2 1 -999 [band_7, swir2]
ls7_nbar_albers blue 1 -999 [band_1, blue]
green 1 -999 [band_2, green]
red 1 -999 [band_3, red]
nir 1 -999 [band_4, nir]
swir1 1 -999 [band_5, swir1]
swir2 1 -999 [band_7, swir2]
ls8_nbar_albers coastal_aerosol 1 -999 [band_1, coastal_aerosol]
blue 1 -999 [band_2, blue]
green 1 -999 [band_3, green]
red 1 -999 [band_4, red]
nir 1 -999 [band_5, nir]
swir1 1 -999 [band_6, swir1]
swir2 1 -999 [band_7, swir2]
ls8_nbar_oli_albers coastal_aerosol 1 -999 [band_1, coastal_aerosol]
blue 1 -999 [band_2, blue]
green 1 -999 [band_3, green]
red 1 -999 [band_4, red]
nir 1 -999 [band_5, nir]
swir1 1 -999 [band_6, swir1]
swir2 1 -999 [band_7, swir2]