DistancePairing#

class rojak.atmosphere.feature_composite.DistancePairing(max_distance_km, *, shape='circle')[source]#

Pair each observation with every centre at the same time step within max_distance_km of it.

With shape="circle", the great-circle (haversine) distance to the centre is at most max_distance_km. With shape="square", |x_km| and |y_km| in the centre’s km frame are both at most max_distance_km, the support of the gridded composites. An observation can be paired with several centres.

Compatible with POINT features only: neighbouring centres along a LINE feature would count the same observation many times.

max_distance_km#

Largest distance in km, or half the side of the square. Positive.

Type:

float

shape#

Whether the distance is great-circle or per axis of the km frame.

Type:

Literal[“circle”, “square”]

Raises:

ValueError – If max_distance_km is not positive, or shape is neither "circle" nor "square".

Parameters:
  • max_distance_km (float)

  • shape (Literal['circle', 'square'])

__init__(max_distance_km, *, shape='circle')[source]#
Parameters:
  • max_distance_km (float)

  • shape (Literal['circle', 'square'])

Return type:

None

Methods

__init__(max_distance_km, *[, shape])

check_compatible(feature)

Raise if feature is a LINE feature.

pair(observations, feature_chunk, chunk, *, ...)

Pair each observation with every centre within the distance; see PairingStrategy.pair().

Attributes