Skip to main content

GeometricMedian

Краткая информация

Вычисляет геометрическую медиану по пикселам во временном ряду многоканального изображения.

Обсуждение

Более подробно о работе функции см. статью о растровой функции Геометрическая медиана.

Указанный набор растровых данных является временным для растрового объекта. Чтобы сделать его постоянным, вы можете вызвать метод растрового объекта save.

Синтаксис

GeometricMedian(rasters, epsilon, {max_iteration}, {extent_type}, {cellsize_type})

Параметр Объяснение Тип данных

rasters

The input multiband rasters.

List

epsilon

The convergence value between two consecutive iterations. When epsilon is less than or equal to the specified value, the iteration will stop, and the result of the last iteration will be used.

(Значение по умолчанию — 0.001)

Double

max_iteration

The maximum number of iterations to complete. The computation will end once this value is reached, regardless of the epsilon setting.

(Значение по умолчанию — 10)

Integer

extent_type

Specifies the processing extent for the output raster.

  • FirstOf—Use the extent of the first input raster to determine the processing extent.

  • IntersectionOf—Use the extent of the overlapping pixels to determine the processing extent. This is the default.

  • UnionOf—Use the extent of all the rasters to determine the processing extent.

  • LastOf—Use the extent of the last input raster to determine the processing extent.

(Значение по умолчанию — IntersectionOf)

String

cellsize_type

Specifies the cell size to use in the output raster.

  • FirstOf—Use the first cell size of the input rasters. This is the default.

  • MinOf—Use the smallest cell size of all the input rasters.

  • MaxOf—Use the largest cell size of all the input rasters. This is the default.

  • MeanOf—Use the mean cell size of all the input rasters.

  • LastOf—Use the last cell size of the input rasters.

(Значение по умолчанию — MaxOf)

String

Возвращаемое значение

Тип данных Объяснение

Raster

Выходной растровый объект.

Пример кода

Пример GeometricMedian

В этом примере вычисляется геометрическая медиана коллекции изображений Landsat.

# Import system modules
import arcpy
from arcpy.ia import *

# Construct a collection from a mosaic dataset
rc = RasterCollection(r'C:\data.gdb\time_series_landsat_images')

# Run
geomedian = arcpy.ia.GeometricMedian(rc, {"epsilon": 0.001, "max_iteration": 5, "extent_type":"UnionOf", "CellsizeType": "FirstOf"})

# Save the output
geomedian.save("C:/arcpyExamples/outputs/geomedian_raster.crf")