{"_id":"58efe0c0d8e4c00f004a999f","category":{"_id":"573b4f62ef164e2900a2b881","__v":0,"project":"55faeacad0e22017005b8265","version":"55faeacad0e22017005b8268","sync":{"url":"","isSync":false},"reference":false,"createdAt":"2016-05-17T17:05:38.443Z","from_sync":false,"order":8,"slug":"algorithm-guide","title":"Algorithms"},"version":{"_id":"55faeacad0e22017005b8268","project":"55faeacad0e22017005b8265","__v":35,"createdAt":"2015-09-17T16:31:06.800Z","releaseDate":"2015-09-17T16:31:06.800Z","categories":["55faeacbd0e22017005b8269","55faf550764f50210095078e","55faf5b5626c341700fd9e96","55faf8a7825d5f19001fa386","560052f91503430d007cc88f","560054f73aa0520d00da0b1a","56005aaf6932a00d00ba7c62","56005c273aa0520d00da0b3f","5601ae7681a9670d006d164d","5601ae926811d00d00ceb487","5601aeb064866b1900f4768d","5601aee850ee460d0002224c","5601afa02499c119000faf19","5601afd381a9670d006d1652","561d4c78281aec0d00eb27b6","561d588d8ca8b90d00210219","563a5f934cc3621900ac278c","5665c5763889610d0008a29e","566710a36819320d000c2e93","56ddf6df8a5ae10e008e3926","56e1c96b2506700e00de6e83","56e1ccc4e416450e00b9e48c","56e1ccdfe63f910e00e59870","56e1cd10bc46be0e002af26a","56e1cd21e416450e00b9e48e","56e3139a51857d0e008e77be","573b4f62ef164e2900a2b881","57c9d1335fd8ca0e006308ed","57e2bd9d1e7b7220000d7fa5","57f2b992ac30911900c7c2b6","58adb5c275df0f1b001ed59b","58c81b5c6dc7140f003c3c46","595412446ed4d9001b3e7b37","59e76ce41938310028037295","5a009de510890d001c2aabfe"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"v1","version_clean":"1.0.0","version":"1"},"user":"55fae9d4825d5f19001fa379","__v":0,"parentDoc":null,"project":"55faeacad0e22017005b8265","updates":[],"next":{"pages":[],"description":""},"createdAt":"2017-04-13T20:34:08.201Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":17,"body":"## Table of Contents\n\nSection | Description\n--- | ---\n[Imagery Examples](#Imagery Examples) | Before and after examples\n[Quickstart](#Quickstart) | Get started with a Python-based quickstart tutorial\n[Task Runtime](#Task Runtime) | Benchmark runtimes for the algorithm\n[Input Options](#Input Options) | Required and optional task inputs\n[Outputs](#Outputs) | Task outputs and example contents\n[Advanced Options](#Advanced Options) | Additional information for advanced users\n[Known Issues](#Known Issues) | Issues users should be aware of\n\n\n## <a name=\"Imagery Examples\"></a>Imagery Examples\n\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/0e674f4-ImageBandDifference_before.jpg\",\n        \"ImageBandDifference_before.jpg\",\n        800,\n        320,\n        \"#d5c6b8\"\n      ],\n      \"caption\": \"Before: These are the two images that will be analyzed by ENVI ImageBand Difference\"\n    }\n  ]\n}\n[/block]\n\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/90293cc-ImageBandDifference_after.jpg\",\n        \"ImageBandDifference_after.jpg\",\n        800,\n        320,\n        \"#d8dd1b\"\n      ],\n      \"caption\": \"After: This is the result of the band analysis output from the ENVI ImageBand Difference Task.\"\n    }\n  ]\n}\n[/block]\n## <a name=\"Quickstart\"></a>Quickstart Tutorial\n\nExample Script: Run in a python environment (i.e. - IPython) using the gbdxtools interface.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"from gbdxtools import Interface\\ngbdx = Interface()\\n\\n# Insert correct path to image in S3 location.\\n# Note: Images must have the same dimensions, have a single band, and from the same sensor. \\n#   See Advanced script for example of end to end example.\\ndata1 = 's3://gbd-customer-data/CustomerAccount#/PathToImage1/'\\ndata2 = 's3://gbd-customer-data/CustomerAccount#/PathToImage2/'\\n\\nenvi_IBD = gbdx.Task(\\\"ENVI_ImageBandDifference\\\")\\nenvi_IBD.inputs.input_raster1 = data1\\nenvi_IBD.inputs.input_raster2 = data2\\n\\nworkflow = gbdx.Workflow([envi_IBD])\\n\\nworkflow.savedata(\\n    envi_IBD.outputs.output_raster_uri,\\n    location='ImageBandDiff/output_raster_uri' # edit location to suit account\\n)\\n\\nprint workflow.execute()\\nprint workflow.status\\n# Repeat workflow.status as needed to monitor progress.\",\n      \"language\": \"python\"\n    }\n  ]\n}\n[/block]\n## <a name=\"Task Runtime\"></a>Task Runtime\nThese are the average runtimes for this algorithm. All benchmark tests were run using a standard set of images, based on our most common customer scenarios. Runtime benchmarks apply to the specific algorithm, and don’t represent the runtime of a complete workflow.\n\n\n| Sensor Name | Total Pixels | Total Area (k2) | Time(secs) | Time/Area k2 |\n| ----------- | :----------: | --------------- | --------- | ------------ |\n| WV02        | 31,754,708  | 292.02          | 169.60    | 0.74         |\n| Wv03        |  30,096,907 | 167.091       | 167.091   | 0.98     |\n| GE01        | 28,492,530  | 165.061      |  312.104    |  0.53   |\n|  QB02       | 22,635,330      | 170.367      |  321.188    |  0.54  \n\n\n## <a name=\"Input Options\"></a>Input Options\nThe following table lists all inputs for this task. For details regarding the use of all ENVI input types refer to the [ENVI Task Runner Inputs](https://gbdxdocs.digitalglobe.com/docs/envi-task-runner-inputs) documentation.\n\n| Name                        | Required | Default | Valid Values                             | Description                              |\n| --------------------------- | :------: | ------- | ---------------------------------------- | ---------------------------------------- |\n| file_types                  |  False   | None    | string                                   | GBDX Option. Comma separated list of permitted file type extensions. Use this to filter input files -- Value Type: STRING |\n| input_raster1               |   True   | None    | A valid S3 URL containing image files.   | Specify a single-band raster on which to perform an image difference of input band. -- Value Type: ENVIRASTER |\n| input_raster1_format        |  False   | None    | [See ENVIRASTER input type](https://github.com/TDG-Platform/docs/blob/master/ENVI_Task_Runner_Inputs.md) | Provide the format of the image, for example: landsat-8. -- Value Type: STRING |\n| input_raster1_band_grouping |  False   | None    | [[See ENVIRASTER input type](https://github.com/TDG-Platform/docs/blob/master/ENVI_Task_Runner_Inputs.md)](https://gbdxdocs.digitalglobe.com/docs/envi-task-runner-inputs) | Provide the name of the band grouping to be used in the task, ie - panchromatic. -- Value Type: STRING |\n| input_raster1_filename      |  False   | None    | [See ENVIRASTER input type](https://github.com/TDG-Platform/docs/blob/master/ENVI_Task_Runner_Inputs.md) | Provide the explicit relative raster filename that ENVI will open. This overrides any file lookup in the task runner. -- Value Type: STRING |\n| input_raster2               |   True   | None    | A valid S3 URL containing image files.   | Specify a second single-band raster on which to perform an image difference of input band. -- Value Type: ENVIRASTER |\n| input_raster2_format        |  False   | None    | [See ENVIRASTER input type](https://github.com/TDG-Platform/docs/blob/master/ENVI_Task_Runner_Inputs.md) | Provide the format of the image, for example: landsat-8. -- Value Type: DICTIONARY |\n| input_raster2_band_grouping |  False   | None    | [See ENVIRASTER input type](https://github.com/TDG-Platform/docs/blob/master/ENVI_Task_Runner_Inputs.md) | Provide the name of the band grouping to be used in the task, ie - panchromatic. -- Value Type: STRING |\n| input_raster2_filename      |  False   | None    | [See ENVIRASTER input type](https://github.com/TDG-Platform/docs/blob/master/ENVI_Task_Runner_Inputs.md) | Provide the explicit relative raster filename that ENVI will open. This overrides any file lookup in the task runner. -- Value Type: STRING |\n| output_raster_uri_filename  |  False   | None    | string                                   | Specify a string with the fully-qualified path and filename for OUTPUT_RASTER. -- Value Type: STRING |\n\n## <a name=\"Outputs\"></a>Outputs\nThe following table lists all the tasks outputs.\n\n| Name              | Required | Description                              |\n| ----------------- | :------: | ---------------------------------------- |\n| output_raster_uri |   True   | Output for OUTPUT_RASTER.                |\n| task_meta_data    |  False   | GBDX Option. Output location for task meta data such as execution log and output JSON. |\n\n##### Output Structure\n\nThe output_raster image file will be written to the specified S3 Customer Account Location in GeoTiff (\\*.tif) format, with an ENVI header file (\\*.hdr).\n\n\n## <a name=\"Advanced Options\"></a>Advanced Options\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"rom gbdxtools import Interface\\ngbdx = Interface()\\n\\n# Insert correct path to image in S3 location.\\n# Images must have an intersection, otherwise the task will fail.\\ndata1 = 's3://gbd-customer-data/CustomerAccount#/PathToImage1/'\\ndata2 = 's3://gbd-customer-data/CustomerAccount#/PathToImage2/'\\n\\naoptask1 = gbdx.Task(\\n    \\\"AOP_Strip_Processor\\\",\\n    data=data1, \\n    enable_acomp=True, \\n    enable_pansharpen=False, \\n    enable_dra=False, \\n    bands='MS'\\n)\\n\\naoptask2 = gbdx.Task(\\n    \\\"AOP_Strip_Processor\\\",\\n    data=data2, \\n    enable_acomp=True, \\n    enable_pansharpen=False, \\n    enable_dra=False, \\n    bands='MS'\\n)\\n\\nenvi_ndvi1 = gbdx.Task(\\\"ENVI_SpectralIndex\\\")\\nenvi_ndvi1.inputs.input_raster = aoptask1.outputs.data.value\\nenvi_ndvi1.inputs.index = \\\"Normalized Difference Vegetation Index\\\"\\n\\nenvi_ndvi2 = gbdx.Task(\\\"ENVI_SpectralIndex\\\")\\nenvi_ndvi2.inputs.input_raster = aoptask2.outputs.data.value\\nenvi_ndvi2.inputs.index = \\\"Normalized Difference Vegetation Index\\\"\\n\\nenvi_II = gbdx.Task(\\\"ENVI_ImageIntersection\\\")\\nenvi_II.inputs.input_raster1 = envi_ndvi1.outputs.output_raster_uri.value\\nenvi_II.inputs.input_raster2 = envi_ndvi2.outputs.output_raster_uri.value\\nenvi_II.inputs.output_raster1_uri_filename = \\\"NDVI1\\\"\\nenvi_II.inputs.output_raster2_uri_filename = \\\"NDVI2\\\"\\n\\nenvi_IBD = gbdx.Task(\\\"ENVI_ImageBandDifference\\\")\\nenvi_IBD.inputs.input_raster1 = envi_II.outputs.output_raster1_uri.value\\nenvi_IBD.inputs.input_raster2 = envi_II.outputs.output_raster2_uri.value\\n\\nworkflow = gbdx.Workflow([aoptask1, aoptask2, envi_ndvi1, envi_ndvi2, envi_II, envi_IBD])\\n\\nworkflow.savedata(\\n    envi_IBD.outputs.output_raster_uri,\\n    location='ImageBandDiff/output_raster_uri'\\n)\\n\\nprint workflow.execute()\\nprint workflow.status\\n# Repeat workflow.status as needed to monitor progress.\",\n      \"language\": \"python\"\n    }\n  ]\n}\n[/block]\n##<a name=\"Known Issues\"></a>Known Issues\nNone.\n\n## Background\nFor additional background information on this task please refer to the <a href=\"http://www.harrisgeospatial.com/docs/home.html\">Harris Geospatial ENVI documentation.</a>​\n\n#### Contact Us   \nIf you have any questions or issues with this task, please contact [**gbdx-support:::at:::digitalglobe.com** ](mailto:gbdx-support@digitalglobe.com).","excerpt":"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.\n\t\n**GBDX Registered Name**: ENVI_ImageBandDifference\n**Provider**: Harris Geospatial Solutions\nFor more information on how to execute this task please refer to the [ENVI® Task Runner Inputs](doc:envi-task-runner-inputs) .","slug":"envi-imageband-difference","type":"basic","title":"ENVI® Image Band Difference"}

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 For more information on how to execute this task please refer to the [ENVI® Task Runner Inputs](doc:envi-task-runner-inputs) .

## Table of Contents Section | Description --- | --- [Imagery Examples](#Imagery Examples) | Before and after examples [Quickstart](#Quickstart) | Get started with a Python-based quickstart tutorial [Task Runtime](#Task Runtime) | Benchmark runtimes for the algorithm [Input Options](#Input Options) | Required and optional task inputs [Outputs](#Outputs) | Task outputs and example contents [Advanced Options](#Advanced Options) | Additional information for advanced users [Known Issues](#Known Issues) | Issues users should be aware of ## <a name="Imagery Examples"></a>Imagery Examples [block:image] { "images": [ { "image": [ "https://files.readme.io/0e674f4-ImageBandDifference_before.jpg", "ImageBandDifference_before.jpg", 800, 320, "#d5c6b8" ], "caption": "Before: These are the two images that will be analyzed by ENVI ImageBand Difference" } ] } [/block] [block:image] { "images": [ { "image": [ "https://files.readme.io/90293cc-ImageBandDifference_after.jpg", "ImageBandDifference_after.jpg", 800, 320, "#d8dd1b" ], "caption": "After: This is the result of the band analysis output from the ENVI ImageBand Difference Task." } ] } [/block] ## <a name="Quickstart"></a>Quickstart Tutorial Example Script: Run in a python environment (i.e. - IPython) using the gbdxtools interface. [block:code] { "codes": [ { "code": "from gbdxtools import Interface\ngbdx = Interface()\n\n# Insert correct path to image in S3 location.\n# Note: Images must have the same dimensions, have a single band, and from the same sensor. \n# See Advanced script for example of end to end example.\ndata1 = 's3://gbd-customer-data/CustomerAccount#/PathToImage1/'\ndata2 = 's3://gbd-customer-data/CustomerAccount#/PathToImage2/'\n\nenvi_IBD = gbdx.Task(\"ENVI_ImageBandDifference\")\nenvi_IBD.inputs.input_raster1 = data1\nenvi_IBD.inputs.input_raster2 = data2\n\nworkflow = gbdx.Workflow([envi_IBD])\n\nworkflow.savedata(\n envi_IBD.outputs.output_raster_uri,\n location='ImageBandDiff/output_raster_uri' # edit location to suit account\n)\n\nprint workflow.execute()\nprint workflow.status\n# Repeat workflow.status as needed to monitor progress.", "language": "python" } ] } [/block] ## <a name="Task Runtime"></a>Task Runtime These are the average runtimes for this algorithm. All benchmark tests were run using a standard set of images, based on our most common customer scenarios. Runtime benchmarks apply to the specific algorithm, and don’t represent the runtime of a complete workflow. | Sensor Name | Total Pixels | Total Area (k2) | Time(secs) | Time/Area k2 | | ----------- | :----------: | --------------- | --------- | ------------ | | WV02 | 31,754,708 | 292.02 | 169.60 | 0.74 | | Wv03 | 30,096,907 | 167.091 | 167.091 | 0.98 | | GE01 | 28,492,530 | 165.061 | 312.104 | 0.53 | | QB02 | 22,635,330 | 170.367 | 321.188 | 0.54 ## <a name="Input Options"></a>Input Options The following table lists all inputs for this task. For details regarding the use of all ENVI input types refer to the [ENVI Task Runner Inputs](https://gbdxdocs.digitalglobe.com/docs/envi-task-runner-inputs) documentation. | Name | Required | Default | Valid Values | Description | | --------------------------- | :------: | ------- | ---------------------------------------- | ---------------------------------------- | | file_types | False | None | string | GBDX Option. Comma separated list of permitted file type extensions. Use this to filter input files -- Value Type: STRING | | input_raster1 | True | None | A valid S3 URL containing image files. | Specify a single-band raster on which to perform an image difference of input band. -- Value Type: ENVIRASTER | | input_raster1_format | False | None | [See ENVIRASTER input type](https://github.com/TDG-Platform/docs/blob/master/ENVI_Task_Runner_Inputs.md) | Provide the format of the image, for example: landsat-8. -- Value Type: STRING | | input_raster1_band_grouping | False | None | [[See ENVIRASTER input type](https://github.com/TDG-Platform/docs/blob/master/ENVI_Task_Runner_Inputs.md)](https://gbdxdocs.digitalglobe.com/docs/envi-task-runner-inputs) | Provide the name of the band grouping to be used in the task, ie - panchromatic. -- Value Type: STRING | | input_raster1_filename | False | None | [See ENVIRASTER input type](https://github.com/TDG-Platform/docs/blob/master/ENVI_Task_Runner_Inputs.md) | Provide the explicit relative raster filename that ENVI will open. This overrides any file lookup in the task runner. -- Value Type: STRING | | input_raster2 | True | None | A valid S3 URL containing image files. | Specify a second single-band raster on which to perform an image difference of input band. -- Value Type: ENVIRASTER | | input_raster2_format | False | None | [See ENVIRASTER input type](https://github.com/TDG-Platform/docs/blob/master/ENVI_Task_Runner_Inputs.md) | Provide the format of the image, for example: landsat-8. -- Value Type: DICTIONARY | | input_raster2_band_grouping | False | None | [See ENVIRASTER input type](https://github.com/TDG-Platform/docs/blob/master/ENVI_Task_Runner_Inputs.md) | Provide the name of the band grouping to be used in the task, ie - panchromatic. -- Value Type: STRING | | input_raster2_filename | False | None | [See ENVIRASTER input type](https://github.com/TDG-Platform/docs/blob/master/ENVI_Task_Runner_Inputs.md) | Provide the explicit relative raster filename that ENVI will open. This overrides any file lookup in the task runner. -- Value Type: STRING | | output_raster_uri_filename | False | None | string | Specify a string with the fully-qualified path and filename for OUTPUT_RASTER. -- Value Type: STRING | ## <a name="Outputs"></a>Outputs The following table lists all the tasks outputs. | Name | Required | Description | | ----------------- | :------: | ---------------------------------------- | | output_raster_uri | True | Output for OUTPUT_RASTER. | | task_meta_data | False | GBDX Option. Output location for task meta data such as execution log and output JSON. | ##### Output Structure The output_raster image file will be written to the specified S3 Customer Account Location in GeoTiff (\*.tif) format, with an ENVI header file (\*.hdr). ## <a name="Advanced Options"></a>Advanced Options [block:code] { "codes": [ { "code": "rom gbdxtools import Interface\ngbdx = Interface()\n\n# Insert correct path to image in S3 location.\n# Images must have an intersection, otherwise the task will fail.\ndata1 = 's3://gbd-customer-data/CustomerAccount#/PathToImage1/'\ndata2 = 's3://gbd-customer-data/CustomerAccount#/PathToImage2/'\n\naoptask1 = gbdx.Task(\n \"AOP_Strip_Processor\",\n data=data1, \n enable_acomp=True, \n enable_pansharpen=False, \n enable_dra=False, \n bands='MS'\n)\n\naoptask2 = gbdx.Task(\n \"AOP_Strip_Processor\",\n data=data2, \n enable_acomp=True, \n enable_pansharpen=False, \n enable_dra=False, \n bands='MS'\n)\n\nenvi_ndvi1 = gbdx.Task(\"ENVI_SpectralIndex\")\nenvi_ndvi1.inputs.input_raster = aoptask1.outputs.data.value\nenvi_ndvi1.inputs.index = \"Normalized Difference Vegetation Index\"\n\nenvi_ndvi2 = gbdx.Task(\"ENVI_SpectralIndex\")\nenvi_ndvi2.inputs.input_raster = aoptask2.outputs.data.value\nenvi_ndvi2.inputs.index = \"Normalized Difference Vegetation Index\"\n\nenvi_II = gbdx.Task(\"ENVI_ImageIntersection\")\nenvi_II.inputs.input_raster1 = envi_ndvi1.outputs.output_raster_uri.value\nenvi_II.inputs.input_raster2 = envi_ndvi2.outputs.output_raster_uri.value\nenvi_II.inputs.output_raster1_uri_filename = \"NDVI1\"\nenvi_II.inputs.output_raster2_uri_filename = \"NDVI2\"\n\nenvi_IBD = gbdx.Task(\"ENVI_ImageBandDifference\")\nenvi_IBD.inputs.input_raster1 = envi_II.outputs.output_raster1_uri.value\nenvi_IBD.inputs.input_raster2 = envi_II.outputs.output_raster2_uri.value\n\nworkflow = gbdx.Workflow([aoptask1, aoptask2, envi_ndvi1, envi_ndvi2, envi_II, envi_IBD])\n\nworkflow.savedata(\n envi_IBD.outputs.output_raster_uri,\n location='ImageBandDiff/output_raster_uri'\n)\n\nprint workflow.execute()\nprint workflow.status\n# Repeat workflow.status as needed to monitor progress.", "language": "python" } ] } [/block] ##<a name="Known Issues"></a>Known Issues None. ## Background For additional background information on this task please refer to the <a href="http://www.harrisgeospatial.com/docs/home.html">Harris Geospatial ENVI documentation.</a>​ #### Contact Us If you have any questions or issues with this task, please contact [**gbdx-support@digitalglobe.com** ](mailto:gbdx-support@digitalglobe.com).