Search¶
-
get_band
(band_id)[source]¶ Get information about a single band.
Parameters: band_id (str) – A band identifier. Returns: A dictionary of metadata for the band Return type: DotDict Raises: NotFoundError – Raised if a band id cannot be found.
-
get_derived_band
(derived_band_id)[source]¶ Get information about a single derived band.
Parameters: - derived_band_id (str) – Derived band identifier.
- metadata_client (Metadata, optional) – Unneeded in general use; lets you use a specific client instance with non-default auth and parameters.
Returns: A dictionary with metadata for a single derived band.
Return type: Raises: NotFoundError – Raised if a band id cannot be found.
-
get_product
(product_id)[source]¶ Retrieve information about a single product.
Parameters: product_id (str) – Product Identifier. Returns: A dictionary with metadata for a single product. Return type: DotDict Raises: NotFoundError – Raised if a product id cannot be found.
-
search
(aoi, products, start_datetime=None, end_datetime=None, cloud_fraction=None, storage_state=None, limit=100, sort_field='acquired', sort_order='asc', date_field='acquired', query=None)[source]¶ Search for Scenes in the Descartes Labs catalog.
Returns a SceneCollection of Scenes that overlap with an area of interest, and meet the given search criteria.
Parameters: - aoi (GeoJSON-like dict,
GeoContext
, or object with __geo_interface__) – Search for scenes that intersect this area by any amount. If aGeoContext
, a copy is returned asctx
, with missing values filled in. Otherwise, the returnedctx
will be anAOI
, with this as its geometry. - products (str or List[str]) – Descartes Labs product identifiers. May not be empty.
- start_datetime (str, datetime-like, optional) – Restrict to scenes acquired after this datetime
- end_datetime (str, datetime-like, optional) – Restrict to scenes acquired before this datetime
- cloud_fraction (float, optional) – Restrict to scenes that are covered in clouds by less than this fraction (between 0 and 1)
- storage_state (str, optional) – Filter results based on
storage_state
value ("available"
,"remote"
, orNone
) - limit (int or None, optional, default 100) – Maximum number of Scenes to return, or None for all results.
- sort_field (str, optional, default 'acquired') – Field name in
Scene.properties
by which to order the results - sort_order (str, optional, default 'asc') –
"asc"
or"desc"
- date_field (str, optional, default 'acquired') – The field used when filtering by date
(
"acquired"
,"processed"
,"published"
) - query (Expression, optional) – Expression used to filter Scenes by their properties, built from
dl.properties
. You can construct filter expression using the==
,!=
,<
,>
,<=
and>=
operators as well as thelike()
andin_()
methods. You cannot use the boolean keywordsand
andor
because of Python language limitations; instead you can combine filter expressions with&
(boolean “and”) and|
(boolean “or”). Example:150 < dl.properties.azimuth_angle < 160 & dl.properties.cloud_fraction < 0.5
- randomize (bool, default False, optional) – Randomize the order of the results. You may also use an int or str as an explicit seed.
Returns: scenes (
SceneCollection
) – Scenes matching your criteria.ctx (
GeoContext
) – The givenaoi
as aGeoContext
(if it isn’t one already), with reasonable default parameters for loading all matching Scenes.If
aoi
was aGeoContext
,ctx
will be a copy ofaoi
, with any properties that wereNone
assigned the defaults below.If
aoi
was not aGeoContext
, anAOI
instance will be created withaoi
as its geometry, and defaults assigned as described below:Default Spatial Parameters:
- resolution: the finest resolution of any band of all matching scenes
- crs: the most common CRS used of all matching scenes
- aoi (GeoJSON-like dict,
-
search_bands
(products, limit=None, wavelength=None, resolution=None, tags=None)[source]¶ Search for imagery data bands that you have access to.
Parameters: - products (list(str)) – A list of product(s) to return bands for. May not be empty.
- limit (int, optional) – Number of results to return.
- wavelength (float, optional) – A wavelength in nm e.g 700 that the band sensor must measure.
- resolution (int, optional) – The resolution in meters per pixel e.g 30 of the data available in this band.
- tags (list(str), optional) – A list of tags to match. Any band which has any of these tags will be included.
Returns: List of dicts containing at most
limit
bands. Empty if there are no bands matching query (e.g. product id not available).Return type:
-
search_derived_bands
(bands, require_bands=None, limit=None)[source]¶ Search for predefined derived bands that you have access to.
Parameters: - bands (list(str)) – Limit the derived bands to ones that can be computed using this list of spectral bands. e.g [“red”, “nir”, “swir1”]
- require_bands (bool) – Control whether searched bands must contain all the spectral bands passed in the bands param. Defaults to False.
- limit (int) – Number of results to return.
Returns: List of dicts containing at most
limit
bands.Return type:
-
search_products
(limit=None, owner=None, text=None)[source]¶ Search products that are available on the platform. An empty search with no parameters will pass back all available products.
Parameters: - limit (int, optional) – Number of results to return.
- owner (str, optional) – Filter products by the owner’s uuid.
- text (str, optional) – Filter products by string match.
Returns: List of dicts containing at most
limit
products. Empty if no matching products are found.Return type: