Menu

scripted_plotting

André Offringa
Attachments
WSRT-RT2xRT4.png (155171 bytes)

Both rfigui and aoqplot have options that make it possible to save certain statistics or overview images. This can be useful to e.g. automatically store a few default images that give a quick overview of the RFI situation. When parameters are given on the command line that save images, the rfigui and aoqplot tools will not open their default window and therefore do not require an X windows system to be running¹. In other words, in these modes the tools can be run from a command line script. Both rfigui and aoqplot can be run with parameter --help, which will show a list of supported options.

The rfigui tool can be used to save time-frequency "heatmap" images, that show the flux of the correlations in a two-dimensional time and frequency display. The syntax is as follows:

$ rfigui -save-baseline <filename> <antenna1> <antenna2> <band> <sequence index>

Filename should end with an image extension. Supported formats are .png, .pdf and .svg. Note that .pdf and .svg or of higher quality than .png files. The created plots will by default be made from the "DATA" column. However, a different column can be selected with the option -data-column <name>. The following example will save the correlated data from antennas 1 and 3:

$ rfigui -data-column CORRECTED_DATA -save-baseline WSRT-RT2xRT4.pdf 1 3 0 0 3C196_spw5_sub1.MS/

Which creates the following pdf:
Result of rfigui -save-baseline command (WSRT-RT2xRT4)

It is also possible to repeat the '-save-baseline' option to save multiple images at once. This saves quite a few computations over saving the baselines one by one with separate rfigui calls.

The aoqplot syntax to save plots is as follows:

$ aoqplot -save <filename prefix> <statistic name>

Note that unlike rfigui, the aoqplot tool saves several images at once. The plots created are i) a per-baseline matrix plot; ii) a per antenna plot; iii) a spectrum; iv) a time-plot; and v) a time-frequency heatmap. The statistic name parameter is a case-sensitive name of the statistic that will be plotted over antenna/time/frequency, etc. The common statistics are: StandardDeviation, DStandardDeviation (=stddev of difference between channels), Variance, Mean, RFIPercentage, RFIRatio andCount (=visibility count). A full list of allowed statistics can be retrieved by typing aoquality liststats on the command line. However, not all allowed statistics are stored by default in a measurement set. This is an example aoqplot run:

$ aoqplot -save aartfaac-stddev StandardDeviation aartfaac-testobs.ms/
 (1/1) Adding aartfaac-testobs.ms/ to statistics...
Lowering time resolution...
Lowering frequency resolution...
Integrating baseline statistics to one channel...
Regridding time statistics...
Copying statistics...
Integrating time statistics to one channel...
Opening statistics panel...
Saving aartfaac-stddev-antennas.pdf...
Saving aartfaac-stddev-baselines.pdf...
Saving aartfaac-stddev-baselinelengths.pdf...
Saving aartfaac-stddev-timefrequency.pdf...
Saving aartfaac-stddev-time.pdf...
Saving aartfaac-stddev-frequency.pdf...
$

This is an example for the produced 'baselines' plot:
Result of aoqplot -save command (baseline plot)

As can be seen from this image, antenna index 5 (WSRT RT5) is not working, and the autocorrelations show more power (as they should). Note that aoqplot uses the quality statistics tables inside the measurement set. These are normally produced by tools like DPPP, cotter or aartfaac2ms; however, if a measurement set is not produced by one of those tools, it is necessary to create these tables manually. This can be done with the aoquality collect <obs.ms> command.


¹ - Older versions of rfigui and aoqplot would require an X window system to be running even when running in command line mode. However, that was resolved in AOFlagger version 2.10.


Related

Wiki: Home
Wiki: changelog-2.10.0
Wiki: rfigui

MongoDB Logo MongoDB