TfPower
サマリー
Defines a Power transformation function which is determined from the shift and exponent shape–controlling parameters as well as the lower and upper threshold that identify the range within which to apply the function.
Learn more about how the parameters affect this transformation function
ディスカッション
The tool that uses the TfPower object is Rescale by Function.
The highest possible function value is limited to one-half of the maximum single-precision floating-point value (FLT_MAX, whose value is 3.402823466 x 1038), the value of which is 1.701411733 x 1038. Any input values that exceed this limit will receive the To scale value on the output raster.
構文
TfPower({shift}, {exponent}, {lowerThreshold}, {valueBelowThreshold}, {upperThreshold}, {valueAboveThreshold})
| 名前 | 説明 | データ タイプ |
|---|---|---|
|
shift (オプション) |
Defines how much each input value is to be shifted. The shift value is subtracted from the input value. The transformation function is applied to the shifted input value to determine the function value. By default, the shift adjusts the function so it begins at the The shift can be positive or negative. The default value is None. |
Double |
|
exponent (オプション) |
The power to raise the input values in the transformation function. As the exponent increases, the preference for the larger input values increases more rapidly. The exponent cannot equal 0 or 1. The default value is None. |
Double |
|
lowerThreshold (オプション) |
Defines the starting value at which to begin applying the specified transformation function. The input value corresponding to the The The default value is None. |
Double |
|
valueBelowThreshold (オプション) |
A user-specified value to assign output cell locations with input values below the The value for The default value is None. |
Variant |
|
upperThreshold (オプション) |
Defines the ending value at which to stop applying the specified transformation function. The input value corresponding to the The The default value is None. |
Double |
|
valueAboveThreshold (オプション) |
A user-specified value to assign output cell locations with input values above the The value for The default value is None. |
Variant |
プロパティ
| 名前 | 説明 | データ タイプ |
|---|---|---|
|
shift (読み取り/書き込み) |
The value of the |
Double |
|
exponent (読み取り/書き込み) |
The value of the exponent to raise the input values in the transformation function. |
Double |
|
lowerThreshold (読み取り/書き込み) |
The value of the |
Double |
|
valueBelowThreshold (読み取り/書き込み) |
The value that will be assigned to the output cells whose input values are below the |
Variant |
|
upperThreshold (読み取り/書き込み) |
The value of the |
Double |
|
valueAboveThreshold (読み取り/書き込み) |
The value that will be assigned to the output cells whose input values are above the |
Variant |
コードのサンプル
Demonstrates how to create a TfPower class and use it in the RescaleByFunction tool within the Python window.
import arcpy
from arcpy.sa import *
from arcpy import env
env.workspace = "c:/sapyexamples/data"
outRescale = RescaleByFunction("distroads", TfPower(-2, 0.27, "#", "#", "#", "#"), 1, 10)
outRescale.save("c:/sapyexamples/rescaletfpo1")
Demonstrates how to transform the input data with the RescaleByFunction tool using the TfPower class.
# Name: TfPower_Ex_02.py
# Description: Rescales input raster data using an Power function and
# transforms the function values onto a specified evaluation scale.
# Requirements: Spatial Analyst extension
# Import system modules
import arcpy
from arcpy import env
from arcpy.sa import *
# Set environment settings
env.workspace = "C:/sapyexamples/data"
# Set local variables
inRaster = "distroads"
# Create the TfPower object
shift = -2
exponent = 0.27
lowerthresh = "#"
valbelowthresh = "#"
upperthresh = "#"
valabovethresh = "#"
myTfFunction = TfPower(shift, exponent, lowerthresh, valbelowthresh, upperthresh, valabovethresh)
# Set evaluation scale
fromscale = 1
toscale = 10
# Run RescaleByFunction
outRescale = RescaleByFunction(inRaster, myTfFunction, fromscale, toscale)
# Save the output
outRescale.save("c:/sapyexamples/rescaletfpo2")