RFI Signal Components

class tabascal.components.rfi_signal.BaseGPRFI[source]
build_mask_constants() dict[source]

Constants the signal mask needs, or {} when nothing is masked.

Kept separate from each component’s own build_constants so the None-check lives in one place. The mask is a constant rather than a closed-over array because it is indexed by n_rfi: distributed.py shards constants named in RFI_AXIS_NAMES along the source axis, and a captured array would instead be replicated, pulling rfi_A back to a full copy on every device.

build_masked_signal() Callable[source]

Return the signal-domain mask to apply at the end of a forward.

Sibling of masked_forward_transform(), which zeroes the padded dummy sources in the latent k-space. A time window cannot be expressed there: zeroing global Fourier modes cannot produce a time-limited signal, so the elevation mask has to be applied to rfi_A after latent_to_signal.

Both follow the same contract – a base-class hook every component applies unconditionally, which degrades to the identity when there is nothing to mask (no elevation cut here, a single device there). Resolving the branch here rather than inside the traced function means a run without an elevation cut emits no mask op at all and pays nothing.

The returned function takes any array whose leading axis is n_rfi and whose trailing axis is n_time_fine, so a component that keeps the antenna axis broadcast rather than materialised can mask the smaller (n_rfi, n_freq_fine, n_time_fine) array before expanding it.

setup(tab_config: TabConfig)[source]

Initialize component with configuration

class tabascal.components.rfi_signal.ComplexRFIConstAnt[source]
build_constants()[source]

Return arrays that do not change during the forward pass.

Returns a dict of array_name -> array_value. These will be stored in constants as “_c/<ClassName>/array_name” by Model.__init__.

build_forward()[source]

Return pure, JIT-compatible function

build_set_params()[source]

Build parameter sampling function (optional)

setup(tab_config)[source]

All validation and error-prone operations here

validate_and_test()[source]

Call this before using in JIT context

class tabascal.components.rfi_signal.ComplexRFIVarAnt[source]
build_constants()[source]

Return arrays that do not change during the forward pass.

Returns a dict of array_name -> array_value. These will be stored in constants as “_c/<ClassName>/array_name” by Model.__init__.

build_forward()[source]

Return pure, JIT-compatible function

The latent-to-signal transform is scanned over antennas rather than vmapped. A double vmap over (n_rfi, n_ant) lowers to a single batched cuFFT of n_rfi * n_ant transforms on the zero-padded grid, and cuFFT sizes its plan work area for the whole batch. At 32 channels that reached a 12.6 GiB request which aborted the process from inside XLA – a Check failure, not a catchable Python OOM, so there was no graceful degradation. Scanning the antenna axis reduces that batch by n_ant.

checkpoint on the body is load-bearing rather than decorative: lax.scan stacks the body’s residuals across iterations for reverse-mode AD, which would rebuild much of what the vmap was holding, so without it the scan fixes the cuFFT plan and not the autodiff tape.

Measured on a 64-antenna / 32-channel / 4-satellite problem, single precision: peak device memory 35.80 -> 14.62 GB (2.45x) for a 4% runtime cost, with the optimised chi^2 unchanged to ~6 significant figures.

build_set_params()[source]

Build parameter sampling function (optional)

setup(tab_config)[source]

All validation and error-prone operations here

validate_and_test()[source]

Call this before using in JIT context

tabascal.components.rfi_signal.read_light_curves(est_path: str, norad_ids: List[int], times_mjd: NDArray, freqs: NDArray) Array[source]

Read an RFI light curve estimate onto the observation grid.

File structure

A .zarr store (read with xarray.open_zarr()) or a .npz, holding

light_curves

(n_src, n_time, n_freq). One light curve per source, in the same units the RFI visibility amplitude is squared from.

norad_ids

(n_src,). NORAD id labelling each row of light_curves.

times

(n_time,). Modified Julian Date, in days, strictly increasing.

freqs

(n_freq,). Frequency in Hz, strictly increasing.

In the zarr form the last three are coordinates of light_curves.

All four are required. The format is deliberately strict: this is the interchange standard between tabascal and whatever measures the light curves, and every loose alternative it could accept instead fails silently. Matching rows by position rather than by id attaches a curve to the wrong satellite without changing its shape; assuming the file’s sampling matches the observation’s resamples it wrongly by an unknown amount. Neither shows up as an error, only as a worse fit.

Times are absolute (MJD) rather than seconds from the start of a particular observation, so a light curve is interpretable on its own and can be reused across measurement sets covering the same pass.

Resampling

Light curves are interpolated linearly onto times_mjd and freqs. Samples outside the file’s coverage are zero, on either axis – the file says nothing there, which is the same “no signal known” convention the elevation mask uses. An axis of length 1 is held constant instead, since a single sample carries no gradient to interpolate along.

Partial coverage

Satellites with no light curve in the file are zero, so an estimate only has to cover the satellites it was actually measured for rather than every satellite in the fit. Those are named in a warning. It is an error for no configured satellite to be found, which otherwise silently degrades the whole estimate to zeros.

returns:

Light curves on the observation grid, in norad_ids order, with unmatched satellites zero and NaNs replaced by zero.

rtype:

Array (n_rfi, n_freq, n_time)

tabascal.components.rfi_signal.rfi_signal_config_validation(rfi_config: Dict, vis_obs: Array, freqs: Array, chan_width: float, times: Array, int_time: float) Dict[source]

Validate and set defaults of BaseGPRFI class parameters in the configuration file.

Parameters:

rfi_config (Dict) – RFI configuration dictionary

Returns:

Validated configuration dictionary with defaults set.

Return type:

Dict

Raises:

ValueError – Raised when an invalid input is provided for one fo the configuration parameters.