tab-sim
TrAjectory Based RFI Simulations of radio interferometry data. A source to visibility model for RFI sources including certain near-field effects.
tab-sim is written in JAX
and Dask and can therefore use GPUs and/or CPUs to perform larger than memory computation.
Documentation
https://tab-sim.readthedocs.io/
Installation
The following instructions are expected to work on Linux machine. If you are running Windows it is recommended to use WSL. If you are running Mac then it is best to start with a conda/mamba environment and install python-casacore before continuing with the pip install method. If all else fails there is the Docker install.
Firstly you should clone the repository to you machine with:
git clone https://github.com/chrisfinlay/tab-sim.git
Pure pip install
You can install tab-sim with pip alone inside an environment of your choice with optional GPU support.
GPU Enabled
pip install -e ./tab-sim/[gpu]
or
CPU Only
pip install -e ./tab-sim/
Docker
If you are having trouble with the pip install method you can try with Docker instead. The provided Dockerfile can be used to build an image which should, "in principle", run on any machine.
Assuming you have cloned this git repository into you current working directory then you can either:
- build an image with the latest tab-sim.
- download a working but older version of a tab-sim image.
First we can simplify by setting the TAB_DIR environment variable using
TAB_DIR=$(pwd)
1. Build an image
TAB_IMG=tab-sim:latest
docker build -t ${TAB_IMG} ./tab-sim/
2. Download an image
TAB_IMG=chrisjfinlay/tab-sim:0.0.1
docker pull ${TAB_IMG}
After running one of the above you can run the docker image using the appropriate command below:
Linux
docker run -it -v ${TAB_DIR}:/data -u $(id -u):$(id -g) ${TAB_IMG} bash
Mac
docker run -it -v ${TAB_DIR}:/data ${TAB_IMG} bash
For more complex tab-sim installs using docker you can adapt the Dockerfile to your needs.
Simulations
tab-sim includes the facility to define a simulation using a YAML configuration file. There is a general command line interface to run these simulations allowing one to change certain parameters on the fly as well as in the configuration file. All input data is copied into the output simulation directory to allow one to run an identical simulation with ease. Inside tab-sim/examples/target are a set of config files to get you started. There are also example data files which are used for including predefined astronomical and rfi models. They are all csv files with file extensions to help distinguish them. These reside in tab-sim/data/aux_data.
Including TLE-based satelllites
Orbital records come from the IAU CPS SatChecker
service. No account or credentials are required — the previous Space-Track login
file is no longer used, and the spacetrack dependency is gone.
The machinery that executes a selection — asking the sources in order, choosing the
record nearest the observation, reusing the cache, falling back to the other
archive, and writing and reading the frozen-replay files — is
satchecker-client, shared
with TABASCAL so there is one implementation of it rather than two. The policy is
still tab-sim's and is stated on every call: the source order, the defaults
below, what an acceptable record is, what happens when a satellite cannot be
resolved, and every message in this section. tab-sim requires satchecker-client
0.2.0 or later, the first release with the API it uses.
Name the satellites you want in the config, either by NORAD catalogue ID or by name:
rfi_sources:
tle_satellite:
norad_ids: [25544] # every listed ID must resolve, or the run stops
sat_names: [navstar] # substring match against the catalogue
SatChecker serves two record formats from two archives that do not overlap: TLEs up
to 2026-07-11, and OMM (Orbit Mean-Elements Message) element sets from 2026-07-12
onward. tab-sim handles both and picks the archive your observation epoch falls
in, so nothing about the configuration changes across the boundary. Selection is
not globally nearest across both: the epoch chooses one archive, and the other is
asked only when the first has nothing acceptable.
Naming satellites
sat_names is a substring match, as Space-Track's like search was, so
navstar selects every NAVSTAR nn (USA nnn) entry. The catalogue is written
almost entirely in upper case and the service matches case-sensitively, so your
query is upper-cased for you; a few mixed-case names (DMSat-1) cannot be reached
by any single spelling, and % and _ are SQL wildcards. Satellites the catalogue
says had decayed — or had not launched — at the observation epoch are excluded,
so a historical observation keeps the satellites that were in orbit then.
A name search is cached beside the orbit records and reused for
search_cache_max_age_days (default 1) of wall-clock time. That is a different
question from how old an orbital record may be: remote_max_age_days (default 3)
is the hard ceiling on |record epoch − observation epoch|, and
cache_reuse_max_age_days (default 1) is when a cached record is close enough to
skip a request. Set remote_max_age_days: 1 for the old ±1-day acceptance bound.
Three days is a broader window, not a promise of three-day accuracy.
A broad name is expensive: SatChecker serves one record per request, so
sat_names: [starlink] is tens of thousands of requests and as many propagations.
tab-sim warns above 500 satellites and never truncates silently.
Caches, offline runs and frozen replay
Records are cached per satellite under the platform user-cache directory
(~/.cache/orbit-cache, ~/Library/Caches/orbit-cache); set ORBIT_CACHE_DIR to
put it elsewhere. Catalogue searches are cached in the same directory. Cached rows
are the validated copy of what came back, so each states its RECORD_KIND and, for
a TLE, that its checksum digits were verified — no reader has to re-infer either.
The file scheme is unchanged and the cache is shared with other applications using
the same client, including older versions of it, so there is nothing to migrate and
nothing to purge. Records nothing has verified still never enter it.
Where several records are held for one satellite — the normal state of a cache that
has been used — the one selected is the nearest to the observation epoch that this
run can use, not the nearest of all of them. A record the run's checksum policy
refuses is not a candidate at all, so a nearer unusable row neither displaces a
usable one nor provokes a request the configuration does not ask for: what is chosen
is still inside remote_max_age_days, and if it is also inside
cache_reuse_max_age_days no request is sent. It is also what lets --offline
resolve from an acceptable record you hold instead of failing because a nearer row
happens to be unreadable. Earlier versions looked at the nearest record first and
went to SatChecker when it turned out to be unusable, which could fetch a closer
record — and, offline, could fail with an acceptable one in hand.
sim-vis -c observation.yaml # online
sim-vis -c observation.yaml --offline # no requests at all
sim-vis -c observation.yaml --replay-orbit-dir previous/input_data # frozen replay
--offline forbids every SatChecker request. Cached searches are reused whatever
their age, with a warning saying how old they are; cached orbit records still have
to satisfy remote_max_age_days, because offline is about what can be reached and
not about what an acceptable record is. A satellite with no acceptable local record
stops the run saying so — it never claims SatChecker has no record for it.
Every simulation writes its final selection to input_data/norad_ids.yaml and the
records it propagated to input_data/used_orbits.json.
--replay-orbit-dir <run>/input_data makes those two files authoritative: the saved
IDs are the satellites, with no catalogue search, no cache, no request, no
visibility reselection and no max_n_sat. Anything missing or ambiguous in them
stops the run rather than being resolved from somewhere else. Reproducing a run's
visibilities exactly also assumes the same observation, spectral models, random
seeds and numerical environment; what replay freezes is the orbital input.
Replay directories are readable in both directions across this change: a pair written before it replays now, and a pair written now replays with the earlier code. The two files are the same two files, holding the same identities, the same retained values and the same checksum provenance — the contract is what reads back, not that the bytes match.
extra_orbit_dir (--extra-orbit-dir, also -eod) is a different thing: ordinary
per-NORAD-ID source precedence, searched ahead of the cache and SatChecker, while
the run still chooses its own satellites from its own names, IDs, visibility cuts
and max_n_sat. Use it to supply your own records — convert TLE text files with
tabsim-import-tles and point it at the output directory. Every *.json in that
directory must be a readable orbit table: one that is not stops the run naming
itself, rather than letting the run quietly fall back to records you said not to
use. replay_orbit_dir and extra_orbit_dir cannot be combined.
Checksums
A TLE line carries a checksum digit, and tab-sim rejects a line whose checksum
does not verify — always, under every setting. Some of SatChecker's historical
archive (roughly 2001–2018) reached it without that digit at all; those lines are
rejected by default, which can leave no record for those dates.
allow_missing_checksum: true (or --allow-missing-checksum) accepts them and
marks each record unverified_missing_checksum for the rest of its life: the
status is provenance, so it survives a save and a reload and is never upgraded
because the lines now parse. The same setting applies to remote records, to
extra_orbit_dir and to replay, so a permissive run cannot be laundered into a
strict one by saving it. Such records are deliberately kept out of the shared orbit
cache, which other tools and older client versions read, so the saved run records
are the only way to reproduce them:
sim-vis -c observation.yaml --replay-orbit-dir previous/input_data \
--allow-missing-checksum
Migrating from the Space-Track backend
rfi_sources.tle_satellite.tle_dir and spacetrack_path are rejected on sight —
they used to decide where records came from, and a run that kept one would
otherwise succeed while quietly ignoring it. Use extra_orbit_dir for existing
orbit JSON files and ORBIT_CACHE_DIR to relocate the managed cache; delete
spacetrack_path, along with the login file and the -st flag.
Historical completeness is bounded by what SatChecker holds: it cannot reconstruct records it does not have, missing checksum evidence, or the catalogue's name membership as it stood at a past epoch. Those limits surface as explicit diagnostics rather than as a successful simulation with satellites missing from it.
Running a simulation
To run a simulation of a target field with 100 randomly distributed point sources and some GPS satellites simply run
sim-vis -c sim_target_16A.yaml
You can run the help function to see what other command line options there are.
sim-vis -h
Staged output and memory controls
Simulation output now stages components into one Zarr store before composing
observed visibilities. This is the default for CLI and Python writers. Large
rfi_*_A diagnostics and signal-statistic reductions are omitted by default;
output arrays, compute chunk size, component concurrency and resource guards are
configurable. See staged output for CLI, YAML and Python
examples and the distinction between task-boundary memory guards and hard caps.
Config File Definition
The simulation configuration file has many options with set defaults such that minimal configurations can be set unless more is required.
The base configuration files with defualts and definitions reside in tab-sim/data/config_files
Output Data Structure
Once a simulation has been run then a directory will be created to store all input and output data used for the simulation. The location for this directory is defined in the simulation config file under
output:
path: output_directory_path
prefix: simulation_name_prefix
The directory name will have a prefix as defined in the config file and include many of the other simulation configuration parameters in the directory name. For example, when using the target_obs_16A.yaml config file, the name will be pnt_src_obs_16A_450T-0000-0898_1025I_001F-1.227e+09-1.227e+09_100PAST_000GAST_000EAST_3SAT_0GRD_1.0e+00RFI. The resulting directory structure inside this base directory is as follows:
- sim_name/
- sim_name.zarr/
- sim_name.ms/
- AngularSeps.png
- SourceAltitude.png
- UV.png
- log_sim_xxxxxx.txt
- input_data/
- MeerKAT.itrf.txt
- norad_ids.yaml
- norad_satellite.rfimodel
- sim_config.yaml
The .zarr and .ms files contain the actual visibilities that are simulated with the .zarr file containing intermediate values used in calculating certain quantities. The .png files are diagnostoc plots to check the angular separations between the RFI sources and the target direction, The source altitude of the target direction, and the UV coverage of the baselines. log_sim_xxxxxx.txt contains the output that was displayed when originally running the simulation. Finally, input_data contains all the required data to rerun the simulation exactly for reproducibility especially if the data hungry visibilities need to be deleted for some reason.
Zarr Output
The .zarr files is most easily read using Xarray in a Jupyter notebook. The following code will read the simulation data into an xarray.Dataset object.
import xarray as xr
zarr_path = "path/to/data_dir/sim_name/sim_name.zarr/"
xds = xr.open_zarr(zarr_path)
xds
The structure of the .zarr file is as follows:
Coordinates
| Name | Description |
|---|---|
ant |
Antenna index |
bl |
Baseline index |
enu |
East, North Up {m} |
freq |
Frequencies {Hz} |
geo |
Latitude, Longitude, Elevation {deg, deg, m} |
itrf |
International Terrestrial Reference Frame (ECEF) {m} |
lmn |
Local astronomcal cosine coordinates |
radec |
Right Ascension, Declination {deg} |
time |
Elapsed observation time centroids {s} |
time_fine |
Fine grain time centroids {s} |
time_mjd |
Modified Julian Date time {days} |
time_mjd_fine |
Fine grain Modified Julian Date time {days} |
tle |
Two-line elements for satellites |
uvw |
Local antenna coordinates {m} |
xyz |
Geocentric Celestial Reference Frame (ECI) {m} |
Data Variables
| Name | Description |
|---|---|
SEFD |
System Equivalent Flux Density {Jy} |
antenna1 |
Antenna 1 index |
antenna2 |
Antenna 2 index |
ants_itrf |
Antenna ITRF coordinates {m} |
ants_uvw |
Antenna UVW coordinates {m} |
ants_xyz |
Antenna XYZ (ECI) coorindates {m} |
ast_p_I |
Astronomical point source intensities {Jy} |
ast_p_lmn |
Astronomical point source positions |
bl_uvw |
Baseline UVW coordinates {m} |
flags |
RFI flags based on 3sigma from truth |
gains_ants |
Antenna gains |
noise_data |
Visibility noise realisation {Jy} |
noise_std |
Visibility noise standard deviation {Jy} |
norad_ids |
NORAD IDs for TLE-based satellites |
rfi_tle_sat_A |
Modulated satellite signal amplitudes {Jy^0.5} |
rfi_tle_sat_ang_sep |
Satellite angular separation from target direction {deg} |
rfi_tle_sat_orbit |
Satellite TLE orbit parameters |
rfi_tle_sat_xyz |
Satellite XYZ (ECI) coordinates {m} |
time_idx |
Time index to map from time_fine to time |
vis_ast |
Astronomical visibility component {Jy} |
vis_calibrated |
Perfectlty calibrated visibilities {Jy} |
vis_obs |
Observed (uncalibrated) visibilities {Jy} |
vis_rfi |
RFI visibility component {Jy} |
Attributes
| Name | Description |
|---|---|
chan_width |
Frequency channel bandwidth {Hz} |
dish_diameter |
Dish diameter {m} |
int_time |
Integration time per sample {s} |
n_ant |
Number of antennas |
n_ast_e_src |
Number of astronomical exponential profile sources |
n_ast_g_src |
Number of astronomical Gaussian profile sources |
n_ast_p_src |
Number of astronomical point sources |
n_ast_src |
Number of astronomical sources n_ast_e_src + n_ast_g_src + n_ast_p_src |
n_bl |
Number of baselines |
n_freq |
Number of frequency channels |
n_int_samples |
Number of integration samples per time sample |
n_sat_src |
Number of satellite RFI sources |
n_stat_src |
Number of stationary RFI sources |
n_time |
Number of time steps |
n_time_fine |
Number of fine grained time steps |
geometry_time_scale |
Time scale the epochs behind the geometry are read on: utc. See Phase tracking |
phase_tracking |
Direction the visibilities were fringe-stopped to: apparent is the target's apparent place of date. See Phase tracking |
target_dec |
Declination of the ICRS target direction {deg} |
target_name |
Name of the target |
target_ra |
Right Ascension of the ICRS target direction {deg} |
target_frame |
Reference frame of the target coordinates (ICRS) |
tel_elevation |
Telescope elevation {m} |
tel_latitude |
Telescope latitude {deg} |
tel_longitude |
Telescope logitude {deg} |
tel_name |
Telescope name |
Measurement Set Output
Measurement sets allow the addition of non-standard data columns. The simulator in tab-sim takes advantage of this and adds the following columns to help with debugging and analysis.
Standard Columns
DATA: Observed data which includes gains and noise.CORRECTED_DATA: Filled with zeros or the data of ones choice when calling thewrite_msfunction.MODEL_DATA: Filled with zeros as it will be used byWSCLEANwhen imaging.
Non-standard Columns
CAL_DATA: Observed data (DATA) where the true gain solutions have been applied.AST_MODEL_DATA: The astronomical visibilities only with perfect gains and no noise.RFI_MODEL_DATA: The RFI visibilities only with perfect gains and no noise.AST_DATA: The same asAST_MODEL_DATAbut with the noise added.RFI_DATA: The same asRFI_MODEL_DATAbut with the noise added.NOISE_DATA: The complex noise that is added to the above datasets.
Citing tab-sim
@ARTICLE{Finlay2023,
author = {{Finlay}, Chris and {Bassett}, Bruce A. and {Kunz}, Martin and {Oozeer}, Nadeem},
title = "{Trajectory-based RFI subtraction and calibration for radio interferometry}",
journal = {Monthly Notices of the Royal Astronomical Society},
year = 2023,
month = sep,
volume = {524},
number = {3},
pages = {3231-3251},
doi = {10.1093/mnras/stad1979},
archivePrefix = {arXiv},
eprint = {2301.04188},
}
@ARTICLE{Finlay2025,
author = {{Finlay}, Chris and {Bassett}, Bruce A. and {Kunz}, Martin and {Oozeer}, Nadeem},
title = "{TABASCAL II: Removing Multi-Satellite Interference from Point-Source Radio Astronomy Observations}",
journal = {arXiv e-prints},
year = 2025,
month = jan,
doi = {10.48550/arXiv.2502.00106},
archivePrefix = {arXiv},
eprint = {2502.00106},
}
Metadata
Release files for tabsim 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| tabsim-0.1.0.tar.gz | 876.5 kB | With provenance | Details for tabsim-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| tabsim-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for tabsim-0.1.0-py3-none-any.whl |
Total release size: 1.8 MB
Release files / tabsim-0.1.0.tar.gz
| Download URL | tabsim-0.1.0.tar.gz |
|---|---|
| Size | 876.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
21a6624fdb38d7ec88360bc8593780773c0d146656be92d75c441b71d8ff86d2
|
|
BLAKE2b-256 checksum How to use checksums |
7b328606a54d6154293a48672469f39b94ae3fdd8e89e2645c147042147b5a11
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 8, 2026.
Transparency logRelease files / tabsim-0.1.0-py3-none-any.whl
| Download URL | tabsim-0.1.0-py3-none-any.whl |
|---|---|
| Size | 910.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
8220fd9165df05d8b56e668ffbe53d5676c5f3618ad913e46a87ff3301a7983c
|
|
BLAKE2b-256 checksum How to use checksums |
6a40bf1f770e96b06ce06e0628b6569b111e9436a36b32c297e2431e2a0014f5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 8, 2026.
Transparency logSecurity for tabsim 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for tabsim-0.1.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 8, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.