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 and at every 5 meters depth up to 100 meters, you can use the different interval options for the following scenarios:
- Aggregate daily temperature data into monthly data, where 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, where 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 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.
By default, the multidimensional raster output will be compressed using the 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})
Parameter | Explanation | Data 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.
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.
| 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.
| 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.
| 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 are ignored in the analysis.
| Boolean |
Return Value
Name | Explanation | Data Type |
out_multidimensional_raster | The output Cloud Raster Format (CRF) multidimensional raster dataset. | Raster |
Code sample
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")
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")
Environments
Licensing information
- Basic: Requires Spatial Analyst or Image Analyst
- Standard: Requires Spatial Analyst or Image Analyst
- Advanced: Requires Spatial Analyst or Image Analyst