Run advanced processing on tasking and catalog data in your storage.
A class for job templates that define the process ID and input validation logic.
Attributes
| Attribute | Description |
|---|---|
process_id | ClassVar[str] The process ID in a name format. |
workspace_id | Union[str, base.WorkspaceId] The workspace ID. |
errors | set[ValidationError] A list of errors populated if the job isn’t valid. |
Properties
Checks if the job is valid. Returns bool:
True: The job is valid.False: The job isn’t valid.
from up42 import processing_templates
# Select an itemstac_item_id = "68567134-27ad-7bd7-4b65-d61adb11fc78"
# Get the item from the STAC clientstac_client = up42.stac_client()stac_item = next(stac_client.get_items(stac_item_id))
# Instanitate a DetectionTreesSpacept templatejob_template = processing_templates.DetectionTreesSpacept( title="Detect trees over UK", item=stac_item,)
# Assert that the job is valid, print errors if notif not job_template.is_valid: for error in job_template.errors: print(f"{error}\n")Methods
This action can’t be done with the Viewer role.
Executes the job. Returns Job.
from up42 import processing_templates
# Select an item11 collapsed lines
stac_item_id = "68567134-27ad-7bd7-4b65-d61adb11fc78"
# Get the item from the STAC clientstac_client = up42.stac_client()stac_item = next(stac_client.get_items(stac_item_id))
# Instanitate a DetectionTreesSpacept templatejob_template = processing_templates.DetectionTreesSpacept( title="Detect trees over UK", item=stac_item,)
# Execute the templated jobjob = job_template.execute()
# Define outputprint(f"Job details for ID: {job.id}")print(f"Process ID: {job.process_id}")print(f"Status: {job.status.value}")print(f"Price: {job.credits or 'N/A'} credits")print(f"Created at: {job.created}")A data class for the process templates that require one STAC item as input. Extends the JobTemplate class.
Attributes
| Attribute | Description |
|---|---|
title | str The title of the output objects: STAC item and STAC collection. |
item | pystac.Item The STAC item to process. |
from up42 import processing_templates
# Select an itemstac_item_id = "68567134-27ad-7bd7-4b65-d61adb11fc78"
# Get the item from the STAC clientUP42_client = up42.stac_client()stac_item = next(UP42_client.get_items(stac_item_id))
# Instanitate a DetectionTreesSpacept templatejob_template = processing_templates.DetectionTreesSpacept( title="Detect trees over UK", item=stac_item,)Subclasses
| Class name | Process ID | Process |
|---|---|---|
DetectionAircraftOI | detection-aircraft-oi | Aircraft detection |
DetectionBuildingsSpacept | detection-buildings-spacept | Building detection |
DetectionCarsOI | detection-cars-oi | Car detection |
DetectionShadowsSpacept | detection-shadows-spacept | Shadow detection |
DetectionShipsAirbus | detection-ships-airbus | Ship detection |
DetectionStorageTanksAirbus | detection-storage-tanks-airbus | Storage tank detection |
DetectionTreesSpacept | detection-trees-spacept | Tree detection |
DetectionTrucksOI | detection-trucks-oi | Truck detection |
DetectionWindTurbinesAirbus | detection-wind-turbines-airbus | Wind turbine detection |
Has more attributes, see its class. | pansharpening | Pansharpening |
TrueColorConversion | true-color-conversion | True color conversion |
UpsamplingNS | upsampling-ns | Upsampling |
UpsamplingNSSentinel | upsampling-ns-sentinel | Upsampling (Sentinel-2) |
A data class for the process templates that require multiple STAC items as input. Extends the JobTemplate class.
Atributes
| Attribute | Description |
|---|---|
title | str The title of the resulting objects: STAC item and STAC collection. |
items | List[pystac.Item] The STAC items to process. |
A data class that represents a template for the Simularity processes. Extends the JobTemplate class.
Attributes
| Attribute | Description |
|---|---|
title | str The title of the output objects: STAC item and STAC collection. |
source_item | pystac.Item The source STAC item. |
reference_item | pystac.Item The reference STAC item. The positional accuracy of the source image will be improved against this reference. |
from up42 import processing_templates
# Select multiple itemssource_item_id = "68567134-27ad-7bd7-4b65-d61adb11fc78"reference_item_id = "c3de9ed8-f6e5-4bb5-a157-f6430ba756da"
# Get the items from the STAC clientUP42_client = up42.UP42_client()source_item = UP42_client.get_item(source_item_id)reference_item = UP42_client.get_item(reference_item_id)
# Instantiate a CoregistrationSimularity templatejob_template = processing_templates.CoregistrationSimularity( title="Coregistration for images", source_item=source_item, reference_item=reference_item,)Subclasses
| Class name | Process ID | Process |
|---|---|---|
CoregistrationSimularity | coregistration-simularity | Coregistration |
Has more attributes, see its class. | detection-change-simularity | Change detection |
A data class that represents a template for the Change detection process. Extends the SimularityJobTemplate class.
Attributes
| Attribute | Description |
|---|---|
sensitivity | int The setting that adjusts the sensitivity to change. The range of allowed values spans from |
from up42 import processing_templates
# Select multiple itemssource_item_id = "68567134-27ad-7bd7-4b65-d61adb11fc78"reference_item_id = "c3de9ed8-f6e5-4bb5-a157-f6430ba756da"
# Get the items from the STAC clientUP42_client = up42.UP42_client()source_item = UP42_client.get_item(source_item_id)reference_item = UP42_client.get_item(reference_item_id)
# Instantiate a DetectionChangeSimularity templatejob_template = processing_templates.DetectionChangeSimularity( title="Detecting changes over Berlin", source_item=source_item, reference_item=reference_item, sensitivity=4,)A data class that represents a template for the Pansharpening process. Extends the SingleItemJobTemplate class.
Attributes
| Attribute | Description |
|---|---|
grey_weights | Optional[List[GreyWeight]] The weight factors by which spatial details of multispectral bands are scaled. |
from up42 import processing_templates
# Select an itemstac_item_id = "68567134-27ad-7bd7-4b65-d61adb11fc78"
# Get the item from the STAC clientUP42_client = up42.stac_client()stac_item = next(UP42_client.get_items(stac_item_id))
# Instantiate a Pansharpening template with grey weightsjob_template = processing_templates.Pansharpening( title="Pansharpen item", item=stac_item, grey_weights=[ processing_templates.GreyWeight(band="red", weight=0.04), processing_templates.GreyWeight(band="blue", weight=0.9), processing_templates.GreyWeight(band="green", weight=0.2), ],)A data class that represents the weight factors by which to scale spatial details of multispectral bands.
- If not specified, the process uses either sensor-optimized weights or optimal generated weights.
- If you specify the weights yourself, you must define at least 3 bands.
Attributes
| Attribute | Description |
|---|---|
band | str The name of the band from the STAC asset with the |
weight | float The multiplication value that lets you modulate the influence of multispectral bands on the final image. The range of allowed values spans from |
from up42 import processing_templates
# Select an itemstac_item_id = "68567134-27ad-7bd7-4b65-d61adb11fc78"
# Get the item from the STAC clientUP42_client = up42.stac_client()stac_item = next(UP42_client.get_items(stac_item_id))
# Instantiate a Pansharpening template with grey weightsjob_template = processing_templates.Pansharpening( title="Pansharpen item", item=stac_item, grey_weights=[ processing_templates.GreyWeight(band="red", weight=0.04), processing_templates.GreyWeight(band="blue", weight=0.9), processing_templates.GreyWeight(band="green", weight=0.2), ],)