pclean API¶
pclean — Parallel CLEAN imaging with Dask and CASA tools.
Provides a pclean() function with a tclean-compatible interface and
transparent Dask-based parallelism for cube (channel) and continuum
(visibility-row) imaging.
- pclean.pclean(config=None, vis='', selectdata=True, field='', spw='', timerange='', uvrange='', antenna='', scan='', observation='', intent='', datacolumn='corrected', imagename='', imsize=[100], cell='1arcsec', phasecenter='', stokes='I', projection='SIN', startmodel='', specmode='mfs', reffreq='', nchan=-1, start='', width='', outframe='LSRK', veltype='radio', restfreq=[], interpolation='linear', perchanweightdensity=True, gridder='standard', facets=1, wprojplanes=1, vptable='', mosweight=True, aterm=True, psterm=False, wbawp=True, conjbeams=False, cfcache='', usepointing=False, computepastep=360.0, rotatepastep=360.0, pointingoffsetsigdev=[], pblimit=0.2, normtype='flatnoise', psfphasecenter='', deconvolver='hogbom', scales=[], nterms=2, smallscalebias=0.0, fusedthreshold=0.0, largestscale=-1, restoration=True, restoringbeam=[], pbcor=False, outlierfile='', weighting='natural', robust=0.5, noise='1.0Jy', npixels=0, uvtaper=[], niter=0, gain=0.1, threshold='0.0mJy', nsigma=0.0, cycleniter=-1, cyclefactor=1.0, minpsffraction=0.05, maxpsffraction=0.8, interactive=False, nmajor=-1, fullsummary=False, usemask='user', mask='', pbmask=0.0, sidelobethreshold=3.0, noisethreshold=5.0, lownoisethreshold=1.5, negativethreshold=0.0, smoothfactor=1.0, minbeamfrac=0.3, cutthreshold=0.01, growiterations=100, dogrowprune=True, minpercentchange=0.0, verbose=False, fastnoise=True, python_automask=True, restart=True, savemodel='none', calcres=True, calcpsf=True, psfcutoff=0.35, parallel=False, nworkers=None, scheduler_address=None, threads_per_worker=1, memory_limit='0', local_directory=None, cube_chunksize=-1, keep_subcubes=False, keep_partimages=False, concat_mode='auto', cluster_type='local', slurm_queue=None, slurm_account=None, slurm_walltime='24:00:00', slurm_job_mem='20GB', slurm_cores_per_job=1, slurm_job_name=None, slurm_job_extra_directives=None, slurm_python=None, slurm_local_directory=None, slurm_log_directory='logs', slurm_job_script_prologue=None)¶
Parallel CLEAN imaging – tclean-compatible interface.
Parameters are identical to CASA
tcleanwith the following additions:parallel – enable Dask-distributed parallelism.
nworkers – number of Dask workers (default: CPU count).
scheduler_address – connect to an existing Dask scheduler.
threads_per_worker – threads per Dask worker (default 1).
memory_limit – per-worker memory cap (
'0'disables; seedocs/memory_management.md).local_directory – Dask scratch directory.
cube_chunksize – channels per sub-cube task for cube parallelism.
-1(default) setsnparts = nworkers;1creates one task per channel (maximum load balancing);Ngroups N channels per task.keep_subcubes – if
True, preserve intermediate sub-cube images and per-worker temp directories after concatenation. Useful for debugging or downstream per-channel analysis. DefaultFalseremoves them to save disk space.keep_partimages – if
True, preserve partial images produced by each worker during continuum (MFS) imaging. DefaultFalseremoves them after gathering.concat_mode – concatenation strategy for cube imaging.
'auto'(default) picks a virtual concatenation strategy whenkeep_subcubes=True,'paged'otherwise.'paged'always does a full pixel copy.'virtual'creates a reference catalog (subcubes must stay).'movevirtual'renames subcubes into the output (near-instant).config – a
PcleanConfiginstance, a path to a YAML config file, orNone. When provided, the hierarchical config is used as the base and any explicit keyword arguments override it.
- Returns:
Imaging summary (convergence, major-cycle count, image names).
- Parameters:
config (PcleanConfig | str | Path | None)
selectdata (bool)
observation (str)
intent (str)
datacolumn (str)
imagename (str)
phasecenter (str)
stokes (str)
projection (str)
startmodel (str)
specmode (str)
reffreq (str)
nchan (int)
start (str)
width (str)
outframe (str)
veltype (str)
interpolation (str)
perchanweightdensity (bool)
gridder (str)
facets (int)
wprojplanes (int)
vptable (str)
mosweight (bool)
aterm (bool)
psterm (bool)
wbawp (bool)
conjbeams (bool)
cfcache (str)
usepointing (bool)
computepastep (float)
rotatepastep (float)
pblimit (float)
normtype (str)
psfphasecenter (str)
deconvolver (str)
nterms (int)
smallscalebias (float)
fusedthreshold (float)
largestscale (int)
restoration (bool)
pbcor (bool)
outlierfile (str)
weighting (str)
robust (float)
noise (str)
npixels (int)
niter (int)
gain (float)
threshold (str)
nsigma (float)
cycleniter (int)
cyclefactor (float)
minpsffraction (float)
maxpsffraction (float)
interactive (bool)
nmajor (int)
fullsummary (bool)
usemask (str)
mask (str)
pbmask (float)
sidelobethreshold (float)
noisethreshold (float)
lownoisethreshold (float)
negativethreshold (float)
smoothfactor (float)
minbeamfrac (float)
cutthreshold (float)
growiterations (int)
dogrowprune (bool)
minpercentchange (float)
verbose (bool)
fastnoise (bool)
python_automask (bool)
restart (bool)
savemodel (str)
calcres (bool)
calcpsf (bool)
psfcutoff (float)
parallel (bool)
nworkers (int | None)
scheduler_address (str | None)
threads_per_worker (int)
memory_limit (str)
local_directory (str | None)
cube_chunksize (int)
keep_subcubes (bool)
keep_partimages (bool)
concat_mode (str)
cluster_type (str)
slurm_queue (str | None)
slurm_account (str | None)
slurm_walltime (str)
slurm_job_mem (str)
slurm_cores_per_job (int)
slurm_job_name (str | None)
slurm_python (str | None)
slurm_local_directory (str | None)
slurm_log_directory (str)
- Return type:
- class pclean.CustomFormatter(fmt=None, datefmt=None, style='%')[source]¶
Bases:
FormatterCustom logging formatter that defaults to CASA-style output and UTC time.
Format: YYYY-MM-DD HH:MM:SS LEVEL LoggerName Message
- converter()¶
- gmtime([seconds]) -> (tm_year, tm_mon, tm_mday, tm_hour, tm_min,
tm_sec, tm_wday, tm_yday, tm_isdst)
Convert seconds since the Epoch to a time tuple expressing UTC (a.k.a. GMT). When ‘seconds’ is not passed in, convert the current time instead.
If the platform supports the tm_gmtoff and tm_zone, they are available as attributes only.