-
Notifications
You must be signed in to change notification settings - Fork 25
RMclean3D
The 3D RMclean algorithm applies CLEAN independently to every pixel in a Faraday depth cube. RMclean3D is designed to run out the outputs of RMsynth3D. Since each pixel is independent, RMclean3D has been set up to allow parallel processing.
If RMtools has been installed with terminal commands, then RMclean3D can be invoked from the command line as rmclean3d <dirtyFDF> <RMSF> <options>, otherwise it must be invoked as a Python script as python <RMtools directory>/RMtools_3D/do_RMclean_3D.py <dirtyFDF> <RMSF> <options>.
Invoking with the -h flag will produce the help text with the list of option flags.
If the cubes are too large to process efficiently, consider using the additional tools that can divide larger cubes into smaller sizes. For analyzing the output Faraday depth cubes consider the pixel-wise peak fitting script.
RMclean3D takes two files as inputs, a dirtyFDF cube and the corresponding RMSF cube, in the format output from RMsynth3D. Specifically, it expects the cubes to be in the multiple-file format, produced when the -f flag is not used. Supply any of the appropriate output files (_real_, _im_, or _tot_) for both the cube and the RMSF. Both the real and imaginary cubes must be present for code to run; the _tot_ cubes are not necessary.
RMclean3D produces several output FITS files, as follows:
- FDF_clean.fits: A FITS cube in the same format as FDF_dirty.fits, containing the Faraday depth cubes of the cleaned FDFs.
- FDF_CC.fits: A FITS cube with the same format as FDF_clean.fits, containing the complex clean components found by CLEAN.
- CLEAN_nIter.fits: A map (same dimensions as the cubes, but without the Faraday depth axis) showing the number of CLEAN iterations used for each pixel.
-h Print the help documentation to the terminal.
-c CUTOFF Supply a number to set the main CLEAN cutoff (in data brightness units). If a cutoff is not supplied then each pixel will be cleaned with the maximum number of clean components.
-w WINDOW Supply a value for the cutoff threshold (in data brightness units) for the deeper windowed clean. After the CUTOFF threshold is reached, CLEAN will continue down to the WINDOW threshold but only search for CLEAN components within 1 FWHM windows around existing CLEAN components. [Not set by default, which disables the windowed CLEAN]
-n MAXITER Supply an integer to set the maximum number of CLEAN iterations to be performed per pixel. Default is 1000.
-g GAIN Supply a number to set the CLEAN loop gain (fraction of identified peak to be modeled as a CLEAN component and subtracted). Default value is 0.1.
-o PREFIXOUT Supply the filename prefix that the output files should have. This will be prepended to all the files saved.
-f Store outputs as files with multiple extensions. Normally, 3 FITS files are written for each output: _real_ (Stokes Q), _im_ (Stokes U), _tot_ (P, polarized intensity). If the flag is set, this are combined into a single FITS file with multiple extensions.
-v Print verbose messages, including the progress bar (disabled during parallel processsing).
--ncores N_CORES Supply a positive integer to set the number of cores to be used for parallel processing. If not set, parallel processing will not be used.
--chunk CHUNK Supply a positive integer to set how many pixels will be given to a parallel process at a time.
--mpi Use MPI for parallel processing. Overrides the --ncores and --chunk keywords.
The option to use parallel processing with RMclean3D was recently added but not yet extensively tested. This requires the use of the Python module 'schwimmbad', which must be installed before using the parallelization feature (but is not required for normal use). This feature is only activated if one of the parallelization flags is set (--ncores or --mpi). Using the MPI parallelization requires the user to have MPI working on their machine.
At the moment, it seems that the parallelization only works on data files smaller than 4 GB. This has not yet been explored in detail, and a solution has not yet been investigated.
Since this feature has not been tested extensively, we would be greatly appreciate if users experimenting with this feature could comment on the effectiveness.