Processing templates in SDK

View processes to run using the SDK.


Overview

Apply advanced processing to purchased geospatial data.

View repository

Basic item input templates

Classes with one item

Single-item template classes represent processes that require a single STAC item. For these template classes, the following input is required:

  • A title for the job
  • A single STAC item

The SDK provides a distinct class for each of these processes, with each class containing the necessary process ID. All single-item template classes extend the SingleItemJobTemplate class.

Class nameProcess IDProcess
DetectionAircraftOIdetection-aircraft-oiAircraft detection
DetectionBuildingsSpaceptdetection-buildings-spaceptBuilding detection
DetectionCarsOIdetection-cars-oiCar detection
DetectionShadowsSpaceptdetection-shadows-spaceptShadow detection
DetectionShipsAirbusdetection-ships-airbusShip detection
DetectionStorageTanksAirbusdetection-storage-tanks-airbusStorage tank detection
DetectionTreesSpaceptdetection-trees-spaceptTree detection
DetectionTrucksOIdetection-trucks-oiTruck detection
DetectionWindTurbinesAirbusdetection-wind-turbines-airbusWind turbine detection
Python
from up42 import processing_templates
# Select an item
stac_item_id = "68567134-27ad-7bd7-4b65-d61adb11fc78"
# Get the item from the STAC client
stac_client = up42.stac_client()
stac_item = next(stac_client.get_items(stac_item_id))
# Instanitate a DetectionTreesSpacept template
job_template = processing_templates.DetectionTreesSpacept(
title="Detect trees over UK",
item=stac_item,
)

Classes with several items

Multi-item template classes represent processes that require more than one STAC item. For these template classes, the following input is required:

  • A title for the job
  • Multiple STAC items

The SDK provides a distinct class for each of these processes, with each class containing the necessary process ID. All single-item template classes extend the MultiItemJobTemplate class.

Class nameProcess IDProcess
DetectionChangePleiadesHypervergedetection-change-pleiades-hypervergeInfrastructure change detection (Pléiades)
DetectionChangeSpaceptdetection-change-spaceptChange detection
DetectionChangeSPOTHypervergedetection-change-spot-hypervergeInfrastructure change detection (SPOT)
Python
from up42 import processing_templates
# Select multiple items
stac_item1_id = "68567134-27ad-7bd7-4b65-d61adb11fc78"
stac_item2_id = "c3de9ed8-f6e5-4bb5-a157-f6430ba756da"
# Get the items from the STAC client
stac_client = up42.stac_client()
stac_item1 = next(stac_client.get_items(stac_item1_id))
stac_item2 = next(stac_client.get_items(stac_item2_id))
# Instantiate a DetectionChangeSpacept template
job_template = processing_templates.DetectionChangeSpacept(
title="Detect changes",
items=[stac_item1, stac_item2],
)

Class: CoregistrationSimularity

A data class that represents a template for the Coregistration process. Extends the JobTemplate class.

Constants

ConstantDescriptionValue
process_idThe process ID.coregistration-simularity

Attributes

AttributeDescription
title

str

A user-defined title for the coregistration job.

source_item

pystac.Item

The STAC item representing the source image to be coregistered.

reference_item

pystac.Item

The STAC Item representing the reference image for coregistration. The positional accuracy of the source image will be improved against this reference.

Python
from up42 import processing_templates
# Select multiple items
source_item_id = "68567134-27ad-7bd7-4b65-d61adb11fc78"
reference_item_id = "c3de9ed8-f6e5-4bb5-a157-f6430ba756da"
# Get the items from the STAC client
stac_client = up42.stac_client()
source_item = next(stac_client.get_items(source_item_id))
reference_item = next(stac_client.get_items(reference_item_id))
# Instantiate a CoregistrationSimularity template
job_template = processing_templates.CoregistrationSimularity(
title="Coregistration for images",
source_item=source_item,
reference_item=reference_item,
)

Class: GreyWeight

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

AttributeDescription
band

str

The name of the band from the STAC asset with the ["data", "multispectral"] roles.

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 -1 to 1.

Python
from up42 import processing_templates
# Select an item
stac_item_id = "68567134-27ad-7bd7-4b65-d61adb11fc78"
# Get the item from the STAC client
stac_client = up42.stac_client()
stac_item = next(stac_client.get_items(stac_item_id))
# Instantiate a Pansharpening template with grey weights
job_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),
],
)

Class: Pansharpening

A data class that represents a template for the Pansharpening process. Extends the SingleItemJobTemplate class.

Constants

ConstantDescriptionValue
process_idThe process ID.pansharpening

Attributes

AttributeDescription
grey_weights

Optional[List[GreyWeight]]

The weight factors by which spatial details of multispectral bands are scaled.

Python
from up42 import processing_templates
# Select an item
stac_item_id = "68567134-27ad-7bd7-4b65-d61adb11fc78"
# Get the item from the STAC client
stac_client = up42.stac_client()
stac_item = next(stac_client.get_items(stac_item_id))
# Instantiate a Pansharpening template with grey weights
job_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),
],
)

Class: UpsamplingNS

A data class that represents a template for the Upsampling process. Extends the SingleItemJobTemplate class.

Constants

ConstantDescriptionValue
process_idThe process ID.upsampling-ns

Attributes

AttributeDescription
ned

bool

Whether the NIR, red edge, and deep blue bands need to be upsampled. If rgb is true, then ned must be set to false. The default value is false.

rgb

bool

Whether the red, green, and blue bands need to be upsampled. If ned is true, then rgb must be set to false. The default value is true.

Python
from up42 import processing_templates
# Select an item
stac_item_id = "68567134-27ad-7bd7-4b65-d61adb11fc78"
# Get the item from the STAC client
stac_client = up42.stac_client()
stac_item = next(stac_client.get_items(stac_item_id))
# Instantiate an UpsamplingNS template
job_template = processing_templates.UpsamplingNS(
title="Upsample item",
item=stac_item,
ned=True, # Set NED to True
rgb=False, # Set RGB to False
)

Learn more


Last updated: