Disponible avec une licence Spatial Analyst.
Synthèse
Defines a Small transformation function which is determined from the midpoint and spread 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
Discussion
The tool that uses the TfSmall object is Rescale by Function.
The equation for the Small transformation function is:
The inputs to the equation are f1, the spread, and f2, the midpoint.
The function values range from 0 to 1, which are then transformed to the evaluation scale.
The spread determines how rapidly the transformation function values increase and decrease around the midpoint. If the midpoint is within the range of the lower and upper thresholds, then the spread determines how rapidly the function values increase to the toScale and decrease to the fromScale. The larger the value, the steeper the function values will be around the midpoint. Said another way, as the spread gets smaller, the transformation function values approach the midpoint more slowly.
The selection of an appropriate spread value is a subjective process that is dependent on the range of the input values. The default value of 5 is a good starting point.
Input values that are negative (below zero) will be assigned to the evaluation value that is assigned to zero.
The Small function is useful when you want the small input values to receive the higher output evaluation values (the smaller values are preferred).
Syntaxe
TfSmall ({midpoint}, {spread}, {lowerThreshold}, {valueBelowThreshold}, {upperThreshold}, {valueAboveThreshold})
Paramètre | Explication | Type de données |
midpoint |
Defines the transition point of the transformation function where the curve becomes more concave for the values lesser than the midpoint and more convex for values greater than the midpoint. Shifting the midpoint greater than the midpoint of the input data alters the transition point, resulting in an increase in the range of the smaller values below the midpoint being more preferred, with the preference increasing at a slower rate. The midpoint value cannot equal 0. (La valeur par défaut est None) | Double |
spread | Defines the spread of the Small transformation function that controls how quickly the function values increase and decrease from the midpoint. The spread generally ranges from 1 to 10; the larger the value results in a steeper distribution around the midpoint. The spread value must be greater than 0. (La valeur par défaut est 5.0) | Double |
lowerThreshold | Defines the starting value at which to begin applying the specified transformation function. The input value corresponding to the lowerThreshold is assigned to the fromScale evaluation scale value on the output raster. Input values below the lowerThreshold are assigned to the valueBelowThreshold and are not considered in the function value range. The lowerThreshold must be less than the upperThreshold. (La valeur par défaut est None) | Double |
valueBelowThreshold | A user-specified value to assign output cell locations with input values below the lowerThreshold. The value for valueBelowThreshold can be float, integer, or NoData. In the tool dialog box, no quotation marks are used around NoData; however, quotation marks are required around "NoData" when scripting. (La valeur par défaut est None) | Variant |
upperThreshold | Defines the ending value at which to stop applying the specified transformation function. The input value corresponding to the upperThreshold is assigned to the toScale evaluation scale value on the output raster. Input values above the upperThreshold are assigned to the valueAboveThreshold and are not considered in the function value range. The lowerThreshold must be less than the upperThreshold. (La valeur par défaut est None) | Double |
valueAboveThreshold | A user-specified value to assign output cell locations with input values above the upperThreshold. The value for valueAboveThreshold can be float, integer, or NoData. In the tool dialog box, no quotation marks are used around NoData; however, quotation marks are required around "NoData" when scripting. (La valeur par défaut est None) | Variant |
Propriétés
Propriété | Explication | Type de données |
midpoint (Lecture et écriture) | The value of the midpoint for the transformation function which defines the transition point of the function curve. | Double |
spread (Lecture et écriture) |
The value of the spread for the transformation function which controls how quickly the function values increase and decrease from the midpoint. | Double |
lowerThreshold (Lecture et écriture) |
The value of the lowerThreshold for the transformation function which defines the starting value at which to begin applying the specified transformation function. | Double |
valueBelowThreshold (Lecture et écriture) |
The value that will be assigned to the output cells whose input values are below the lowerThreshold. | Variant |
upperThreshold (Lecture et écriture) |
The value of the upperThreshold for the transformation function which defines the ending value at which to stop applying the specified function. | Double |
valueAboveThreshold (Lecture et écriture) | The value that will be assigned to the output cells whose input values are above the upperThreshold. | Variant |
Exemple de code
Demonstrates how to create a TfSmall 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("elevation", TfSmall(2475, 4.5, "#", "#", "#", "#"), 1, 10)
outRescale.save("c:/sapyexamples/rescaletfsm1")
Demonstrates how to transform the input data with the RescaleByFunction tool using the TfSmall class.
# Name: TfSmall_Ex_02.py
# Description: Rescales input raster data using a Small function and
# transforms the function values onto a specified evaluation scale.
# Requirements: Spatial Analyst Extension
# Author: esri
# 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 = "elevation"
# Create the TfSmall object
midpoint = 2475
spread = 4.5
lowerthresh = "#"
valbelowthresh = "#"
upperthresh = "#"
valabovethresh = "#"
myTfFunction = TfSmall(midpoint, spread, lowerthresh, valbelowthresh, upperthresh, valabovethresh)
# Set evaluation scale
fromscale = 1
toscale = 10
# Execute RescaleByFunction
outRescale = RescaleByFunction(inRaster, myTfFunction, fromscale, toscale)
# Save the output
outRescale.save("c:/sapyexamples/rescaletfsm2")
Rubriques connexes
Vous avez un commentaire à formuler concernant cette rubrique ?