GBDX

ENVI® Image Band Difference

This task performs a difference analysis on a specific band in two images. The task takes two single band rasters with overlapping extent as input. The result will be a raster showing the difference between overlapping pixels. Areas where pixels overlap will be subtracted from the first raster as input 1.

GBDX Registered Name: ENVI_ImageBandDifference
Provider: Harris Geospatial Solutions

Imagery Examples

Before: NDVI from 2 different WorldView 2 image dates

Before: NDVI from 2 different WorldView 2 image dates

After: Difference image of the two NDVI images

After: Difference image of the two NDVI images

Quickstart

This is a workflow example for basic processing.

# Quickstart Example running the task name.

# Initialize the Environment.
from os.path import join, split
from gbdxtools import Interface
gbdx = Interface()

tasks = []
output_location = 'ENVI/ImageBandDifference'

# Change Detection task setup
pre_cat_id = '103001001EC17D00'
post_cat_id = '103001001C423600'

# Pre-Image Auto ordering task parameters
pre_order = gbdx.Task("Auto_Ordering")
pre_order.inputs.cat_id = pre_cat_id
pre_order.impersonation_allowed = True
pre_order.persist = True
pre_order.timeout = 36000
tasks += [pre_order]

# Pre-Image AOP task parameters
pre_aop = gbdx.Task("AOP_Strip_Processor")
pre_aop.inputs.data = pre_order.outputs.s3_location.value
pre_aop.inputs.bands = 'MS'
pre_aop.inputs.enable_dra = False
pre_aop.outputs.data.persist = True
pre_aop.outputs.data.persist_location = output_location+'/pre_aop'
pre_aop.timeout = 36000
tasks += [pre_aop]

# Post-Image Auto ordering task parameters
post_order = gbdx.Task("Auto_Ordering")
post_order.inputs.cat_id = post_cat_id
post_order.impersonation_allowed = True
post_order.persist = True
post_order.timeout = 36000
tasks += [post_order]

# Post-Image AOP task parameters
post_aop = gbdx.Task("AOP_Strip_Processor")
post_aop.inputs.data = post_order.outputs.s3_location.value
post_aop.inputs.bands = 'MS'
post_aop.inputs.enable_dra = False
post_aop.outputs.data.persist = True
post_aop.outputs.data.persist_location = output_location+'/post_aop'
post_aop.timeout = 36000
tasks += [post_aop]

# Create an NDVI Product from the first image
envi_ndvi1 = gbdx.Task("ENVI_SpectralIndex")
envi_ndvi1.inputs.input_raster = pre_aop.outputs.data.value
envi_ndvi1.inputs.index = "Normalized Difference Vegetation Index"
tasks += [envi_ndvi1]

# Create an NDVI Product from the second image
envi_ndvi2 = gbdx.Task("ENVI_SpectralIndex")
envi_ndvi2.inputs.input_raster = post_aop.outputs.data.value
envi_ndvi2.inputs.index = "Normalized Difference Vegetation Index"
tasks += [envi_ndvi2]

# Find where the images intersect
envi_II = gbdx.Task("ENVI_ImageIntersection")
envi_II.inputs.input_raster1 = envi_ndvi1.outputs.output_raster_uri.value
envi_II.inputs.input_raster2 = envi_ndvi2.outputs.output_raster_uri.value
tasks += [envi_II]

# Calculate a difference image
envi_IBD = gbdx.Task("ENVI_ImageBandDifference")
envi_IBD.inputs.input_raster1 = envi_II.outputs.output_raster1_uri.value
envi_IBD.inputs.input_raster2 = envi_II.outputs.output_raster2_uri.value
tasks += [envi_IBD]


workflow = gbdx.Workflow(tasks)
workflow.savedata(
    envi_IBD.outputs.output_raster_uri, location=output_location
)

workflow.execute()

Inputs

The following table lists all ENVI_ImageBandDifference inputs.
Mandatory (optional) settings are listed as Required = True (Required = False).

Name Required Default Valid Values Description
file_types False N/A string GBDX Option. Comma seperated list of permitted file type extensions. Use this to filter input files -- Value Type: STRING[*]
input_raster1 True N/A See ENVIRASTER input type Specify a single-band raster on which to perform an image difference of input band. -- Value Type: ENVIRASTER
input_raster1_format False N/A string Provide the format of the image, for example: landsat-8. -- Value Type: STRING
input_raster1_band_grouping False N/A string Provide the name of the band grouping to be used in the task, ie - panchromatic. -- Value Type: STRING
input_raster1_filename False N/A string Provide the explicit relative raster filename that ENVI will open. This overrides any file lookup in the task runner. -- Value Type: STRING
input_raster1_raw_output False False See ENVIRASTER input type Provide True to output an ENVI Binary instead of a tif. -- Value Type: STRING
input_raster2 True N/A See ENVIRASTER input type Specify a second single-band raster on which to perform an image difference of input band. -- Value Type: ENVIRASTER
input_raster2_format False N/A string Provide the format of the image, for example: landsat-8. -- Value Type: STRING
input_raster2_band_grouping False N/A string Provide the name of the band grouping to be used in the task, ie - panchromatic. -- Value Type: STRING
input_raster2_filename False N/A string Provide the explicit relative raster filename that ENVI will open. This overrides any file lookup in the task runner. -- Value Type: STRING
input_raster_raw2_output False False See ENVIRASTER input type Provide True to output an ENVI Binary instead of a tif. -- Value Type: STRING
output_raster_uri_filename False N/A string Specify a string with the fully-qualified path and filename for OUTPUT_RASTER. -- Value Type: STRING

Outputs

The following table lists all ENVI_ImageBandDifference outputs.
Mandatory (optional) settings are listed as Required = True (Required = False).

Name Required Default Valid Values Description
task_meta_data False N/A directory GBDX Option. Output location for task meta data such as execution log and output JSON
output_raster_uri True N/A directory Output for OUTPUT_RASTER. -- Value Type: ENVIURI

Output structure

The output_raster_uri file will be written to the specified S3 Customer Account Location.

Background

For additional background information on this task please refer to the Harris Geospatial ENVI documentation and
ENVI® Image Band Difference.

Contact

If you have any questions or issues with this task, please contact gbdx-support@digitalglobe.com.