Aggregate Multidimensional Raster (Spatial Analyst)

Available with Image Analyst license.

Available with Spatial Analyst license.

Summary

Generates a multidimensional raster dataset by combining existing multidimensional raster variables along a dimension.

Usage

  • Use the Aggregation Definition parameter to choose an interval using a keyword, a value, or a range of values. For example, if you have 30 years of sea surface temperature data, collected daily at every 5 meters depth up to 100 meters, you can use the various interval options for the following scenarios:

    • Aggregate daily temperature data into monthly data in which the result is a multidimensional raster with 12 time slices, and each slice is the aggregate of each month across all the years. Choose Interval Keyword and set the keyword to Recurring Monthly.
    • Aggregate daily temperature data into monthly data in which the result is a multidimensional raster with 360 slices, or 12 time slices per year (30 years x 12 months = 360 slices). Choose Interval Keyword and set the keyword to Monthly.
    • Aggregate monthly temperature data into 4-month intervals. Choose Interval Value, set Value Interval to 4, and set Unit to Months.
    • Aggregate temperature data from 0 to 25 meters, then from 25 to 50 meters, then from 50 to 100 meters. Choose Interval Ranges and specify minimum and maximum depths as 0 25; 25 50; 50 100.
  • Supported multidimensional raster datasets include Cloud Raster Format (CRF), multidimensional mosaic datasets, or multidimensional raster layers generated by netCDF, GRIB, or HDF format files.

  • This tool produces a multidimensional raster dataset in Cloud Raster Format (CRF). Currently, no other output formats are supported.

  • By default, the multidimensional raster output will be compressed using the LZ77 compression type. However, it is recommended that you change the compression type to LERC and adjust the maximum error value based on the data. For example, if you expect the results of the analysis to be accurate to three decimal places, use 0.001 for the maximum error value. Avoid unnecessary accuracy requirements, as they will increase the processing time and storage size.

    To change the compression type, modify the Compression environment setting.

Parameters

LabelExplanationData Type
Input Multidimensional Raster

The input multidimensional raster dataset.

Raster Dataset; Raster Layer; Mosaic Dataset; Mosaic Layer; Image Service; File
Dimension

The aggregation dimension. This is the dimension along which the variables will be aggregated.

String
Aggregation Method
(Optional)

Specifies the mathematical method that will be used to combine the aggregated slices in an interval.

When the method is set to Custom, the Aggregation Function parameter becomes active.

  • MeanThe mean of a pixel's values will be calculated across all slices in the interval. This is the default.
  • MaximumThe maximum value of a pixel will be calculated across all slices in the interval.
  • MajorityThe pixel value that occurred most frequently will be calculated across all slices in the interval.
  • MinimumThe minimum value of a pixel will be calculated across all slices in the interval.
  • MinorityThe pixel value that occurred least frequently will be calculated across all slices in the interval.
  • MedianThe median value of a pixel will be calculated across all slices in the interval.
  • PercentileThe percentile of values for a pixel will be calculated across all slices in the interval. The 90th percentile is calculated by default. You can specify other values (from 0 to 100) using the Percentile value parameter.
  • RangeThe range of values for a pixel will be calculated across all slices in the interval.
  • Standard DeviationThe standard deviation of a pixel's values will be calculated across all slices in the interval.
  • SumThe sum of a pixel's values will be calculated across all slices in the interval.
  • VarietyThe number of unique pixel values will be calculated across all slices in the interval.
  • CustomThe pixel value will be calculated based on a custom raster function.
String
Variables [Dimension Info] (Description)
(Optional)

The variable or variables that will be aggregated along the given dimension. If no variable is specified, all variables with the selected dimension will be aggregated.

For example, to aggregate daily temperature data into monthly average values, specify temperature as the variable to be aggregated. If you do not specify any variables and you have both daily temperature and daily precipitation variables, both variables will be aggregated into monthly averages and the output multidimensional raster will include both variables.

String
Aggregation Definition
(Optional)

Specifies the dimension interval for which the data will be aggregated.

  • AllThe data values will be aggregated across all slices. This is the default.
  • Interval KeywordThe variable data will be aggregated using a commonly known interval.
  • Interval ValueThe variable data will be aggregated using a user-specified interval and unit.
  • Interval RangesThe variable data will be aggregated between specified pairs of values or dates.
String
Keyword Interval
(Optional)

Specifies the keyword interval that will be used when aggregating along the dimension. This parameter is required when the Aggregation Definition parameter is set to Interval Keyword and the aggregation must be across time.

  • HourlyThe data values will be aggregated into hourly time steps, and the result will include every hour in the time series.
  • DailyThe data values will be aggregated into daily time steps, and the result will include every day in the time series.
  • WeeklyThe data values will be aggregated into weekly time steps, and the result will include every week in the time series.
  • DekadlyThe data values will be aggregated into 3 periods of 10 days each. The last period can contain more or fewer than 10 days. The output will include 3 slices for each month.
  • PentadlyThe data values will be aggregated into 6 periods of 5 days each. The last period can contain more or fewer than 5 days. The output will include 6 slices for each month.
  • MonthlyThe data values will be aggregated into monthly time steps, and the result will include every month in the time series.
  • QuarterlyThe data values will be aggregated into quarterly time steps, and the result will include every quarter in the time series.
  • YearlyThe data values will be aggregated into yearly time steps, and the result will include every year in the time series.
  • Recurring dailyThe data values will be aggregated into daily time steps, and the result will include one aggregated value per Julian day. The output will include, at most, 366 daily time slices.
  • Recurring weeklyThe data values will be aggregated into weekly time steps, and the result will include one aggregated value per week. The output will include, at most, 53 weekly time slices.
  • Recurring monthlyThe data values will be aggregated into monthly time steps, and the result will include one aggregated value per month. The output will include, at most, 12 monthly time slices.
  • Recurring quarterlyThe data values will be aggregated into quarterly time steps, and the result will include one aggregated value per quarter. The output will include, at most, 4 quarterly time slices.
String
Value Interval
(Optional)

The size of the interval that will be used for the aggregation. This parameter is required when the Aggregation Definition parameter is set to Interval Value.

For example, to aggregate 30 years of monthly temperature data into 5-year increments, enter 5 as the Value Interval, and specify Unit as Years.

Double
Unit
(Optional)

The unit that will be used for the Value Interval parameter. This parameter is required when the Dimension parameter is a time field and the Aggregation Definition parameter is set to Interval Value.

If you are aggregating anything other than time, this option will not be available and the unit for the interval value will match the variable unit of the input multidimensional raster data.

  • HoursThe data values will be aggregated into hourly time slices at the interval provided.
  • DaysThe data values will be aggregated into daily time slices at the interval provided.
  • WeeksThe data values will be aggregated into weekly time slices at the interval provided.
  • MonthsThe data values will be aggregated into monthly time slices at the interval provided.
  • YearsThe data values will be aggregated into yearly time slices at the interval provided.
String
Range
(Optional)

Interval ranges specified in a value table will be used to aggregate groups of values. The value table consists of pairs of minimum and maximum range values, with data type Double or Date.

This parameter is required when the Aggregation Definition parameter is set to Interval Ranges.

Value Table
Aggregation Function
(Optional)

A custom raster function that will be used to compute the pixel values of the aggregated rasters. The input is a raster function JSON object or an .rft.xml file created from a function chain or a custom Python raster function.

This parameter is required when the Aggregation Method parameter is set to Custom.

File; String
Ignore NoData
(Optional)

Specifies whether NoData values will be ignored in the analysis.

  • Checked—The analysis will include all valid pixels along a given dimension and ignore NoData pixels. This is the default.
  • Unchecked—The analysis will result in NoData if there are NoData values for the pixels along the given dimension.
Boolean
Dimensionless
(Optional)

Specifies whether the layer will have dimension values. This parameter is only active if a single slice is selected to create a layer.

  • Checked—The layer will not have dimension values.
  • Unchecked—The layer will have dimension values. This is the default.

Boolean
Percentile value
(Optional)

The percentile to calculate. The default is 90, indicating the 90th percentile.

The values can range from 0 to 100. The 0th percentile is essentially equivalent to the minimum statistic, and the 100th percentile is equivalent to maximum. A value of 50 will produce essentially the same result as the median statistic.

This parameter is only available if the Statistics type parameter is set to Percentile.

Double
Percentile interpolation type
(Optional)

Specifies the method of percentile interpolation that will be used when there is an even number of values from the input raster to be calculated.

  • NearestThe nearest available value to the desired percentile will be used. In this case, the output pixel type will be the same as that of the input value raster.
  • LinearThe weighted average of the two surrounding values from the desired percentile will be used. In this case, the output pixel type will be floating point.
String

Return Value

LabelExplanationData Type
Output Multidimensional Raster

The output Cloud Raster Format (CRF) multidimensional raster dataset.

Raster

AggregateMultidimensionalRaster(in_multidimensional_raster, dimension, {aggregation_method}, {variables}, {aggregation_def}, {interval_keyword}, {interval_value}, {interval_unit}, {interval_ranges}, {aggregation_function}, {ignore_nodata}, {dimensionless}, {percentile_value}, {percentile_interpolation_type})
NameExplanationData Type
in_multidimensional_raster

The input multidimensional raster dataset.

Raster Dataset; Raster Layer; Mosaic Dataset; Mosaic Layer; Image Service; File
dimension

The aggregation dimension. This is the dimension along which the variables will be aggregated.

String
aggregation_method
(Optional)

Specifies the mathematical method that will be used to combine the aggregated slices in an interval.

  • MEANThe mean of a pixel's values will be calculated across all slices in the interval. This is the default.
  • MAXIMUMThe maximum value of a pixel will be calculated across all slices in the interval.
  • MAJORITYThe pixel value that occurred most frequently will be calculated across all slices in the interval.
  • MINIMUMThe minimum value of a pixel will be calculated across all slices in the interval.
  • MINORITYThe pixel value that occurred least frequently will be calculated across all slices in the interval.
  • MEDIANThe median value of a pixel will be calculated across all slices in the interval.
  • PERCENTILEThe percentile of values for a pixel will be calculated across all slices in the interval. The 90th percentile is calculated by default. You can specify other values (from 0 to 100) using the Percentile value parameter.
  • RANGEThe range of values for a pixel will be calculated across all slices in the interval.
  • STDThe standard deviation of a pixel's values will be calculated across all slices in the interval.
  • SUMThe sum of a pixel's values will be calculated across all slices in the interval.
  • VARIETYThe number of unique pixel values will be calculated across all slices in the interval.
  • CUSTOMThe pixel value will be calculated based on a custom raster function.

When aggregation_method is set to CUSTOM, the aggregation_function parameter becomes enabled.

String
variables
[variables,...]
(Optional)

The variable or variables that will be aggregated along the given dimension. If no variable is specified, all variables with the selected dimension will be aggregated.

For example, to aggregate daily temperature data into monthly average values, specify temperature as the variable to be aggregated. If you do not specify any variables and you have both daily temperature and daily precipitation variables, both variables will be aggregated into monthly averages and the output multidimensional raster will include both variables.

String
aggregation_def
(Optional)

Specifies the dimension interval for which the data will be aggregated.

  • ALLThe data values will be aggregated across all slices. This is the default.
  • INTERVAL_KEYWORDThe variable data will be aggregated using a commonly known interval.
  • INTERVAL_VALUEThe variable data will be aggregated using a user-specified interval and unit.
  • INTERVAL_RANGESThe variable data will be aggregated between specified pairs of values or dates.
String
interval_keyword
(Optional)

Specifies the keyword interval that will be used when aggregating along the dimension. This parameter is required when the aggregation_def parameter is set to INTERVAL_KEYWORD and the aggregation must be across time.

  • HOURLYThe data values will be aggregated into hourly time steps, and the result will include every hour in the time series.
  • DAILYThe data values will be aggregated into daily time steps, and the result will include every day in the time series.
  • WEEKLYThe data values will be aggregated into weekly time steps, and the result will include every week in the time series.
  • DEKADLYThe data values will be aggregated into 3 periods of 10 days each. The last period can contain more or fewer than 10 days. The output will include 3 slices for each month.
  • PENTADLYThe data values will be aggregated into 6 periods of 5 days each. The last period can contain more or fewer than 5 days. The output will include 6 slices for each month.
  • MONTHLYThe data values will be aggregated into monthly time steps, and the result will include every month in the time series.
  • QUARTERLYThe data values will be aggregated into quarterly time steps, and the result will include every quarter in the time series.
  • YEARLYThe data values will be aggregated into yearly time steps, and the result will include every year in the time series.
  • RECURRING_DAILYThe data values will be aggregated into daily time steps, and the result will include one aggregated value per Julian day. The output will include, at most, 366 daily time slices.
  • RECURRING_WEEKLYThe data values will be aggregated into weekly time steps, and the result will include one aggregated value per week. The output will include, at most, 53 weekly time slices.
  • RECURRING_MONTHLYThe data values will be aggregated into monthly time steps, and the result will include one aggregated value per month. The output will include, at most, 12 monthly time slices.
  • RECURRING_QUARTERLYThe data values will be aggregated into quarterly time steps, and the result will include one aggregated value per quarter. The output will include, at most, 4 quarterly time slices.
String
interval_value
(Optional)

The size of the interval that will be used for the aggregation. This parameter is required when the aggregation_def parameter is set to INTERVAL_VALUE.

For example, to aggregate 30 years of monthly temperature data into 5-year increments, enter 5 as the interval_value, and specify interval_unit as YEARS.

Double
interval_unit
(Optional)

The unit that will be used for the interval_value parameter. This parameter is required when the dimension parameter is set to a time field and the aggregation_def parameter is set to INTERVAL_VALUE.

If you are aggregating anything other than time, this option will not be available and the unit for the interval value will match the variable unit of the input multidimensional raster data.

  • HOURSThe data values will be aggregated into hourly time slices at the interval provided.
  • DAYSThe data values will be aggregated into daily time slices at the interval provided.
  • WEEKSThe data values will be aggregated into weekly time slices at the interval provided.
  • MONTHSThe data values will be aggregated into monthly time slices at the interval provided.
  • YEARSThe data values will be aggregated into yearly time slices at the interval provided.
String
interval_ranges
[interval_ranges,...]
(Optional)

Interval ranges specified in a value table will be used to aggregate groups of values. The value table consists of pairs of minimum and maximum range values, with data type Double or Date.

This parameter is required when the aggregation_def parameter is set to INTERVAL_RANGE.

Value Table
aggregation_function
(Optional)

A custom raster function that will be used to compute the pixel values of the aggregated rasters. The input is a raster function JSON object or an .rft.xml file created from a function chain or a custom Python raster function.

This parameter is required when the aggregation_method parameter is set to CUSTOM.

File; String
ignore_nodata
(Optional)

Specifies whether NoData values will be ignored in the analysis.

  • DATAThe analysis will include all valid pixels along a given dimension and ignore NoData pixels. This is the default.
  • NODATAThe analysis will result in NoData if there are NoData values for the pixels along the given dimension.
Boolean
dimensionless
(Optional)

Specifies whether the layer will have dimension values. This parameter is only enabled if a single slice is selected to create a layer.

  • NO_DIMENSIONS The layer will not have dimension values.
  • DIMENSIONSThe layer will have dimension values. This is the default.
Boolean
percentile_value
(Optional)

The percentile to calculate. The default is 90, indicating the 90th percentile.

The values can range from 0 to 100. The 0th percentile is essentially equivalent to the minimum statistic, and the 100th percentile is equivalent to maximum. A value of 50 will produce essentially the same result as the median statistic.

This parameter is only supported if the statistics_type parameter is set to PERCENTILE.

Double
percentile_interpolation_type
(Optional)

Specifies the method of percentile interpolation that will be used when there is an even number of values from the input raster to be calculated.

  • NEARESTThe nearest available value to the desired percentile will be used. In this case, the output pixel type will be the same as that of the input value raster.
  • LINEARThe weighted average of the two surrounding values from the desired percentile will be used. In this case, the output pixel type will be floating point.
String

Return Value

NameExplanationData Type
out_multidimensional_raster

The output Cloud Raster Format (CRF) multidimensional raster dataset.

Raster

Code sample

AggregateMultidimensionalRaster example 1 (Python window)

This example aggregates temperature data into yearly data with the average temperature values.

import arcpy
from arcpy import env
from arcpy.sa import *
env.workspace = "C:/sapyexamples/data"
arcpy.CheckOutExtension("Spatial")
outAggMultidim = AggregateMultidimensionalRaster("C:/sapyexamples/data/climateData.crf", 
	"StdTime", "MEAN", "temperature", "INTERVAL_KEYWORD", "YEARLY", 
	"", "", "", "", "DATA")
outAggMultidim.save("C:/sapyexamples/output/YearlyTemp.crf")
AggregateMultidimensionalRaster example 2 (stand-alone script)

This example aggregates daily precipitation and temperature data into monthly data with the maximum precipitation and temperature values.

# Name: AggregateMultidimensionalRaster_Ex_02.py
# Description: Aggregates daily precipitation and temperature data into
#           monthly data with the maximum precipitation and temperature values
# 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"

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

""""
Usage: out_multidimensional_raster = AggregateMultidimensionalRaster(in_multidimensional_raster, dimension,
                                    {aggregation_method}, {variables}, 
                                    {aggregation_def}, {interval_keyword}, {ignore_nodata})
"""

# Define input parameters
inputFile = "C:/sapyexamples/data/dailyclimateData.crf"
dimensionName = "StdTime"
aggregationMethod = "Maximum"
variables = "temperature;precipitation"
aggregationDefinition = "INTERVAL_KEYWORD"
keyword = "MONTHLY"
ignore_nodata = "DATA"

# Execute AggregateMultidimensionalRaster
outAggMultidim = AggregateMultidimensionalRaster(inputFile, dimensionName,
	aggregationMethod, variables, aggregationDefinition, keyword, "", "", "", "",
	ignore_nodata)

# Save the output
outAggMultidim.save("C:/sapyexamples/output/monthlymaxtemp.crf")

Licensing information

  • Basic: Requires Spatial Analyst or Image Analyst
  • Standard: Requires Spatial Analyst or Image Analyst
  • Advanced: Requires Spatial Analyst or Image Analyst

Related topics