Skip To Content

Subset

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

概要

Creates a raster object that is a subset of the input multidimensional raster based on selected variables and dimension intervals.

ディスカッション

Use the Subset function to extract a subgroup of variable data from a multidimensional raster object. You can use the subgroup as an input to additional functions. For example, to calculate the average monthly precipitation values for a multidimensional raster that contains both temperature and precipitation data, you can first use Subset to extract the precipitation variable only as a raster object. Then you can use the Aggregate function to compute the monthly average.

The function creates a raster object that is a subgroup of the input, with dimension and variable information defined by the input parameters.

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

構文

Subset (in_raster, {variables}, {dimension_definitions})
パラメーター説明データ タイプ
in_raster

The input multidimensional raster dataset.

Raster
variables
[variables,...]

A variable name or a list of variable names to be included in the output raster. If not specified, all variables will be included.

String
dimension_definitions

The dimension interval used to subset the multidimensional raster. This parameter is passed as a dictionary in which the key-value pairs must use one of the formats as follows:

  • <dimension_name>:value

    For example, to subset variables with the depth dimension only at the depth of 0, use {"depth": 0 }.

  • <dimension_name>:(min, max)

    For example, to subset variables with the depth dimension from a depth of 0 to 100, use {"depth": (-100,0)}.

  • <dimension_name>:[value1, (min, max)]

    For example, to subset variables with the depth dimension from a depth of 0 to 100 and also at a depth of 500, use {"depth": [-500, (-100, 0)]}].

  • <dimension_name>: (from, to, recurrent_interval_size, interval unit)

    For example, to subset variables with the time dimension 1980 to 2000, extracting the first day of every year, use {"StdTime": ('1980-01-01T12:00:00', None, 1, 'year'}.

    To subset variables with the time dimension 1980 to 2000, extracting January of every year, use {"StdTime": ('1980-01-01T12:00:00', 1980-31-01T12:00:00', 1, 'year'}.

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

The output subset multidimensional raster.

コードのサンプル

Subset example

Extract four subsets from climate multidimensional data and save the final subset.

Missing source code file

関連トピック