distance_from_a_to_b#
- rojak.atmosphere.regions.distance_from_a_to_b(from_feature, to_feature, distance_measure, num_dim=3, core_dims=None, sampling=None)[source]#
Distance from feature A to feature B
For example, to find the distance of a contrail forming region to a turbulent region, then
from_regionwould be a boolean array of where the contrail region is andto_regionwould be a boolean array of where turbulence is present.- Parameters:
from_feature (DataArray) – Feature to compute distances from
to_feature (DataArray) – Feature to compute distances to
distance_measure (DistanceMeasure) – How distance is measured
num_dim (int) – Number of dimensions to compute distances over
core_dims (list[str] | None) – Name of core dimensions to iterate over
sampling (float | Sequence[float] | None) – Only applicable for Euclidean distance, see
scipy.ndimage.distance_transform_edt()for details
- Returns:
Array of the closest distance from each point in feature A to feature B
- Return type: