Skip to content

interpolators

PhaseInterpolator

Bases: ScalarInterpolator

Interpolate and smooth LAT phase values over spatial coordinates.

period: float | None = period instance-attribute

sigma: float = sigma instance-attribute

__init__(period=None, sigma=1.0)

Initialize the PhaseInterpolator object.

Parameters:

Name Type Description Default
period float | None

Period of the phase signal. Defaults to None.

None
sigma float

Standard deviation of the kernel for smoothing. Defaults to 1.0.

1.0

apply(scalars, coords)

Smooth LAT values based on spatial coordinates using a Gaussian kernel.

Parameters:

Name Type Description Default
scalars ndarray

Array of LAT values, possibly containing NaNs.

required
coords ndarray

Array of spatial coordinates with shape (N, 3).

required

Returns:

Type Description
ndarray

np.ndarray: Smoothed and interpolated LAT values.

ScalarInterpolator

Bases: ABC

Base class for scalar field interpolation.

apply(scalars, coords) abstractmethod

Apply interpolation to scalar values.

Parameters:

Name Type Description Default
scalars ndarray

Array of scalar values to interpolate.

required
coords ndarray

Array of spatial coordinates corresponding to scalars.

required

Returns:

Type Description
ndarray

np.ndarray: Interpolated scalar values.