This Python script can perform a basic (dirty) RM-synthesis, given a FITS cube with Stokes Q images, a FITS cube with Stokes U images, and a text file containing the frequencies of these images. RM synthesis is described in M.A. Brentjens & A.G. de Bruyn, A&A (2005). -
This script assumes that the numpy and pyfits libraries are installed. Install using:
user@machine: /.../rm-synthesis-x.y$ python setup.py install.
rmsynthesis [options] <Qcube.fits> <Ucube.fits> <frequencies.txt>
-o/–output <directory> Output directory (Default: .)
- -l/–low <phi> Lowest Faraday depth in output cube.
- Default value is -sqrt(3)/delta (lambda^2), where delta (lambda^2) is the smallest one as computed from the frequency list.
- -h/–high <phi> Highest Faraday depth in output cube.
- Default value is +sqrt(3)/delta (lambda^2), where delta (lambda^2) is the smallest one computed from the frequency list.
- -d/–dphi <delta phi> Faraday depth increment between frames
- from the RM cube. Default value is sqrt(3)/Delta (lambda^2), where Delta (lambda^2) is max(lambda^2) - min(lambda^2), computed from the frequency list.
- -f/–force Force overwriting files in output
- directory if they already exist.
- -c/–check Perform all possible checks, but do not
- write any files or compute an RM cube.
- -q/–qfactor <qf> Factor to multiply values in Q cube with,
- Default value is 1.0
- -u/–ufactor <uf> Factor to multiply values in U cube with,
- Default value is 1.0. For WSRT data, this factor must be 1.2 if it has not already been applied.
-v/–version Display version information.
The Q and U fits cubes are required and must have three axes. The fastest varying axis (AXIS1) must be right ascension, the second axis (AXIS2) declination, and the slowest varying axis (AXIS3) is the frame number. The rmsynthesis script ignores frequency information in the FITS cubes. It only uses frequency information provided in the text file. Note that the order of the axes in Python/numpy is the reverse of that in the FITS file. That is, in Python, the first axis (axis 0) is the slowest varying axis. The pyfits library transparently handles this conversion. Note that the Q and U cubes must be similar in the sense that their shape and scales (ra, dec, and frame number) must be the same.
The third required input is the list of frequencies. This must be a text file with one frequency per line. The frequency must be in Hz and can be either an integer or a floating point number. A (tiny) example:
1.420e9 1680000000 4800000000
The output files are written in the current working directory, unless otherwise specified with the -o option.
Faraday depth (AXIS3). Total linear polarization.
Faraday depth (AXIS3). Derotated Q.
Faraday depth (AXIS3). Derotated U.
column is Faraday depth, the second column the response parallel to the original polarization direction (“q”), and the third column the response at 45 degrees with respect to the original polarization direction (“u”).
this output.