arcticdem
darts_preprocessing.engineering.arcticdem
¶
Computation of ArcticDEM derived products.
Distance
dataclass
¶
Convenience class to represent a distance in pixels and meters.
__repr__
¶
parse
classmethod
¶
parse(
v: int | float | str, res: float
) -> darts_preprocessing.engineering.arcticdem.Distance
Parse a distance from a string or numeric value.
If the input is a string, it can be in the format of "10px" or "10m". If it is a numeric value, it is interpreted as meters and converted to pixels based on the resolution.
Parameters:
Raises:
-
ValueError
–If the input distance is negative.
-
ValueError
–If the input distance is not a valid string format.
-
TypeError
–If the input distance is not a string, int, or float.
Returns:
-
Distance
(darts_preprocessing.engineering.arcticdem.Distance
) –The parsed distance in pixels and meters.
Source code in darts-preprocessing/src/darts_preprocessing/engineering/arcticdem.py
calculate_aspect
¶
Calculate the aspect of the terrain surface from an ArcticDEM Dataset.
Parameters:
Returns:
-
xarray.Dataset
–xr.Dataset: The input Dataset with the calculated aspect added as a new variable 'aspect'.
Source code in darts-preprocessing/src/darts_preprocessing/engineering/arcticdem.py
calculate_curvature
¶
Calculate the curvature of the terrain surface from an ArcticDEM Dataset.
Parameters:
Returns:
-
xarray.Dataset
–xr.Dataset: The input Dataset with the calculated curvature added as a new variable 'curvature'.
Source code in darts-preprocessing/src/darts_preprocessing/engineering/arcticdem.py
calculate_dissection_index
¶
calculate_dissection_index(
arcticdem_ds: xarray.Dataset, neighborhood_size: int
) -> xarray.Dataset
Calculate the Dissection Index (DI) from an ArcticDEM Dataset.
Parameters:
-
arcticdem_ds
(xarray.Dataset
) –The ArcticDEM Dataset containing the 'dem' variable.
-
neighborhood_size
(int
) –The size of the neighborhood window (in meters) for the calculation.
Returns:
Source code in darts-preprocessing/src/darts_preprocessing/engineering/arcticdem.py
calculate_hillshade
¶
calculate_hillshade(
arcticdem_ds: xarray.Dataset,
azimuth: int = 225,
angle_altitude: int = 25,
) -> xarray.Dataset
Calculate the hillshade of the terrain surface from an ArcticDEM Dataset.
Parameters:
-
arcticdem_ds
(xarray.Dataset
) –The ArcticDEM Dataset containing the 'dem' variable.
-
azimuth
(int
, default:225
) –The azimuth angle of the light source in degrees. Defaults to 225.
-
angle_altitude
(int
, default:25
) –The altitude angle of the light source in degrees. Defaults to 25.
Returns:
-
xarray.Dataset
–xr.Dataset: The input Dataset with the calculated hillshade added as a new variable 'hillshade'.
Source code in darts-preprocessing/src/darts_preprocessing/engineering/arcticdem.py
calculate_slope
¶
Calculate the slope of the terrain surface from an ArcticDEM Dataset.
Parameters:
Returns:
-
xarray.Dataset
–xr.Dataset: The input Dataset with the calculated slope added as a new variable 'slope'.
Source code in darts-preprocessing/src/darts_preprocessing/engineering/arcticdem.py
calculate_terrain_ruggedness_index
¶
calculate_terrain_ruggedness_index(
arcticdem_ds: xarray.Dataset, neighborhood_size: int
) -> xarray.Dataset
Calculate the Terrain Ruggedness Index (TRI) from an ArcticDEM Dataset.
Definition from ESRI: TRI expresses the amount of elevation difference between adjacent cells of a DEM. Using methodology developed by Riley et al (1999) and published in the paper “A Terrain ruggedness Index That Quantifies Topographic heterogeneity”, the tool measures the difference in elevation values from a center cell and eight cells directly surrounding it. Then, the eight elevation differences are squared and averaged. The square root of this average results is a TRI measurement for the center cell. This calculation is then conducted on every cell of the DEM.
Parameters:
-
arcticdem_ds
(xarray.Dataset
) –The ArcticDEM Dataset containing the 'dem' variable.
-
neighborhood_size
(int
) –The neighborhood_size in meters for the TRI calculation.
Returns:
-
xarray.Dataset
–xr.Dataset: The input Dataset with the calculated TRI added as a new variable 'tri'.
Source code in darts-preprocessing/src/darts_preprocessing/engineering/arcticdem.py
calculate_topographic_position_index
¶
calculate_topographic_position_index(
arcticdem_ds: xarray.Dataset,
outer_radius: int,
inner_radius: int,
) -> xarray.Dataset
Calculate the Topographic Position Index (TPI) from an ArcticDEM Dataset.
Parameters:
-
arcticdem_ds
(xarray.Dataset
) –The ArcticDEM Dataset containing the 'dem' variable.
-
outer_radius
(int
) –The outer radius of the annulus kernel in m.
-
inner_radius
(int
) –The inner radius of the annulus kernel in m.
Returns:
-
xarray.Dataset
–xr.Dataset: The input Dataset with the calculated TPI added as a new variable 'tpi'.
Source code in darts-preprocessing/src/darts_preprocessing/engineering/arcticdem.py
calculate_vector_ruggedness_measure
¶
calculate_vector_ruggedness_measure(
arcticdem_ds: xarray.Dataset, neighborhood_size: int
) -> xarray.Dataset
Calculate the Vector Ruggedness Measure (VRM) from an ArcticDEM Dataset.
Implementation of the vector ruggedness measure described in Sappington, J.M., K.M. Longshore, and D.B. Thomson. 2007. Quantifying Landscape Ruggedness for Animal Habitat Analysis: A case Study Using Bighorn Sheep in the Mojave Desert. Journal of Wildlife Management. 71(5): 1419-1426.
Parameters:
-
arcticdem_ds
(xarray.Dataset
) –The ArcticDEM Dataset containing the 'dem' variable.
-
neighborhood_size
(int
) –The size of the neighborhood window (in meters) for the calculation.
Returns:
-
xarray.Dataset
–xr.Dataset: The input Dataset with the calculated VRM added as a new variable 'vrm'.
Source code in darts-preprocessing/src/darts_preprocessing/engineering/arcticdem.py
dissection_index
¶
dissection_index(
agg: xarray.DataArray,
window_size: int = 3,
name: str | None = "dissection_index",
) -> xarray.DataArray
Compute the dissection index of a 2D array.
Parameters:
-
agg
(xarray.DataArray
) –The input data array.
-
window_size
(int
, default:3
) –The size of the window to use for the computation. Defaults to 3.
-
name
(str | None
, default:'dissection_index'
) –The name of the output data array. Defaults to "dissection_index".
Returns: