Anomaly

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

Spatial Analyst のライセンスで利用可能。

概要

Creates a raster object that contains the anomaly pixel values of the input multidimensional raster based on a time-dimension interval and the anomaly calculation method.

ディスカッション

Use the Anomaly function to calculate pixel value anomalies for temporal variables in a multidimensional raster object. For example, if you have daily precipitation data, you can find the pixels that are highly different from the monthly average precipitation values throughout your dataset.

The three mathematical methods for calculating anomaly values with this function are as follows:

  • Difference from mean = x - µ
    • x = pixel value in a slice
    • µ = mean of that pixel's values over a given time interval
  • Percent difference from mean = |x - µ| /[(x + µ)/2]
    • x = pixel value in a slice
    • µ = mean of that pixel's values over a given time interval
    • |x - µ| = absolute value of the difference between the value and the mean
  • Percent of average = x / µ
    • x = pixel value in a slice
    • µ = mean of that pixel's values over a given time interval

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

構文

Anomaly (in_raster, {dimension_name}, {anomaly_type}, {temporal_interval}, {ignore_nodata})
パラメーター説明データ タイプ
in_raster

The input multidimensional raster.

Raster
dimension_name

The dimension name which the anomaly definition will be performed along.

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

String
anomaly_type

Specifies the method used to calculate the anomaly.

  • DIFFERENCE_FROM_MEANCalculates the difference between a pixel value and the mean of that pixel's values across slices defined by the interval. This is the default.
  • PERCENT_DIFFERENCE_FROM_MEANCalculates the percent difference between a pixel value and the mean of that pixel's values across slices defined by the interval.
  • PERCENT_OF_MEANCalculates the percent of the mean.

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

String
temporal_interval

Specifies the temporal interval to use to calculate the average.

  • NoneCalculates the average across all slices for each pixel. This is the default.
  • HOURLYCalculates the hourly average for each pixel.
  • DAILYCalculates the daily average for each pixel.
  • WEEKLYCalculates the weekly average for each pixel.
  • MONTHLYCalculates the monthly average for each pixel.
  • YEARLYCalculates the yearly average for each pixel.

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

String
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 pixel along the given dimension.

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

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

The output anomaly multidimensional raster.

コードのサンプル

Anomaly example

Calculate precipitation anomalies across all slices and for monthly values.

import arcpy
from arcpy.sa import *

arcpy.CheckOutExtension("Spatial")
 
in_raster = Raster("C:/sapyexamples/data/ClimateData_Daily.nc", True)
 
# Choose the precipitation variable 
prcp_raster = Subset(in_raster, variables = 'prcp')
 
# Calculate percent of mean anomalies, 
# where the mean_value is the mean of all slices 
prcp_anomaly = Anomaly(prcp_raster, anomaly_type = 'PERCENT_OF_MEAN') 
 
# Calculate the difference from mean,
# where the mean_value is the mean of each year 
prcp_monthly_anomaly = Anomaly(prcp_raster, temporal_interval = 'YEARLY')