RFI simulations

These simulations are designed to provide simulated data containing received signal from input Radio Frequency Interference (RFI) sources. The aim of providing these simulations is to enable testing of RFI-mitigation techniques and to understand the effects of RFI signals at the SKA Mid site.

The ska-sim-mid/rfi directory contains a python script, a bash script and a data directory. For the main simulation providing output images and measurement sets, the bash script rfi_sim.sh should be used. This has three main parts:

  • First, it runs the mid_rfi_simulation.py script, which takes an HDF5 file as input, and produces a measurement set with RFI signal added to the appropriate frequency channels and time samples.

  • Second, the RASCIL Imager app is called using the measurement set as input and FITS images are generated.

  • Finally, the RASCIL vis_ms visualization app is called to generate various plots from the measurement set.

Input data

The input data need to be supplied in the form of an HDF5 file, with the following information and array structure:

  • Source ID, string, dimensions: (nsources)

  • Source type, string, dimensions: (nsources)

  • Time samples, timestamp, dimensions: (ntimes)

  • Frequency channels, FP64, dimensions: (nfreqs), units: [Hz]

  • SKA station ID, string, dimensions: (nstations)

  • Apparent source coordinates in antenna rest frame, FP64, dimensions: (nsources, ntimes, nants, 3) These are [azimuth, elevation, distance], units: [degree, degree, m]

  • Transmitter power as received by an isotropic antenna, FP64, dimensions: (nsources, ntimes, nants, nfreqs) This does not include the antenna beam pattern which will be applied in the visibility simulation pipeline. units: [W/(Hz m^2)]

Note: at the moment the code is set up to handle Unix time for the provided time samples. This will be updated once the input RFI data of aeronautical sources are generated using MJD [s].

Input data

The most up-to-date RFI source data is located in ska-sim-mid/rfi/data/aeronautical_v2_SKA_Mid_coord/aeronautical_sim_datacube_20190313_all.h5. This file contains data for 17 aircraft (RFI sources) for 180 time samples covering one hour of observations, for the full AA1 Mid array (197 antennas) and a single frequency channel (1090 MHz).

ska-sim-mid/rfi/data/aeronautical_v2_SKA_Mid_coord/SKA1MID.csv contains the Mid antenna coordinates used for generating the above data file. The mid RFI simulation code is also updated to generate the telescope configuration using this file. Alternatively, one can use the default RASCIL Mid configuration for the simulations.

Beam gain

The beam gain is applied as part of the RASCIL RFI simulations script simulate_rfi_block_prop, specifically the apply_beam_gain_for_mid function. A voltage pattern for the Mid antennas is generated, together with pointing tables (latter is one for each RFI source). These are used to calculate the gain tables, which are applied to the BlockVisibilities containing the RFI signal, at the end of the simulation.

At the moment we do not have information about the far outside lobes of the Mid dishes, we can only approximate the beam there, which distorts the results further from the beam centre.

We recommend that when using the data file listed above, you do not apply the beam gain directly, or you set the phase centre to be low on the sky, close to the horizon. The aircraft in the data are closer to the horizon, no more than 20 degrees above it. Since the beam we have is small, if the pointing (phase centre) is far from the horizon, all of the RFI signal is missed and removed from the results when the beam gain is applied. If the pointing is set to be closer to the horizon, then some of the aircraft signal will appear in the results (attenuated by the beam as expected).


Simulate RFI data with RASCIL

usage: mid_rfi_simulation.py [-h] [--input_file INPUT_FILE]
                             [--output_dir OUTPUT_DIR] [--msout MSOUT]
                             [--antenna_file ANTENNA_FILE] [--seed SEED]
                             [--noise NOISE] [--ra RA] [--dec DEC]
                             [--nchannels NCHANNELS]
                             [--frequency_range FREQUENCY_RANGE FREQUENCY_RANGE]
                             [--apply_primary_beam APPLY_PRIMARY_BEAM]
                             [--return_average RETURN_AVERAGE]
                             [--time_average TIME_AVERAGE]
                             [--channel_average CHANNEL_AVERAGE]

Named Arguments


Full path to the HDF5 file, which contains necessary RFI information for each RFI source.


Output directory for storing files


Name for MeasurementSet. If empty string, no MeasurementSet is written


Path to antenna file. If left empty, MID configuration from RASCIL will be used.


Random number seed


Add random noise to the visibility samples?


Right Ascension (degrees)


Declination (degrees)


How many channels to create within given –frequency_range


Frequency range (Hz)


Apply primary beam to RFI sources?


Return visibility with time and frequency averaged data?


Number of integrations in a chunk to average


Number of channels in a chunk to average