pystac.extensions.eo#
Implements the Electro-Optical Extension.
- class pystac.extensions.eo.AssetEOExtension(asset: pystac.asset.Asset)[source]#
Bases:
pystac.extensions.eo.EOExtension
[pystac.asset.Asset
]A concrete implementation of
EOExtension
on anAsset
that extends the Asset fields to include properties defined in the Electro-Optical Extension.This class should generally not be instantiated directly. Instead, call
EOExtension.ext()
on anAsset
to extend it.
- class pystac.extensions.eo.Band(properties: Dict[str, Any])[source]#
Bases:
object
Represents Band information attached to an Item that implements the eo extension.
Use
Band.create()
to create a new Band.- apply(name: str, common_name: Optional[str] = None, description: Optional[str] = None, center_wavelength: Optional[float] = None, full_width_half_max: Optional[float] = None, solar_illumination: Optional[float] = None) None [source]#
Sets the properties for this Band.
- Parameters
name – The name of the band (e.g., “B01”, “B02”, “B1”, “B5”, “QA”).
common_name – The name commonly used to refer to the band to make it easier to search for bands across instruments. See the list of accepted common names.
description – Description to fully explain the band.
center_wavelength – The center wavelength of the band, in micrometers (μm).
full_width_half_max – Full width at half maximum (FWHM). The width of the band, as measured at half the maximum transmission, in micrometers (μm).
solar_illumination – The solar illumination of the band, as measured at half the maximum transmission, in W/m2/micrometers.
- static band_description(common_name: str) Optional[str] [source]#
Returns a description of the band for one with a common name.
- Parameters
common_name – The common band name. Must be one of the list of accepted common names.
- Returns
If a recognized common name, returns a description including the band range. Otherwise returns None.
- Return type
str or None
- static band_range(common_name: str) Optional[Tuple[float, float]] [source]#
Gets the band range for a common band name.
- Parameters
common_name – The common band name. Must be one of the list of accepted common names.
- Returns
The band range for this name as (min, max), or None if this is not a recognized common name.
- Return type
- property center_wavelength: Optional[float]#
Get or sets the center wavelength of the band, in micrometers (μm).
- Returns
float
- property common_name: Optional[str]#
- Get or sets the name commonly used to refer to the band to make it easier
to search for bands across instruments. See the list of accepted common names.
- Returns
Optional[str]
- classmethod create(name: str, common_name: Optional[str] = None, description: Optional[str] = None, center_wavelength: Optional[float] = None, full_width_half_max: Optional[float] = None, solar_illumination: Optional[float] = None) pystac.extensions.eo.Band [source]#
Creates a new band.
- Parameters
name – The name of the band (e.g., “B01”, “B02”, “B1”, “B5”, “QA”).
common_name – The name commonly used to refer to the band to make it easier to search for bands across instruments. See the list of accepted common names.
description – Description to fully explain the band.
center_wavelength – The center wavelength of the band, in micrometers (μm).
full_width_half_max – Full width at half maximum (FWHM). The width of the band, as measured at half the maximum transmission, in micrometers (μm).
solar_illumination – The solar illumination of the band, as measured at half the maximum transmission, in W/m2/micrometers.
- property description: Optional[str]#
Get or sets the description to fully explain the band. CommonMark 0.29 syntax MAY be used for rich text representation.
- Returns
str
- property full_width_half_max: Optional[float]#
- Get or sets the full width at half maximum (FWHM). The width of the band,
as measured at half the maximum transmission, in micrometers (μm).
- Returns
[float]
- property name: str#
Get or sets the name of the band (e.g., “B01”, “B02”, “B1”, “B5”, “QA”).
- Returns
str
- class pystac.extensions.eo.EOExtension(*args, **kwds)[source]#
Bases:
Generic
[pystac.extensions.eo.T
],pystac.extensions.base.PropertiesExtension
,pystac.extensions.base.ExtensionManagementMixin
[Union
[pystac.collection.Collection
,pystac.item.Item
]]An abstract class that can be used to extend the properties of an
Item
orAsset
with properties from the Electro-Optical Extension. This class is generic over the type of STAC Object to be extended (e.g.Item
,Asset
).To create a concrete instance of
EOExtension
, use theEOExtension.ext()
method. For example:>>> item: pystac.Item = ... >>> eo_ext = EOExtension.ext(item)
- apply(bands: Optional[List[pystac.extensions.eo.Band]] = None, cloud_cover: Optional[float] = None) None [source]#
Applies Electro-Optical Extension properties to the extended
Item
orAsset
.- Parameters
bands – A list of available bands where each item is a
Band
object. If given, requires at least one band.cloud_cover – The estimate of cloud cover as a percentage (0-100) of the entire scene. If not available the field should not be provided.
- property bands: Optional[List[pystac.extensions.eo.Band]]#
Gets or sets a list of available bands where each item is a
Band
object (orNone
if no bands have been set). If not available the field should not be provided.
- property cloud_cover: Optional[float]#
Get or sets the estimate of cloud cover as a percentage (0-100) of the entire scene. If not available the field should not be provided.
- Returns
float or None
- classmethod ext(obj: pystac.extensions.eo.T, add_if_missing: bool = False) pystac.extensions.eo.EOExtension[pystac.extensions.eo.T] [source]#
Extends the given STAC Object with properties from the Electro-Optical Extension.
This extension can be applied to instances of
Item
orAsset
.- Raises
pystac.ExtensionTypeError – If an invalid object type is passed.
- properties: Dict[str, Any]#
The properties that this extension wraps.
The extension which implements PropertiesExtension can use
_get_property
and_set_property
to get and set values on this instance. Note that _set_properties mutates the properties directly.
- classmethod summaries(obj: pystac.collection.Collection, add_if_missing: bool = False) pystac.extensions.eo.SummariesEOExtension [source]#
Returns the extended summaries object for the given collection.
- class pystac.extensions.eo.EOExtensionHooks[source]#
Bases:
pystac.extensions.hooks.ExtensionHooks
- migrate(obj: Dict[str, Any], version: pystac.serialization.identify.STACVersionID, info: pystac.serialization.identify.STACJSONDescription) None [source]#
Migrate a STAC Object in dict format from a previous version. The base implementation will update the stac_extensions to the latest schema ID. This method will only be called for STAC objects that have been identified as a previous version of STAC. Implementations should directly manipulate the obj dict. Remember to call super() in order to change out the old ‘stac_extension’ entry with the latest schema URI.
- prev_extension_ids = {'eo'}#
- stac_object_types = {STACObjectType.ITEM}#
- class pystac.extensions.eo.ItemEOExtension(item: pystac.item.Item)[source]#
Bases:
pystac.extensions.eo.EOExtension
[pystac.item.Item
]A concrete implementation of
EOExtension
on anItem
that extends the properties of the Item to include properties defined in the Electro-Optical Extension.This class should generally not be instantiated directly. Instead, call
EOExtension.ext()
on anItem
to extend it.- item: pystac.item.Item#
The
Item
being extended.
- class pystac.extensions.eo.SummariesEOExtension(collection: pystac.collection.Collection)[source]#
Bases:
pystac.extensions.base.SummariesExtension
A concrete implementation of
SummariesExtension
that extends thesummaries
field of aCollection
to include properties defined in the Electro-Optical Extension.- property bands: Optional[List[pystac.extensions.eo.Band]]#
Get or sets the summary of
EOExtension.bands
values for this Collection.
- property cloud_cover: Optional[pystac.summaries.RangeSummary[float]]#
Get or sets the summary of
EOExtension.cloud_cover
values for this Collection.
- summaries: pystac.summaries.Summaries#
The summaries for the
Collection
being extended.