{"_id":"591b319c2dba9823008f9338","__v":0,"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":9,"slug":"algorithm-guide","title":"Algorithms"},"parentDoc":null,"user":"55fae9d4825d5f19001fa379","project":"55faeacad0e22017005b8265","version":{"_id":"55faeacad0e22017005b8268","project":"55faeacad0e22017005b8265","__v":36,"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","5a96f89c89442e002041144b"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"v1","version_clean":"1.0.0","version":"1"},"updates":[],"next":{"pages":[],"description":""},"createdAt":"2017-05-16T17:06:36.693Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":121,"body":"NNDiffuse Pansharpening works best when the spectral response function of each multispectral band has minimal overlap with one another, and the combination of all multispectral bands covers the spectral range of the panchromatic raster.\nThe following are input raster requirements for running the NND Pansharpening algorithm:\n\n* The pixel size of the low-resolution raster must be an integral multiple of the pixel size of the high-resolution raster. If it is not, then pre-process (resample) the rasters.\n* When the rasters have projection information, it must be in the same\n   projection. If it is not the same, then reproject the rasters.\n* The rasters must be aligned. If the rasters have misalignment, then\n   register the rasters.\n* Ensure that the rasters line up, particularly in the upper-left\n   corner (see the following diagram). When alignment is as little as\n   1/2 pixel off between the two, pan sharpening accuracy will be\n   affected. If both input rasters have map information, they will be\n   automatically subsetted so that they line up. If the rasters do not\n   line up and do not have map information, then use spatial subsetting.\n\n### Imagery Examples\n\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/ce5f190-IKONOS_Not_Pansharp.JPG\",\n        \"IKONOS_Not_Pansharp.JPG\",\n        971,\n        437,\n        \"#d19c72\"\n      ],\n      \"caption\": \"Before: This is an example of an IKONOS image that has not been pan-sharpened\"\n    }\n  ]\n}\n[/block]\n\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/df09814-IKONOS_Pansharp.JPG\",\n        \"IKONOS_Pansharp.JPG\",\n        984,\n        455,\n        \"#b7906c\"\n      ],\n      \"caption\": \"After:  This is the same IKONOS image after running ENVI NNDiffuse PanSharpening\"\n    }\n  ]\n}\n[/block]\n### Quickstart\nThis is a workflow example for basic processing.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"# Quickstart Example running the task name.\\n\\n# Initialize the Environment.\\nfrom os.path import join, split\\nfrom gbdxtools import Interface\\ngbdx = Interface()\\n\\ntasks = []\\noutput_location = 'ENVI/NNDiffusePanSharpening'\\n\\ncat_id = '105001000672E000'\\n\\n# Image Auto ordering task parameters\\norder = gbdx.Task(\\\"Auto_Ordering\\\")\\norder.inputs.cat_id = cat_id\\norder.impersonation_allowed = True\\norder.persist = True\\norder.timeout = 36000\\ntasks += [order]\\n\\n# Image AOP task parameters\\naop_high = gbdx.Task(\\\"AOP_Strip_Processor\\\")\\naop_high.inputs.data = order.outputs.s3_location.value\\naop_high.inputs.bands = 'MS'\\naop_high.inputs.enable_dra = False\\naop_high.outputs.data.persist = True\\naop_high.outputs.data.persist_location = output_location+'/multispectral'\\naop_high.timeout = 36000\\ntasks += [aop_high]\\n\\naop_low = gbdx.Task(\\\"AOP_Strip_Processor\\\")\\naop_low.inputs.data = order.outputs.s3_location.value\\naop_low.inputs.bands = 'PAN'\\naop_low.inputs.enable_dra = False\\naop_low.outputs.data.persist = True\\naop_low.outputs.data.persist_location = output_location+'/pan'\\naop_low.timeout = 36000\\ntasks += [aop_low]\\n\\nenvi_nndpan = gbdx.Task(\\\"ENVI_NNDiffusePanSharpening\\\")\\nenvi_nndpan.inputs.input_high_resolution_raster = aop_high.outputs.data.value\\nenvi_nndpan.inputs.input_low_resolution_raster = aop_low.outputs.data.value\\n\\nworkflow = gbdx.Workflow(tasks)\\nworkflow.savedata(\\n    aop_high.outputs.data, location=join(output_location, 'multispectral')\\n)\\nworkflow.savedata(\\n    aop_low.outputs.data, location=join(output_location, 'pan')\\n)\\nworkflow.savedata(\\n    envi_nndpan.outputs.output_raster_uri, location=output_location\\n)\\n\\nworkflow.execute()\",\n      \"language\": \"python\"\n    }\n  ]\n}\n[/block]\n\n### Inputs\nThe following table lists all ENVI_NNDiffusePanSharpening inputs.\nMandatory (optional) settings are listed as Required = True (Required = False).\n\n  Name  |  Required  |  Default  |  Valid Values  |  Description  \n--------|:----------:|-----------|----------------|---------------\nfile_types|False|N/A|string|GBDX Option. Comma seperated list of permitted file type extensions. Use this to filter input files -- Value Type: STRING`[*]`\ninput_low_resolution_raster|True|N/A|[See ENVIRASTER input type](https://gbdxdocs.digitalglobe.com/docs/envi-task-engine#section-enviraster)|Specify a low-resolution raster. -- Value Type: ENVIRASTER\ninput_low_resolution_raster_format|False|N/A|string|Provide the format of the image, for example: landsat-8. -- Value Type: STRING\ninput_low_resolution_raster_band_grouping|False|N/A|string|Provide the name of the band grouping to be used in the task, ie - panchromatic. -- Value Type: STRING\ninput_low_resolution_raster_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\nspatial_smoothness|False|N/A|string|Specify the spatial smoothness factor of the NNDiffuse pan-sharpening algorithm. The default value is PIXEL_SIZE_RATIO * 0.62. -- Value Type: FLOAT\npixel_size_ratio|False|N/A|string|Specify the pixel size ratio. An integer that defines the pixel size ratio of the low-resolution raster and the high-resolution raster. If PIXEL_SIZE_RATIO is not specified, the value is determined from the metadata of the input rasters.  -- Value Type: UINT\nintensity_smoothness|False|N/A|string|Specify the intensity smoothness factor of the NNDiffuse pan-sharpening algorithm. If INTENSITY_SMOOTHNESS is not specified, the value is set adaptively using local similarity. -- Value Type: FLOAT\ninput_high_resolution_raster|True|N/A|[See ENVIRASTER input type](https://gbdxdocs.digitalglobe.com/docs/envi-task-engine#section-enviraster)|Specify a high-resolution panchromatic raster. -- Value Type: ENVIRASTER\ninput_high_resolution_raster_format|False|N/A|string|Provide the format of the image, for example: landsat-8. -- Value Type: STRING\ninput_high_resolution_raster_band_grouping|False|N/A|string|Provide the name of the band grouping to be used in the task, ie - panchromatic. -- Value Type: STRING\ninput_high_resolution_raster_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\noutput_raster_uri_filename|False|N/A|string|Specify a string with the fully-qualified path and filename for OUTPUT_RASTER. -- Value Type: STRING\n\n### Outputs\n\nThe following table lists all ENVI_NNDiffusePanSharpening outputs.\nMandatory (optional) settings are listed as Required = True (Required = False).\n\n  Name  |  Required  |  Default  |  Valid Values  |  Description\n--------|:----------:|-----------|----------------|---------------\ntask_meta_data|False|N/A|directory|GBDX Option. Output location for task meta data such as execution log and output JSON\noutput_raster_uri|True|N/A|directory|Output for OUTPUT_RASTER. -- Value Type: ENVIURI\n\n**Output structure**\n\nThe output_raster_uri file will be written to the specified S3 Customer Account Location.\n\n### Background\nFor additional background information on this task please refer to the [Harris Geospatial ENVI documentation](http://www.harrisgeospatial.com/docs/home.html) and \n[ENVI® ENVI_NN Diffuse Pan Sharpening](http://www.harrisgeospatial.com/docs/envinndiffusepansharpeningtask.html). \n\n### Contact\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 Nearest Neighbor Diffuse (NND) Pansharpening using a low-resolution raster and a high-resolution panchromatic raster.  \n\t\n**GBDX Registered Name**: ENVI_NNDiffusePanSharpening\n**Provider**: Harris Geospatial Solutions","slug":"envi-nndiffuse-pansharpening","type":"basic","title":"ENVI® NNDiffuse PanSharpening"}

ENVI® NNDiffuse PanSharpening

This task performs Nearest Neighbor Diffuse (NND) Pansharpening using a low-resolution raster and a high-resolution panchromatic raster. **GBDX Registered Name**: ENVI_NNDiffusePanSharpening **Provider**: Harris Geospatial Solutions

NNDiffuse Pansharpening works best when the spectral response function of each multispectral band has minimal overlap with one another, and the combination of all multispectral bands covers the spectral range of the panchromatic raster. The following are input raster requirements for running the NND Pansharpening algorithm: * The pixel size of the low-resolution raster must be an integral multiple of the pixel size of the high-resolution raster. If it is not, then pre-process (resample) the rasters. * When the rasters have projection information, it must be in the same projection. If it is not the same, then reproject the rasters. * The rasters must be aligned. If the rasters have misalignment, then register the rasters. * Ensure that the rasters line up, particularly in the upper-left corner (see the following diagram). When alignment is as little as 1/2 pixel off between the two, pan sharpening accuracy will be affected. If both input rasters have map information, they will be automatically subsetted so that they line up. If the rasters do not line up and do not have map information, then use spatial subsetting. ### Imagery Examples [block:image] { "images": [ { "image": [ "https://files.readme.io/ce5f190-IKONOS_Not_Pansharp.JPG", "IKONOS_Not_Pansharp.JPG", 971, 437, "#d19c72" ], "caption": "Before: This is an example of an IKONOS image that has not been pan-sharpened" } ] } [/block] [block:image] { "images": [ { "image": [ "https://files.readme.io/df09814-IKONOS_Pansharp.JPG", "IKONOS_Pansharp.JPG", 984, 455, "#b7906c" ], "caption": "After: This is the same IKONOS image after running ENVI NNDiffuse PanSharpening" } ] } [/block] ### Quickstart This is a workflow example for basic processing. [block:code] { "codes": [ { "code": "# Quickstart Example running the task name.\n\n# Initialize the Environment.\nfrom os.path import join, split\nfrom gbdxtools import Interface\ngbdx = Interface()\n\ntasks = []\noutput_location = 'ENVI/NNDiffusePanSharpening'\n\ncat_id = '105001000672E000'\n\n# Image Auto ordering task parameters\norder = gbdx.Task(\"Auto_Ordering\")\norder.inputs.cat_id = cat_id\norder.impersonation_allowed = True\norder.persist = True\norder.timeout = 36000\ntasks += [order]\n\n# Image AOP task parameters\naop_high = gbdx.Task(\"AOP_Strip_Processor\")\naop_high.inputs.data = order.outputs.s3_location.value\naop_high.inputs.bands = 'MS'\naop_high.inputs.enable_dra = False\naop_high.outputs.data.persist = True\naop_high.outputs.data.persist_location = output_location+'/multispectral'\naop_high.timeout = 36000\ntasks += [aop_high]\n\naop_low = gbdx.Task(\"AOP_Strip_Processor\")\naop_low.inputs.data = order.outputs.s3_location.value\naop_low.inputs.bands = 'PAN'\naop_low.inputs.enable_dra = False\naop_low.outputs.data.persist = True\naop_low.outputs.data.persist_location = output_location+'/pan'\naop_low.timeout = 36000\ntasks += [aop_low]\n\nenvi_nndpan = gbdx.Task(\"ENVI_NNDiffusePanSharpening\")\nenvi_nndpan.inputs.input_high_resolution_raster = aop_high.outputs.data.value\nenvi_nndpan.inputs.input_low_resolution_raster = aop_low.outputs.data.value\n\nworkflow = gbdx.Workflow(tasks)\nworkflow.savedata(\n aop_high.outputs.data, location=join(output_location, 'multispectral')\n)\nworkflow.savedata(\n aop_low.outputs.data, location=join(output_location, 'pan')\n)\nworkflow.savedata(\n envi_nndpan.outputs.output_raster_uri, location=output_location\n)\n\nworkflow.execute()", "language": "python" } ] } [/block] ### Inputs The following table lists all ENVI_NNDiffusePanSharpening 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_low_resolution_raster|True|N/A|[See ENVIRASTER input type](https://gbdxdocs.digitalglobe.com/docs/envi-task-engine#section-enviraster)|Specify a low-resolution raster. -- Value Type: ENVIRASTER input_low_resolution_raster_format|False|N/A|string|Provide the format of the image, for example: landsat-8. -- Value Type: STRING input_low_resolution_raster_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_low_resolution_raster_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 spatial_smoothness|False|N/A|string|Specify the spatial smoothness factor of the NNDiffuse pan-sharpening algorithm. The default value is PIXEL_SIZE_RATIO * 0.62. -- Value Type: FLOAT pixel_size_ratio|False|N/A|string|Specify the pixel size ratio. An integer that defines the pixel size ratio of the low-resolution raster and the high-resolution raster. If PIXEL_SIZE_RATIO is not specified, the value is determined from the metadata of the input rasters. -- Value Type: UINT intensity_smoothness|False|N/A|string|Specify the intensity smoothness factor of the NNDiffuse pan-sharpening algorithm. If INTENSITY_SMOOTHNESS is not specified, the value is set adaptively using local similarity. -- Value Type: FLOAT input_high_resolution_raster|True|N/A|[See ENVIRASTER input type](https://gbdxdocs.digitalglobe.com/docs/envi-task-engine#section-enviraster)|Specify a high-resolution panchromatic raster. -- Value Type: ENVIRASTER input_high_resolution_raster_format|False|N/A|string|Provide the format of the image, for example: landsat-8. -- Value Type: STRING input_high_resolution_raster_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_high_resolution_raster_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 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_NNDiffusePanSharpening 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](http://www.harrisgeospatial.com/docs/home.html) and [ENVI® ENVI_NN Diffuse Pan Sharpening](http://www.harrisgeospatial.com/docs/envinndiffusepansharpeningtask.html). ### Contact If you have any questions or issues with this task, please contact [gbdx-support@digitalglobe.com](mailto:gbdx-support@digitalglobe.com).