Skip To Content

Aggregate Multidimensional Raster

Available with Image Analyst license.

Available with Spatial Analyst license.

Summary

Generates a CRF multidimensional raster dataset by aggregating existing multidimensional dataset variables along a dimension.

Usage

  • Supported multidimensional raster datasets include netCDF, GRIB, HDF, and Esri's CRF. Multidimensional mosaic datasets are also supported.

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

  • 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 monthly and at every 5 meters depth up to 100 meters, you might consider using the different interval options for the following scenarios:

    • Aggregate monthly temperature data into yearly data. Choose Interval Keyword and set the keyword to Yearly.
    • 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.
  • By default, the multidimensional raster output will be compressed using LZ77 compression type. It is recommended, however, that you change the compression type to LERC and adjust the Maximum Error based on your 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. It's best to avoid unnecessary accuracy requirements, as they will increase the processing time and storage size.

    To change the compression type, modify the Environment setting.

Syntax

AggregateMultidimensionalRaster(in_multidimensional_raster, dimension, {aggregation_method}, {variables}, {aggregation_def}, {interval_keyword}, {interval_value}, {interval_unit}, {interval_ranges}, {aggregation_function}, {ignore_nodata})
ParameterExplanationData Type
in_multidimensional_raster

The input multidimensional raster dataset.

Raster Dataset; Raster Layer; Mosaic Dataset; Mosaic Layer
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.

  • MEANCalculates the mean of a pixel's values across all slices in the interval. This is the default.
  • MAXIMUMCalculates the maximum value of a pixel across all slices in the interval.
  • MAJORITYCalculates the value that occurred most frequently for a pixel across all slices in the interval.
  • MINIMUMCalculates the minimum value of a pixel across all slices in the interval.
  • MINORITYCalculates the value that occurred least frequently for a pixel across all slices in the interval.
  • MEDIANCalculates the median value of a pixel across all slices in the interval.
  • RANGECalculates the range of values for a pixel across all slices in the interval.
  • STDCalculates the standard deviation of a pixel's values across all slices in the interval.
  • SUMCalculates the sum of a pixel's values across all slices in the interval.
  • VARIETYCalculates the number of unique values of a pixel across all slices in the interval.
  • CUSTOMCalculates the value of a pixel based on a custom raster function.

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

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 your 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.
  • DAILYThe data values will be aggregated into daily time steps.
  • WEEKLYThe data values will be aggregated into weekly time steps.
  • MONTHLYThe data values will be aggregated into monthly time steps.
  • QUARTERLYThe data values will be aggregated into quarterly time steps.
  • YEARLYThe data values will be aggregated into quarterly time steps.
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. 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 over 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.

ValueTable
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 are ignored in the analysis.

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

Return Value

NameExplanationData Type
out_multidimensional_raster

The output CRF (Cloud Raster Format) 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