WSClean#

class radiotools.cleaning.WSClean(ms: str | Path, clean_config: dict | str | Path = None, create_skymodel: bool = False, save_config: bool | str | Path = False)[source]#

Bases: object

Wrapper class for WSClean.

Parameters:
msstr or Path

Path to the measurement set.

clean_configdict or str or Path

Either a dict containing the wsclean options or a path to a toml file containing the options. See note.

create_skymodelbool, optional

Whether to create a skymodel before cleaning the image. Default: False.

save_configbool or str or Path, optional

If True, save the config to a file relative to the file this class is called from. If given a path, the config is saved to that location instead. Default: False.

Notes

A valid config may look like the following:

>>> clean_config = {
>>>     'multiscale': True,
>>>     'mgain': 0.5,
>>>     'file_name': 'path/to/measurement_set',
>>>     'data_column': 'DATA',
>>>     'gain': 0.03,
>>>     'weight': 'briggs 0',
>>>     'mf_weighting': False,
>>>     'size': [1024, 1024],
>>>     'scale': '0.1masec',
>>>     'pol': 'I',
>>>     'niter': 5000000,
>>>     'auto_threshold': 0.5,
>>>     'auto_mask': 3,
>>>     'padding': 1.3,
>>>     'mem': 30,
>>>     'verbose': True,
>>> }

Methods Summary

clean_image()

Cleans the image using WSClean.

create_skymodel()

Creates the skymodel using WSClean if create_skymodel is set to True when initializing the class.

Methods Documentation

clean_image() None[source]#

Cleans the image using WSClean.

create_skymodel() None[source]#

Creates the skymodel using WSClean if create_skymodel is set to True when initializing the class.