GenerateTrend

Image Analyst ライセンスで利用できます。

概要

多次元ラスターの 1 つまたは複数の変数のディメンションに沿って各ピクセルのトレンドを推定します。

ディスカッション

For more information about how this function works, see the Generate Trend raster function.

The referenced raster dataset for the raster object is temporary. To make it permanent, you can call the raster object's save method.

構文

GenerateTrend (raster, dimension_name, {regression_type}, {cycle_length}, {cycle_unit}, {harmonic_frequency}, {polynomial_order}, {ignore_nodata}, {rmse}, {r2}, {slope_p_value}, {seasonal_period})
パラメーター説明データ タイプ
raster

The input multidimensional raster.

Raster
dimension_name

The name of the dimension along which a trend will be extracted for the variable or variables selected in the analysis.

String
regression_type

Specifies the type of line to be used to fit to the pixel values along a dimension.

  • LINEARVariable pixel values will be fitted along a linear trend line. This is the default.
  • HARMONICVariable pixel values will be fitted along a harmonic trend line.
  • POLYNOMIALVariable pixel values will be fitted along a second-order polynomial trend line.
  • MANN-KENDALLVariable pixel values will be evaluated for monotonic trend using the Mann-Kendall trend test.
  • SEASONAL-KENDALLVariable pixel values will be evaluated for monotonic trend using the Seasonal-Kendall trend test.

(デフォルト値は次のとおりです LINEAR)

String
cycle_length

The length of periodic variation to model. This argument is required when regression_type is set to HARMONIC. For example, leaf greenness often has one strong cycle of variation in a single year, so cycle_length is 1 year. Hourly temperature data has one strong cycle of variation throughout a single day, so the cycle_length is 1 day. The default value is 1.

(デフォルト値は次のとおりです 1)

Integer
cycle_unit

Specifies the time unit to be used for the length of a harmonic cycle.

  • DAYSThe unit for the length of the harmonic cycle is days.
  • YEARSThe unit for the length of the harmonic cycle is years. This is the default.

(デフォルト値は次のとおりです YEARS)

String
harmonic_frequency

The number of models to use in the trend fitting when the regression_type is HARMONIC. The default is 1, or one harmonic cycle per year.

This argument is only included in the trend analysis when the dimension being analyzed is time.

(デフォルト値は次のとおりです 1)

Integer
polynomial_order

The polynomial order number to use in the trend fitting when the regression_type is POLYNOMIAL. The default is 2, or second-order polynomial.

This argument is only included in the trend analysis when the dimension being analyzed is time.

(デフォルト値は次のとおりです 2)

Integer
ignore_nodata

Specifies whether NoData values are ignored in the analysis.

  • True—The analysis will include all valid pixels along a given dimension and ignore any NoData pixels. This is the default.
  • False—The analysis will result in NoData if there are any NoData values for the pixels along the given dimension.

(デフォルト値は次のとおりです True)

Boolean
rmse

Specifies whether the root mean square error (RMSE) of the trend fit line will be calculated.

  • True—The RMSE will be calculated. This is the default.
  • False—The RMSE will not be calculated.

(デフォルト値は次のとおりです True)

Boolean
r2

Specifies whether the R-squared goodness-of-fit statistic for the trend fit line will be calculated.

  • True—The R-squared value will be calculated.
  • False—The R-squared value will not be calculated. This is the default.

(デフォルト値は次のとおりです False)

Boolean
slope_p_value

Specifies whether the p-value statistic for the slope coefficient of the trend line will be calculated.

  • True—The p-value will be calculated.
  • False—The p-value will not be calculated. This is the default.

(デフォルト値は次のとおりです False)

Boolean
seasonal_period

Specifies the unit to use for seasonal period. This is required when the regression_type argument is set to SEASONAL-KENDALL.

  • DAYSThe unit for the length of the seasonal period is days. This is the default.
  • MONTHSThe unit for the length of the seasonal period is months.

(デフォルト値は次のとおりです DAYS)

String
戻り値
データ タイプ説明
Raster

The output raster.

コードのサンプル

GenerateTrendRaster example

This example calculates the harmonic trend fit along an NDVI time series.

# Import system modulesimport arcpy
import arcpy
from arcpy.ia import *

# Check out the ArcGIS Image Analyst extension license
arcpy.CheckOutExtension("ImageAnalyst")

# Set the local variables
in_multidimensional_raster = "C:/data/ndvi_time_series.crf"
dimension_name = "StdTime"
regression_type = "HARMONIC"
cycle_length = 1
cycle_unit = "YEARS"
harmonic_frequency = 1
polynomial_order = None
ignore_nodata = True

rmse = True
r2 = False
slope_p_value = False
seasonal_period = None

# Apply GenerateTrendRaster function
trend_raster = arcpy.ia.GenerateTrend(in_multidimensional_raster,
                dimension_name, regression_type, cycle_length, cycle_unit, 
				harmonic_frequency, polynomial_order, ignore_nodata, rmse,
				r2, slope_p_value, seasonal_period)

# Save the output
trend_raster.save("C:/arcpyExamples/outputs/ndvi_trend_raster.crf")