Catalog

class Catalog(url=None, auth=None, metadata=None)[source]

The Descartes Labs (DL) Catalog allows you to add georeferenced raster products into the Descartes Labs Platform. Catalog products can be used in other DL services like Raster and Tasks and Metadata.

The entrypoint for using catalog is creating a Product using Catalog.add_product(). After creating a product you should add band(s) to it using Catalog.add_band(), and upload imagery using Catalog.upload_image().

Bands define where and how data is encoded into imagery files, and how it should be displayed. Images define metadata about a specific groups of pixels (in the form of images), their georeferencing, geometry, coordinate system, and other pertinent information.

The parent Service class implements authentication and exponential backoff/retry. Override the url parameter to use a different instance of the backing service.

add_band(product_id, name, add_namespace=False, srcband=None, dtype=None, nbits=None, data_range=None, type=None, **kwargs)[source]

Add a data band to an existing product.

Parameters:
  • product_id (str) – (Required) Product to which this band will belong.
  • name (str) – (Required) Name of this band.
  • add_namespace (bool) – Add your user namespace to the product_id. Deprecated
  • jpx_layer (int) – If data is processed to JPEG2000, which layer is the band in. Defaults to 0.
  • srcband (int) – (Required) The 1-based index of the band in the jpx_layer specified.
  • srcfile (int) – If the product was processed into multiple files, which one is this in. Defaults to 0 (first file).
  • dtype (str) – (Required) The data type used to store this band e.g Byte or Uint16 or Float32.
  • nbits (int) – (Required) The number of bits of the dtype used to store this band.
  • data_range (list(int)) – (Required) A list specifying the min and max values for the data in this band.
  • type (str) – (Required) The data interpretation of the band. One of [‘spectral’, ‘derived’, ‘mask’, ‘class’]
  • nodata (int) – Pixel value indicating no data available.
  • read (list(str)) – A list of groups, or user hashes to give read access to. Defaults to the same as the parent product if not specified.
  • color (str) – The color interpretation of this band. One of [‘Alpha’, ‘Black’, ‘Blue’, ‘Cyan’, ‘Gray’, ‘Green’, ‘Hue’, ‘Ligntness’, ‘Magenta’, ‘Palette’, ‘Red’, ‘Saturation’, ‘Undefined’, ‘YCbCr_Cb’, ‘YCbCr_Cr’, ‘YCbCr_Y’, ‘Yellow’]. Must be ‘Alpha’ if type is ‘mask’. Must be ‘Palette’ if colormap_name or colormap is set.
  • colormap_name (str) – A named colormap to use for this band, one of [‘plasma’, ‘magma’, ‘viridis’, ‘msw’, ‘inferno’]
  • colormap (list(list(str))) – A custom colormap to use for this band. Takes a list of lists, where each nested list is a 4-tuple of rgba values to map pixels whose value is the index of the tuple. i.e the colormap [[“100”, “20”, “200”, “255”]] would map pixels whose value is 0 in the original band, to the rgba color vector at colormap[0]. Less than 2^nbits 4-tuples may be provided, and omitted values will default map to black.
  • data_description (str) – Description of band data.
  • physical_range (list(float)) – If band represents a physical value e.g reflectance or radiance what are the possible range of those values.
  • data_unit (str) – Units of the physical range e.g w/sr for radiance
  • data_unit_description (str) – Description of the data unit.
  • default_range (list(int)) – A good default scale for the band to use when rastering for display purposes.
  • description (str) – Description of the band.
  • name_common (str) – Standard name for band
  • name_vendor (str) – What the vendor calls the band eg. B1
  • vendor_order (int) – The index of the band in the vendors band tables. Useful for referencing the band to other processing properties like surface reflectance.
  • processing_level (str) – Description of how the band was processed if at all.
  • res_factor (int) – Scaling of this band relative to the native band resolution.
  • resolution (int) – Resolution of this band.
  • resolution_unit (str) – Unit of the resolution.
  • wavelength_center (float) – Center position of wavelength.
  • wavelength_fwhm (float) – Full width at half maximum value of the wavelength spread.
  • wavelength_min (float) – Minimum wavelength this band is sensitive to.
  • wavelength_max (float) – Maximum wavelength this band is sensitive to.
  • wavelength_unit (str) – Units the wavelength is expressed in.
Returns:

JSON API representation of the band.

Return type:

dict

add_image(product_id, image_id, add_namespace=False, **kwargs)[source]

Add an image metadata entry to a product.

Parameters:
  • product_id (str) – (Required) Product to which this image belongs.
  • image_id (str) – (Required) New image’s id = <product_id>:<image_id>.
  • add_namespace (bool) – Add your user namespace to the product_id. Deprecated
  • read (list(str)) – A list of groups, or user hashes to give read access to. Defaults to the same as the parent product if not specified.
  • absolute_orbit (int) – Orbit number since mission start.
  • acquired (str) – Date the imagery was acquired
  • archived (str) – Date the imagery was archived.
  • area (float) – Surface area the image covers
  • azimuth_angle (float) –
  • azimuth_angle_1 (float) –
  • bits_per_pixel (list(float)) – Average bits of data per pixel per band.
  • bright_fraction (float) – Fraction of the image that has reflectance greater than .4 in the blue band.
  • bucket (str) – Name of Google Cloud Bucket. Must be public bucket or Descartes Labs user bucket.
  • catalog_id (str) –
  • cirrus_fraction (float) – Fraction of pixel which are distorted by cirrus clouds.
  • cloud_fraction (float) – Fraction of pixels which are obscured by clouds.
  • cloud_fraction_0 (float) – Fraction of pixels which are obscured by clouds.
  • cs_code (str) – Spatial coordinate system code eg. EPSG:4326
  • datastrip_id – ID of the data strip this image was taken in.
  • degraded_fraction_0 (float) –
  • descartes_version (str) –
  • directory (str) – Subdirectory location.
  • duration (float) – duration of the scan in seconds
  • duration_days (int) –
  • earth_sun_distance (float) – Earth sun distance at time of image capture.
  • files (list(str)) – Names of the files this image is stored in.
  • file_md5s (list(str)) – File integrity checksums.
  • file_sizes (list(int)) – Number of bytes of each file
  • fill_fraction (float) – Fraction of this image which has data.
  • geolocation_accuracy (float) –
  • geometry (str|dict) – GeoJSON representation of the image coverage.
  • geotrans (float) – Geographic Translator values.
  • gpt_time (float) –
  • identifier (str) – Vendor scene identifier.
  • ifg_tdelta_days (int) –
  • incidence_angle (float) – Sensor incidence angle.
  • pass (str) – On which pass was this image taken.
  • processed (str) – Date which this image was processed.
  • proj4 (str) – proj.4 transformation parameters
  • projcs (str) – Projection coordinate system.
  • published (str) – Date the image was published.
  • radiometric_version (str) –
  • raster_size (list(int)) – Dimensions of image in pixels in (width, height).
  • reflectance_scale (list(float)) – Scale factors converting TOA radiances to TOA reflectances
  • reflectance_scale_1 (list(float)) –
  • relative_orbit (int) – Orbit number in revisit cycle.
  • roll_angle (float) –
  • safe_id (str) – Standard Archive Format for Europe.
  • sat_id (str) – Satellite identifier.
  • scan_gap_interpolation (float) –
  • solar_azimuth_angle (float) –
  • solar_azimuth_angle_0 (float) –
  • solar_azimuth_angle_1 (float) –
  • solar_elevation_angle (float) –
  • solar_elevation_angle_0 (float) –
  • solar_elevation_angle_1 (float) –
  • tile_id (str) –
  • view_angle (float) –
  • view_angle_1 (float) –
  • extra_properties (dict) – User defined custom properties for this image. Only 10 keys are allowed. The dict can only map strings to primitive types (str -> str|float|int).
Returns:

JSON API representation of the image.

Return type:

dict

add_product(product_id, title, description, add_namespace=False, **kwargs)[source]

Add a product to your catalog.

Parameters:
  • product_id (str) – (Required) A unique name for this product. In the created product a namespace consisting of your user id (e.g. “ae60fc891312ggadc94ade8062213b0063335a3c:”) or your organization id (e.g., “yourcompany:”) will be prefixed to this, if it doesn’t already have one, in order to make the id globally unique.
  • title (str) – (Required) Official product title.
  • description (str) – (Required) Information about the product, why it exists, and what it provides.
  • add_namespace (bool) – Add your user namespace to the product_id. Deprecated
  • read (list(str)) – A list of groups, or user hashes to give read access to.
  • spectral_bands (int) – Number of spectral bands the product has.
  • native_bands (list(str)) – A list of the names of the native bands of this product (most applicable to satellite sensors).
  • start_datetime (str) – ISO8601 compliant date string, indicating start of product data.
  • end_datetime (str) – ISO8601 compliant date string, indicating end of product data.
  • notes (str) – Any notes to relay about the product.
  • orbit (str) – Type of orbit (satellite only).
  • processing_level (str) – Way in which raw data has been processed if any.
  • resolution (str) – Pixel density of the data, provide units.
  • revisit (str) – How often an AOI can expect updated data.
  • sensor (str) – Name of the sensor used.
  • swath (str) – How large an area the sensor captures at a given time.
Returns:

JSON API representation of the product.

Return type:

dict

change_band(product_id, name, add_namespace=False, **kwargs)[source]

Add a data band to an existing product.

Parameters:
  • product_id (str) – (Required) Product to which this band belongs.
  • name (str) – Name or id of band to modify.
  • add_namespace (bool) – Add your user namespace to the product_id. Deprecated
  • data_range (list(int)) – A list specifying the min and max values for the data in this band.
  • dtype (str) – The data type used to store this band e.g Byte or Uint16 or Float32.
  • jpx_layer (int) – If data is processed to JPEG2000, which layer is the band in. Use 0 for other formats.
  • nbits (int) – The number of bits of the dtype used to store this band.
  • srcband (int) – The 1-based index of the band in the jpx_layer specified.
  • srcfile (int) – If the product was processed into multiple files, which one is this in.
  • type (str) – The data interpretation of the band. One of [‘spectral’, ‘derived’, ‘mask’, ‘class’]
  • read (list(str)) – A list of groups, or user hashes to give read access to.
  • color (str) – The color interpretation of this band. One of [‘Alpha’, ‘Black’, ‘Blue’, ‘Cyan’, ‘Gray’, ‘Green’, ‘Hue’, ‘Ligntness’, ‘Magenta’, ‘Palette’, ‘Red’, ‘Saturation’, ‘Undefined’, ‘YCbCr_Cb’, ‘YCbCr_Cr’, ‘YCbCr_Y’, ‘Yellow’]. Must be ‘Alpha’ if type is ‘mask’. Must be ‘Palette’ if colormap_name or colormap is set.
  • colormap_name (str) – A named colormap to use for this band, one of [‘plasma’, ‘magma’, ‘viridis’, ‘msw’, ‘inferno’]
  • colormap (list(list(str))) – A custom colormap to use for this band. Takes a list of lists, where each nested list is a 4-tuple of rgba values to map pixels whose value is the index of the tuple. i.e the colormap [[“100”, “20”, “200”, “255”]] would map pixels whose value is 0 in the original band, to the rgba color vector at colormap[0]. Less than 2^nbits 4-tuples may be provided, and omitted values will default map to black.
  • data_description (str) – Description of band data.
  • physical_range (list(float)) – If band represents a physical value e.g reflectance or radiance what are the possible range of those values.
  • data_unit (str) – Units of the physical range e.g w/sr for radiance
  • data_unit_description (str) – Description of the data unit.
  • default_range (list(int)) – A good default scale for the band to use when rastering for display purposes.
  • description (str) – Description of the band.
  • name_common (str) – Standard name for band
  • name_vendor (str) – What the vendor calls the band eg. B1
  • vendor_order (int) – The index of the band in the vendors band tables. Useful for referencing the band to other processing properties like surface reflectance.
  • nodata (int) –
  • processing_level (str) – Description of how the band was processed if at all.
  • res_factor (int) – Scaling of this band relative to the native band resolution.
  • resolution (int) – Resolution of this band.
  • resolution_unit (str) – Unit of the resolution.
  • wavelength_center (float) – Center position of wavelength.
  • wavelength_fwhm (float) – Full width at half maximum value of the wavelength spread.
  • wavelength_min (float) – Minimum wavelength this band is sensitive to.
  • wavelength_max (float) – Maximum wavelength this band is sensitive to.
  • wavelength_unit (str) – Units the wavelength is expressed in.
Returns:

JSON API representation of the band.

Return type:

dict

change_image(product_id, image_id, add_namespace=False, **kwargs)[source]

Add an image metadata entry to a product.

Parameters:
  • product_id (str) – (Required) Product to which this image belongs.
  • image_id (str) – (Required) ID of the image to modify.
  • add_namespace (bool) – Add your user namespace to the product_id. Deprecated
  • read (list(str)) – A list of groups, or user hashes to give read access to.
  • absolute_orbit (int) – Orbit number since mission start.
  • acquired (str) – Date the imagery was acquired
  • archived (str) – Date the imagery was archived.
  • area (float) – Surface area the image covers
  • azimuth_angle (float) –
  • azimuth_angle_1 (float) –
  • bits_per_pixel (list(float)) – Average bits of data per pixel.
  • bright_fraction (float) – Fraction of the image that has reflectance greater than .4 in the blue band.
  • bucket (str) – Name of Google Cloud Bucket. Must be public bucket or Descartes Labs user bucket.
  • catalog_id (str) –
  • cirrus_fraction (float) – Fraction of pixel which are distorted by cirrus clouds.
  • cloud_fraction (float) – Fraction of pixels which are obscured by clouds.
  • cloud_fraction_0 (float) – Fraction of pixels which are obscured by clouds.
  • cs_code (str) – Spatial coordinate system code eg. EPSG:4326
  • datastrip_id – ID of the data strip this image was taken in.
  • degraded_fraction_0 (float) –
  • descartes_version (str) –
  • directory (str) – Subdirectory location.
  • duration (float) –
  • duration_days (int) –
  • earth_sun_distance (float) – Earth sun distance at time of image capture.
  • files (list(str)) – Names of the files this image is stored in.
  • file_md5s (list(str)) – File integrity checksums.
  • file_sizes (list(int)) – Number of bytes of each file
  • fill_fraction (float) – Fraction of this image which has data.
  • geolocation_accuracy (float) –
  • geometry (str|dict) – GeoJSON representation of the image coverage.
  • geotrans (float) – Geographic Translator values.
  • gpt_time (float) –
  • identifier (str) – Vendor scene identifier.
  • ifg_tdelta_days (int) –
  • incidence_angle (float) – Sensor incidence angle.
  • pass (str) – On which pass was this image taken.
  • processed (str) – Date which this image was processed.
  • proj4 (str) – proj.4 transformation parameters
  • projcs (str) – Projection coordinate system.
  • published (str) – Date the image was published.
  • radiometric_version (str) –
  • raster_size (list(int)) – Dimensions of image in pixels (width, height).
  • reflectance_scale (list(float)) – Scale factors converting TOA radiances to TOA reflectances
  • reflectance_scale_1 (list(float)) –
  • relative_orbit (int) – Orbit number in revisit cycle.
  • roll_angle (float) –
  • safe_id (str) – Standard Archive Format for Europe.
  • sat_id (str) – Satellite identifier.
  • scan_gap_interpolation (float) –
  • solar_azimuth_angle (float) –
  • solar_azimuth_angle_0 (float) –
  • solar_azimuth_angle_1 (float) –
  • solar_elevation_angle (float) –
  • solar_elevation_angle_0 (float) –
  • solar_elevation_angle_1 (float) –
  • tile_id (str) –
  • view_angle (float) –
  • view_angle_1 (float) –
Returns:

JSON API representation of the image.

Return type:

dict

change_product(product_id, add_namespace=False, set_global_permissions=False, **kwargs)[source]

Update a product to your catalog.

Parameters:
  • product_id (str) – (Required) The ID of the product to change.
  • read (list(str)) – A list of groups, or user hashes to give read access to.
  • spectral_bands (int) – Number of spectral bands the product has.
  • native_bands (list(str)) – A list of the names of the native bands of this product (most applicable to satellite sensors).
  • add_namespace (bool) – Add your user namespace to the product_id. Deprecated
  • set_global_permissions (bool) – Update permissions of all existing bands and products that belong to this product with the updated permission set specified in the read param. Default to false.
  • start_datetime (str) – ISO8601 compliant date string, indicating start of product data.
  • end_datetime (str) – ISO8601 compliant date string, indicating end of product data.
  • title (str) – Official product title.
  • description (str) – Information about the product, why it exists, and what it provides.
  • notes (str) – Any notes to relay about the product.
  • orbit (str) – Type of orbit (satellite only).
  • processing_level (str) – Way in which raw data has been processed if any.
  • resolution (str) – Pixel density of the data, provide units.
  • revisit (str) – How often an AOI can expect updated data.
  • sensor (str) – Name of the sensor used.
  • swath (str) – How large an area the sensor captures at a given time.
Returns:

JSON API representation of the product.

Return type:

dict

get_band(product_id, name, add_namespace=False)[source]

Get a band by name.

Returns:JSON API representation of the band.
Return type:dict
get_image(product_id, image_id, add_namespace=False)[source]

Get a single image metadata entry.

Returns:JSON API representation of the image.
Return type:dict
get_product(product_id, add_namespace=False)[source]
iter_upload_results(product_id, status=None, updated=None, created=None)[source]

Get result information for debugging your uploads.

Parameters:
  • product_id (str) – Product ID to get upload results for.
  • status (str) – Filter results by status, values are [“SUCCESS”, “FAILURE”]
  • updated (str|int) – Unix timestamp or ISO8601 formatted date for filtering results updated after this time.
  • created (str|int) – Unix timestamp or ISO8601 formatted date for filtering results created after this time.
Returns:

iterator to upload results.

Return type:

generator

namespace_product(product_id)[source]
own_bands()[source]
own_products()[source]
product_deletion_status(deletion_task_id)[source]

Get the status of a long running product deletion job.

Parameters:deletion_task_id (str) – deletion_task ID returned from a call to Catalog.remove_product() with a deletion_token.
Returns:document with information about product deletion progress.
Return type:dict
remove_band(product_id, name, add_namespace=False)[source]
remove_image(product_id, image_id, add_namespace=False)[source]
remove_product(product_id, add_namespace=False, cascade=False)[source]

Remove a product from the catalog.

Parameters:
  • product_id (str) – ID of the product to remove.
  • cascade (bool) – Force deletion of all the associated bands and images. BEWARE this cannot be undone.
replace_band(product_id, name, srcband=None, dtype=None, nbits=None, data_range=None, add_namespace=False, type=None, **kwargs)[source]

Replaces an existing data band with a new document.

Parameters:
  • product_id (str) – (Required) Product to which this band will belong.
  • name (str) – (Required) Name of this band.
  • add_namespace (bool) – Add your user namespace to the product_id. Deprecated
  • jpx_layer (int) – If data is processed to JPEG2000, which layer is the band in. Defaults to 0.
  • srcband (int) – (Required) The 1-based index of the band in the jpx_layer specified.
  • srcfile (int) – If the product was processed into multiple files, which one is this in. Defaults to 0 (first file).
  • dtype (str) – (Required) The data type used to store this band e.g Byte or Uint16 or Float32.
  • nbits (int) – (Required) The number of bits of the dtype used to store this band.
  • data_range (list(int)) – (Required) A list specifying the min and max values for the data in this band.
  • type (str) – (Required) The data interpretation of the band. One of [‘spectral’, ‘derived’, ‘mask’, ‘class’]
  • nodata (int) – Pixel value indicating no data available.
  • read (list(str)) – A list of groups, or user hashes to give read access to. Defaults to the same as the parent product if not specified.
  • color (str) – The color interpretation of this band. One of [‘Alpha’, ‘Black’, ‘Blue’, ‘Cyan’, ‘Gray’, ‘Green’, ‘Hue’, ‘Ligntness’, ‘Magenta’, ‘Palette’, ‘Red’, ‘Saturation’, ‘Undefined’, ‘YCbCr_Cb’, ‘YCbCr_Cr’, ‘YCbCr_Y’, ‘Yellow’]. Must be ‘Alpha’ if type is ‘mask’. Must be ‘Palette’ if colormap_name or colormap is set.
  • colormap_name (str) – A named colormap to use for this band, one of [‘plasma’, ‘magma’, ‘viridis’, ‘msw’, ‘inferno’]
  • colormap (list(list(str))) – A custom colormap to use for this band. Takes a list of lists, where each nested list is a 4-tuple of rgba values to map pixels whose value is the index of the tuple. i.e the colormap [[“100”, “20”, “200”, “255”]] would map pixels whose value is 0 in the original band, to the rgba color vector at colormap[0]. Less than 2^nbits 4-tuples may be provided, and omitted values will default map to black.
  • data_description (str) – Description of band data.
  • physical_range (list(float)) – If band represents a physical value e.g reflectance or radiance what are the possible range of those values.
  • data_unit (str) – Units of the physical range e.g w/sr for radiance
  • data_unit_description (str) – Description of the data unit.
  • default_range (list(int)) – A good default scale for the band to use when rastering for display purposes.
  • description (str) – Description of the band.
  • name_common (str) – Standard name for band
  • name_vendor (str) – What the vendor calls the band eg. B1
  • vendor_order (int) – The index of the band in the vendors band tables. Useful for referencing the band to other processing properties like surface reflectance.
  • processing_level (str) – Description of how the band was processed if at all.
  • res_factor (int) – Scaling of this band relative to the native band resolution.
  • resolution (int) – Resolution of this band.
  • resolution_unit (str) – Unit of the resolution.
  • wavelength_center (float) – Center position of wavelength.
  • wavelength_fwhm (float) – Full width at half maximum value of the wavelength spread.
  • wavelength_min (float) – Minimum wavelength this band is sensitive to.
  • wavelength_max (float) – Maximum wavelength this band is sensitive to.
  • wavelength_unit (str) – Units the wavelength is expressed in.
Returns:

JSON API representation of the band.

Return type:

dict

replace_image(product_id, image_id, add_namespace=False, **kwargs)[source]

Replace image metadata with a new version.

Parameters:
  • product_id (str) – (Required) Product to which this image belongs.
  • image_id (str) – (Required) ID of the image to replace.
  • add_namespace (bool) – Add your user namespace to the product_id. Deprecated
  • read (list(str)) – A list of groups, or user hashes to give read access to. Defaults to the same as the parent product if not specified.
  • absolute_orbit (int) – Orbit number since mission start.
  • acquired (str) – Date the imagery was acquired
  • archived (str) – Date the imagery was archived.
  • area (float) – Surface area the image covers
  • azimuth_angle (float) –
  • azimuth_angle_1 (float) –
  • bits_per_pixel (list(float)) – Average bits of data per pixel.
  • bright_fraction (float) – Fraction of the image that has reflectance greater than .4 in the blue band.
  • bucket (str) – Name of Google Cloud Bucket. Must be public bucket or Descartes Labs user bucket.
  • catalog_id (str) –
  • cirrus_fraction (float) – Fraction of pixel which are distorted by cirrus clouds.
  • cloud_fraction (float) – Fraction of pixels which are obscured by clouds.
  • cloud_fraction_0 (float) – Fraction of pixels which are obscured by clouds.
  • cs_code (str) – Spatial coordinate system code eg. EPSG:4326
  • datastrip_id – ID of the data strip this image was taken in.
  • degraded_fraction_0 (float) –
  • descartes_version (str) –
  • directory (str) – Subdirectory location.
  • duration (float) –
  • duration_days (int) –
  • earth_sun_distance (float) – Earth sun distance at time of image capture.
  • files (list(str)) – Names of the files this image is stored in.
  • file_md5s (list(str)) – File integrity checksums.
  • file_sizes (list(int)) – Number of bytes of each file
  • fill_fraction (float) – Fraction of this image which has data.
  • geolocation_accuracy (float) –
  • geometry (str|dict) – GeoJSON representation of the image coverage.
  • geotrans (float) – Geographic Translator values.
  • gpt_time (float) –
  • identifier (str) – Vendor scene identifier.
  • ifg_tdelta_days (int) –
  • incidence_angle (float) – Sensor incidence angle.
  • pass (str) – On which pass was this image taken.
  • processed (str) – Date which this image was processed.
  • proj4 (str) – proj.4 transformation parameters
  • projcs (str) – Projection coordinate system.
  • published (str) – Date the image was published.
  • radiometric_version (str) –
  • raster_size (list(int)) – Dimensions of image in pixels in (width, height).
  • reflectance_scale (list(float)) – Scale factors converting TOA radiances to TOA reflectances
  • reflectance_scale_1 (list(float)) –
  • relative_orbit (int) – Orbit number in revisit cycle.
  • roll_angle (float) –
  • safe_id (str) – Standard Archive Format for Europe.
  • sat_id (str) – Satellite identifier.
  • scan_gap_interpolation (float) –
  • solar_azimuth_angle (float) –
  • solar_azimuth_angle_0 (float) –
  • solar_azimuth_angle_1 (float) –
  • solar_elevation_angle (float) –
  • solar_elevation_angle_0 (float) –
  • solar_elevation_angle_1 (float) –
  • tile_id (str) –
  • view_angle (float) –
  • view_angle_1 (float) –
Returns:

JSON API representation of the image.

Return type:

dict

replace_product(product_id, title, description, add_namespace=False, set_global_permissions=False, **kwargs)[source]

Replace a product in your catalog with a new version.

Parameters:
  • product_id (str) – (Required) A unique name for this product.
  • title (str) – (Required) Official product title.
  • description (str) – (Required) Information about the product, why it exists, and what it provides.
  • add_namespace (bool) – Add your user namespace to the product_id. Deprecated
  • read (list(str)) – A list of groups, or user hashes to give read access to.
  • spectral_bands (int) – Number of spectral bands the product has.
  • native_bands (list(str)) – A list of the names of the native bands of this product (most applicable to satellite sensors).
  • start_datetime (str) – ISO8601 compliant date string, indicating start of product data.
  • end_datetime (str) – ISO8601 compliant date string, indicating end of product data.
  • notes (str) – Any notes to relay about the product.
  • orbit (str) – Type of orbit (satellite only).
  • processing_level (str) – Way in which raw data has been processed if any.
  • resolution (str) – Pixel density of the data, provide units.
  • revisit (str) – How often an AOI can expect updated data.
  • sensor (str) – Name of the sensor used.
  • swath (str) – How large an area the sensor captures at a given time.
Returns:

JSON API representation of the product.

Return type:

dict

upload_image(files, product_id, metadata=None, multi=False, image_id=None, **kwargs)[source]

Upload an image for a product you own.

Parameters:
  • files (str|file|list(str)|list(file)) – (Required) a reference to the file to upload.
  • product_id (str) – (Required) The id of the product this image belongs to.
  • metadata (dict) – Image metadata to use instead of the computed default values.
  • **kwargs – All image metadata can also be passed as kwargs, see Catalog.add_image() for allowed fields.
upload_ndarray(ndarray, product_id, image_id, proj4=None, wkt_srs=None, geotrans=None, raster_meta=None, overviews=None, overview_resampler=None, **kwargs)[source]

Upload an ndarray with georeferencing information.

Parameters:
  • ndarray (ndarray) – (Required) A numpy ndarray with image data. If you are providing a multi-band image it should have 3 dimensions and the 3rd dimension of the array should index the bands. The dtype of the ndarray must also be one of the following: [‘uint8’, ‘int8’, ‘uint16’, ‘int16’, ‘uint32’, ‘int32’, ‘float32’, ‘float64’]
  • product_id (str) – (Required) The id of the product this image belongs to.
  • image_id (str) – (Required) Resulting image’s id = <product_id>:<image_id>.
  • proj4 (str) – (One of proj4 or wkt_srs is required) A proj4 formatted string representing the spatial reference system used by the image.
  • wkt_srs (str) – (One of proj4 or wkt_srs is required) A well known text string representing the spatial reference system used by the image.
  • geotrans (list(float)) – (Required) The 6 number geographic transform of the image. Maps pixel coordinates to coordinates in the specified spatial reference system.
  • raster_meta (dict) – Metadata returned from the descarteslabs.client.services.raster.Raster.ndarray() request which generated the initial data for the :param ndarray: being uploaded. Passing :param geotrans: and :param wkt_srs: is unnecessary in this case.
  • overviews (list(int)) – a list of overview resolution magnification factors i.e [2, 4] would make two overviews at 2x and 4x the native resolution. Maximum number of overviews allowed is 16.
  • overview_resampler (str) – Resampler algorithm to use when building overviews. Controls how pixels are combined to make lower res pixels in overviews. Allowed resampler algorithms are: [‘nearest’, ‘average’, ‘gauss’, ‘cubic’, ‘cubicspline’, ‘lanczos’, ‘average_mp’, ‘average_magphase’, ‘mode’].
  • **kwargs – Metadata for the new image; see Catalog.add_image() for allowed fields.

Note

Only one of proj4 or wkt_srs can be provided.

upload_result(product_id, upload_id)[source]

Get one upload result with the processing logs.

This is useful for debugging failed uploads. :param str product_id: Product ID to get upload result for. :param str upload_id: ID of specific upload to get a result record of, includes the run logs.

Returns:One upload result with run logs.
Return type:dict
upload_results(product_id, limit=100, offset=None, status=None, updated=None, created=None, continuation_token=None)[source]

Get result information for debugging your uploads.

Parameters:
  • product_id (str) – Product ID to get upload results for.
  • limit (int) – Number of results to get, useful for paging.
  • offset (int) – Start of results to get, useful for paging.
  • status (str) – Filter results by status, values are [“SUCCESS”, “FAILURE”]
  • updated (str|int) – Unix timestamp or ISO8601 formatted date for filtering results updated after this time.
  • created (str|int) – Unix timestamp or ISO8601 formatted date for filtering results created after this time.
Returns:

A list of upload result objects.

Return type:

list

TIMEOUT = (9.5, 30)
UPLOAD_NDARRAY_SUPPORTED_DTYPES = ['uint8', 'int8', 'uint16', 'int16', 'uint32', 'int32', 'float32', 'float64']