# ArgStatistics function

## Overview

The ArgStatistics function calculates arguments of the statistics. There are four ArgStatistics methods in this function: ArgMax, ArgMin, ArgMedian, and Duration.

## Notes

In ArgStatistics, all raster bands from every input raster are assigned a 0-based incremental band index, which is first ordered by the input raster index, as shown in the table below, and then by the relative band order within each input raster. For example, if the first input raster (input index 0) has 2 bands: b11 and b12, and the second input raster (input index 1) has 4 bands: b21, b22, b23, and b24, the band index will look like the following table:

BandInput indexBand index

b11

0

0

b12

0

1

b21

1

2

b22

1

3

b23

1

4

b24

1

5

Then, for each pixel, the ArgMax function returns the Band index for which the maximum Pixel value is reached. For example, in the following table, the maximum pixel value is 189, which is stored in Band b21, with the band index 2. So, the ArgMax function will return the value 2.

BandBand indexPixel value

b11

0

33

b12

1

54

b21

2

189

b22

3

145

b23

4

34

b24

5

28

ArgMin is the argument of the minimum, which returns the Band index for which the given pixel attains its minimum value. For example, in the previous table, the minimum Pixel value is 28, which is stored in Band b24, where the Band index is 5. So, the ArgMin function will return the value 5.

The ArgMedian method returns the Band index for which the given pixel attains the median value of values from all bands. Consider values from all bands as an array. After sorting the array in ascending order, the median is the one value separating the lower half of the array from the higher half. More specifically, if the ascend-sorted array has n values, the median is the ith (0-based) value, where:

``i = ( (n-1) / 2 )``

For example, the previous table is sorted in ascending order by pixel values as shown in the following table. The median is 34, and ArgMedian will return a Band index of 4.

BandBand indexPixel value

b24

5

28

b11

0

33

b23

4

34

b12

1

54

b22

3

145

b21

2

189

The Duration method finds the longest consecutive elements in the array, where each element has a value greater than or equal to Min and less than or equal to Max, and returns its length. The Duration method needs the Min and Max input values.

For example, in the previous table, the longest consecutive elements given for Min=34 and Max=189 is [34, 54, 145, 189], so the duration is 4.

## Parameters

ParameterDescription

Rasters

The input rasters upon which you will perform the various statistical methods.

Method

Select the statistics method to calculate the following:

• Arg Max—The argument of the maximum, which returns the Band index for which the given pixel attains its minimum value from all the bands. All raster bands from every input raster are assigned a 0-based incremental band index, which is first ordered by the input raster index, and then by the relative band order within each input raster.
• Arg Min—The argument of the minimum, which returns the Band index for which the given pixel attains its minimum value from all the bands.
• Arg Median—The argument of the median, which returns the Band index for which the given pixel attains the median value of values from all bands.
• Duration—The Duration method finds the longest consecutive elements in the array, where each element has a value greater than or equal to Min and less than or equal to Max, and returns its length.

Undefined Class

A constant input that will be returned when no definitive maximum, minimum, or median can be attained. The most common scenario is when the maximum or minimum value occurs more than once among values from all bands. The default value for the undefined constant is 100.

The undefined class is only applicable when the method is ArgMax, ArgMin, or ArgMedian.

Min

The minimum value that you set is the lowest value equal to or greater than the beginning of the duration.

This input is only applicable when the method is Duration.

Max

The maximum value that you set is the highest value equal to or less than the end of the duration.

This input is only applicable when the method is Duration.

Ignore NoData in calculations

Denotes whether NoData values are ignored in the statistical calculation.

• Checked—The analysis will include all valid pixels in the input rasters and ignore any NoData pixels.
• Unchecked—The analysis will result in NoData if there are any NoData values for the pixels in the input rasters. This is the default.