RFI simulations

These simulations are designed to provide simulated data containing received signal from input RFI sources. The aim of providing these simulations is to enable testing of RFI-mitigation techniques and specifically to understand the level of low-level RFI (radio frequency interference) likely to be present for SKA Mid observations and the limitations of the standard mitigation software.

The ska-sim-mid/rfi directory contains a python script, and a bash script. 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.

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

Input data

The input data needs 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 we have updated RFI input of aeronautical source. The agreed format will be in MJD [s].

An example input HDF5 file can be found in ska-sim-mid/tests/rfi/test_data.

Beam gain

Beam gains are not applied at the time of writing. These will need further development. The beam gains will be obtained from gain tables created within RASCIL.

CLI

Simulate RFI data with RASCIL

usage: mid_rfi_simulation.py [-h] [--input_file INPUT_FILE]
                             [--output_dir OUTPUT_DIR] [--msout MSOUT]
                             [--seed SEED] [--noise NOISE] [--ra RA]
                             [--declination DECLINATION]
                             [--nchannels_per_chunk NCHANNELS_PER_CHUNK]
                             [--frequency_range FREQUENCY_RANGE FREQUENCY_RANGE]
                             [--apply_primary_beam APPLY_PRIMARY_BEAM]
                             [--return_average RETURN_AVERAGE]
                             [--time_average TIME_AVERAGE]
                             [--channel_average CHANNEL_AVERAGE]
                             [--use_dask USE_DASK]

Named Arguments

--input_file

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

--output_dir

Output directory for storing files

--msout

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

--seed

Random number seed

--noise

Add random noise to the visibility samples?

--ra

Right Ascension (degrees)

--declination

Declination (degrees)

--nchannels_per_chunk

Number of channels in a chunk

--frequency_range

Frequency range (Hz)

--apply_primary_beam

Apply primary beam to RFI sources?

--return_average

Return block visibility with time and frequency averaged data?

--time_average

Number of integrations in a chunk to average

--channel_average

Number of channels in a chunk to average

--use_dask

Use dask to distribute processing?