RSGISLib DataCube Module

The datacube module provides a link to the open data cube within RSGISLib.

Retrieve Data

rsgislib.datacube.retrievedata.getSingleTimeDataProd(dataProd, prodMeasurements, startDate, endDate, minLat, maxLat, minLon, maxLon, outImgFile, gdalformat='KEA', gdalDataType=1, gdalOptions=[])

A function to extract data from an instance of the open data cube ( and save it to a GDAL supported file format. Note. this function only saves files where only a single data layer is returned for the time period specified.

  • dataProd – provide the name of the data product to be extracted.

  • prodMeasurements – provide input array of measurements

  • startDate – start period (YYYY-MM-DD)

  • endDate – end period (YYYY-MM-DD)

  • minLat – minimum latitude for the query bounding box

  • maxLat – maximum latitude for the query bounding box

  • minLon – minimum longditude for the query bounding box

  • maxLon – maximum longditude for the query bounding box

  • outImgFile – file path and name for the output image file.

  • gdalformat – output file format (Default: ‘KEA’). Must support GDAL create function.

  • gdalDataType – output file datatype (Default: gdal.GDT_Byte)

  • gdalOptions – array of options for gdal file creation (e.g., for GeoTIFF [“TILED=YES”, “COMPRESS=DEFLATE”]). Default: []


getSingleTimeDataProd('fc_percentile_albers_annual', ['PV_PC_10', 'NPV_PC_10'], '2015-01-01', '2015-12-31', -24.9, -24.8, 142.5, 142.6, 
                      'FC_Percent_PV_NPV_2015.kea', gdalformat='KEA', gdalDataType=gdal.GDT_Byte, gdalOptions=[])