ska_sdp_instrumental_calibration.data_managers.baseline_expression module

class ska_sdp_instrumental_calibration.data_managers.baseline_expression.BaselinesExpression(left, right, antenna_parser=<function BaselinesExpression.<lambda>>)[source]

Bases: object

Parses and evaluates baseline selection expressions.

This class handles logic for exluding the baselines based on string expressions representing antenna ranges.

left: str

The left-hand side of the baseline expression (e.g., "1" or "1~5").

right: str

The right-hand side of the baseline expression.

antenna_parser: Callable

Function to parse antenna strings into integers. Defaults to lambda x: int(x).

predicate(baselines)[source]

Calculate a boolean mask for the provided baselines.

Determines which of the input baselines match the left and right antenna criteria defined in this expression.

Parameters:

baselines (Iterable[Tuple[int, int]]) -- A collection of baselines (tuples of antenna IDs) to evaluate.

Return type:

ndarray

Returns:

A boolean array of the same length as baselines, where True indicates the baseline does not match the expression