パンシャープンの重みの計算 (Compute Pansharpen Weights) (データ管理)

概要

新しいまたはカスタム センサー データのパンシャープンの重みの最適なセットを計算します。

使用法

  • このツールは、パンシャープンの重みの最適なセットを計算し、これをパンシャープンの重みが必要な他のツールで使用します。

  • ラスター プロダクトを入力ラスターとして使用する場合、ラスター プロダクト テンプレート内のバンドの順序が優先されます。

構文

arcpy.management.ComputePansharpenWeights(in_raster, in_panchromatic_image, {band_indexes})
パラメーター説明データ タイプ
in_raster

パンクロマティック バンドを持つマルチスペクトル ラスター。

Mosaic Dataset; Mosaic Layer; Raster Dataset; Raster Layer
in_panchromatic_image

マルチスペクトル ラスターに関連付けられたパンクロマティック バンド。

Raster Layer
band_indexes
(オプション)

パンシャープンの重みのバンドの順序。

ラスター プロダクトを [in_raster] パラメーターとして使用する場合、ラスター プロダクト テンプレート内のバンドの順序が使用されます。

String

派生した出力

名前説明データ タイプ
out_string

出力パンシャープンの重み。

String

コードのサンプル

ComputePansharpenWeights (パンシャープンの重みの計算) の例 1 (Python ウィンドウ)

以下は、ComputePansharpenWeights ツールを実行する Python サンプルです。

import arcpy
arcpy.ComputePansharpenWeights_management(
    "c:/data/rgb.tif", "c:/data/image.tif", "3 2 1 4")
ComputePansharpenWeights (パンシャープンの重みの計算) の例 2 (スタンドアロン スクリプト)

以下は、ComputePansharpenWeights ツールを実行する Python スクリプト サンプルです。

#Run Compute Pan Sharpen Weights tool using the bands 4,3,2,1 

import arcpy

InMSraster = "C:\\Landsat7\\L71046029_02920050705_MTL.txt\Multispectral" 
InPANraster = "C:\\Landsat7\\L71046029_02920050705_MTL.txt\Panchromatic"
band_index = "3 2 1 5"

arcpy.ComputePansharpenWeights_management(InMSraster, InPANraster, band_index)
ComputePansharpenWeights (パンシャープンの重みの計算) の例 3 (ワークフロー スクリプト)

以下は、他のツールで ComputePansharpenWeights の出力を使用する Python スクリプト サンプルです。

#Compute the pansharpening weights and use the results in the 
#create pansharpening tool.

try:
    import arcpy
    
    InRGBraster = "C:\\temp\\rgb.img"
    InPanraster = "C:\\temp\\pan.tif"
    
    #Compute Pan Sharpen Weights  
    out_pan_weight = arcpy.ComputePansharpenWeights_management(
        InRGBraster, InPanraster, "3 2 1 4")
    
    #Get results 
    pansharpen_weights = out_pan_weight.getOutput(0)
    
    #Split the results string for weights of each band
    pansplit = pansharpen_weights.split(";")
    
    #Run the Create pan sharpened raster dataset tool. 
    arcpy.CreatePansharpenedRasterDataset_management(
        InRGBraster, "3", "2", "1", "4", "C:\\temp\\pansharpened_raster.tif",
        InPanraster, "Gram-Schmidt", pansplit[0].split(" ")[1],  
        pansplit[1].split(" ")[1], pansplit[2].split(" ")[1],
        pansplit[3].split(" ")[1])
    
except arcpy.ExecuteError:
    print(arcpy.GetMessages())
except Exception as err:
    print(err[0])

環境

このツールは、ジオプロセシング環境を使用しません。

ライセンス情報

  • Basic: はい
  • Standard: はい
  • Advanced: はい

関連トピック