Product

Classes

descarteslabs.catalog.Product

Data Types

TaskStatus

DeletionTaskStatus

UpdatePermissionsTaskStatus

TaskState


class Product(**kwargs)[source]

A raster product that connects band information to imagery.

Parameters

kwargs (dict) – With the exception of readonly attributes (created, modified), any (inherited) attribute listed below can also be used as a keyword argument.

Methods

bands()

A search query for all bands for this product, sorted by default band sort_order.

delete_related_objects()

Delete all related bands and images for this product.

derived_bands()

A search query for all derived bands associated with this product.

get_delete_status()

Fetches the status of a deletion task.

get_update_permissions_status()

Fetches the status of an update task.

image_uploads()

A search query for all uploads in this product created by this user.

images()

A search query for all images in this product.

namespace_id(id_[, client])

Generate a fully namespaced id.

update_related_objects_permissions([owners, …])

Update the owners, readers, and/or writers for all related bands and images.

Attributes

is_core

Inheritance

For inherited parameters, methods, attributes, and properties, please refer to the base class:


name

Required: The name of this product. Sortable.

Type

str

description

A description with further details on this product.

Type

str

start_datetime

The beginning of the mission for this product. Filterable, sortable.

Type

str, datetime-like

end_datetime

The end of the mission for this product. Filterable, sortable.

Type

str, datetime-like

is_core

Whether this is a Descartes Labs catalog core product, which means that the product is fully supported by Descartes Labs. Filterable, sortable.

Type

bool

revisit_period_minutes_min

Minimum length of the time interval between observations of any given area in minutes. Filterable, sortable.

Type

float

revisit_period_minutes_max

Maxiumum length of the time interval between observations of any given area in minutes. Filterable, sortable.

Type

float

resolution_min

Minimum resolution of the bands for this product. If applying a filter with a plain unitless number the value is assumed to be in meters. Filterable, sortable.

Type

Resolution

resolution_max

Maximum resolution of the bands for this product. If applying a filter with a plain unitless number the value is assumed to be in meters. Filterable, sortable.

Type

Resolution

bands()[source]

A search query for all bands for this product, sorted by default band sort_order.

Returns

A Search instance configured to find all bands for this product.

Return type

Search

Delete all related bands and images for this product.

Starts an asynchronous operation that deletes all bands and images associated with this product. If the product has a large number of associated images, this operation could take several minutes, or even hours.

Returns

Returns :py:class`DeletionTaskStatus` if deletion task was successfully started and None if there were no related objects to delete.

Return type

DeletionTaskStatus

Raises

ConflictError – If a deletion process is already in progress.

derived_bands()[source]

A search query for all derived bands associated with this product.

Returns

A Search instance configured to find all derived bands for this product.

Return type

Search

get_delete_status()[source]

Fetches the status of a deletion task.

Fetches the status of a deletion task started using delete_related_objects().

Returns

Return type

DeletionTaskStatus

get_update_permissions_status()[source]

Fetches the status of an update task.

Fetches the status of an update task started using update_related_objects_permissions().

Returns

Return type

UpdatePermissionsTaskStatus

Example

>>> product = Product.get('product-id')
>>> product.update_related_objects_permissions()
>>> product.get_update_permissions_status()
image_uploads()[source]

A search query for all uploads in this product created by this user.

Returns

A Search instance configured to find all uploads in this product.

Return type

Search

images()[source]

A search query for all images in this product.

Returns

A Search instance configured to find all images in this product.

Return type

Search

classmethod namespace_id(id_, client=None)[source]

Generate a fully namespaced id.

Parameters
  • id_ (str) – The unprefixed part of the id that you want prefixed.

  • client (CatalogClient, optional) – A CatalogClient instance to use for requests to the Descartes Labs catalog. The get_default_client() will be used if not set.

Returns

The fully namespaced id.

Return type

str

Example

>>> product_id = Product.namespace_id("my-product")

Update the owners, readers, and/or writers for all related bands and images.

Starts an asynchronous operation that updates the owners, readers, and/or writers of all bands and images associated with this product. If the product has a large number of associated images, this operation could take several minutes, or even hours.

Parameters
  • owners (list(str)) –

  • readers (list(str)) –

  • writers (list(str)) –

  • inherit (Whether to inherit the values from the product for owners, readers,) – and/or writers that have not been set in this request. By default, this value is False and if an ACL is not set, it is not changed. When set to True, and the ACL is not set, it is inherited from the product.

Returns

Returns :py:class`UpdatePermissionsTaskStatus` if update task was successfully started and None if there were no related objects to update.

Return type

UpdatePermissionsTaskStatus

Raises

ConflictError – If an update task is already in progress.

is_core
class TaskStatus(id=None, status=None, start_datetime=None, duration_in_seconds=None, errors=None, _client=None, **kwargs)[source]

A base class for the status of asynchronous jobs.

wait_for_completion(timeout=None)[source]

Wait for the task to complete.

Parameters

timeout (int, optional) – If specified, will wait up to specified number of seconds and will raise a concurrent.futures.TimeoutError if the task has not completed.

Raises

concurrent.futures.TimeoutError – If the specified timeout elapses and the task has not completed

class DeletionTaskStatus(objects_deleted=None, **kwargs)[source]

The asynchronous deletion task’s status

Inheritance

For inherited parameters, methods, attributes, and properties, please refer to the base class:


product_id

The id of the product for which this task is running.

Type

str

status

The state of the task as explained in TaskState.

Type

TaskState

start_datetime

The date and time at which the task started running.

Type

datetime

duration_in_seconds

The duration of the task.

Type

float

objects_deleted

The number of object (a combination of bands or images) that were deleted.

Type

int

errors

In case the status is FAILED this will contain a list of errors that were encountered. In all other states this will not be set.

Type

list

class UpdatePermissionsTaskStatus(objects_updated=None, **kwargs)[source]

The asynchronous task status for updating related objects’ access control permissions

Inheritance

For inherited parameters, methods, attributes, and properties, please refer to the base class:


product_id

The id of the product for which this task is running.

Type

str

status

The state of the task as explained in TaskState.

Type

TaskState

start_datetime

The date and time at which the task started running.

Type

datetime

duration_in_seconds

The duration of the task.

Type

float

objects_updated

The number of object (a combination of bands or images) that were updated.

Type

int

errors

In case the status is FAILED this will contain a list of errors that were encountered. In all other states this will not be set.

Type

list

class TaskState[source]
NEVERRAN

The operation was never invoked.

Type

enum

RUNNING

The operation is in progress.

Type

enum

SUCCEEDED

The operation was successfully completed.

Type

enum

FAILED

The operation resulted in a failure and may not have been completed.

Type

enum