Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Added support for gridding multiple singledish mosaics in the singledish pipeline (#414).
- Set `singlescale_mask_absolute=True` as the default in imaging, reflecting actual imaging usage. (#418).
- Add optional tests to check if cube channels are noise only, and if so to mask them out (#399).
- Expose ``max_loops`` for multiscale and singlescale clean in ``loop_imaging`` and chunked ``run_imaging`` (#428).

### Changed

Expand Down
14 changes: 12 additions & 2 deletions phangsPipeline/handlerImaging.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,7 @@ def loop_imaging(
convergence_noise_z_threshold=None,
channel_noise_sigma_threshold=None,
singlescale_threshold_value=1.0,
max_loops=20,
extra_ext_in=None,
suffix_in=None,
extra_ext_out=None,
Expand Down Expand Up @@ -242,6 +243,9 @@ def loop_imaging(
greater than 2.0.
singlescale_threshold_value : float
Threshold value for singlescale clean. Default is 1.0.
max_loops : int
Maximum number of clean loops for the multiscale and singlescale
clean stages. Default is 20.
extra_ext_in : str
Extra extension for input files.
suffix_in : str
Expand Down Expand Up @@ -378,6 +382,7 @@ def loop_imaging(
convergence_noise_z_threshold=convergence_noise_z_threshold,
channel_noise_sigma_threshold=channel_noise_sigma_threshold,
singlescale_threshold_value=singlescale_threshold_value,
max_loops=max_loops,
dynamic_sizing=dynamic_sizing,
force_square=force_square,
export_dirty=export_dirty,
Expand Down Expand Up @@ -853,6 +858,7 @@ def task_multiscale_clean(
imaging_method='tclean',
convergence_fracflux=0.01,
convergence_noise_z_threshold=None,
max_loops=20,
backup=True,
):
"""
Expand Down Expand Up @@ -895,7 +901,7 @@ def task_multiscale_clean(
threshold_type='snr',
threshold_value=4.0,
min_loops=3,
max_loops=20,
max_loops=max_loops,
max_total_niter=None,
convergence_fracflux=convergence_fracflux,
convergence_totalflux=None,
Expand Down Expand Up @@ -1083,6 +1089,7 @@ def task_singlescale_clean(
convergence_fracflux=0.01,
threshold_value=1.0,
convergence_noise_z_threshold=None,
max_loops=20,
backup=True,
):
"""
Expand Down Expand Up @@ -1125,7 +1132,7 @@ def task_singlescale_clean(
threshold_type='snr',
threshold_value=threshold_value,
min_loops=3,
max_loops=20,
max_loops=max_loops,
max_total_niter=None,
convergence_fracflux=convergence_fracflux,
convergence_totalflux=None,
Expand Down Expand Up @@ -1207,6 +1214,7 @@ def recipe_phangsalma_imaging(
convergence_noise_z_threshold=None,
channel_noise_sigma_threshold=None,
singlescale_threshold_value=1.0,
max_loops=20,
dynamic_sizing=True,
force_square=False,
export_dirty=False,
Expand Down Expand Up @@ -1415,6 +1423,7 @@ def recipe_phangsalma_imaging(
imaging_method=imaging_method,
convergence_fracflux=convergence_fracflux,
convergence_noise_z_threshold=convergence_noise_z_threshold,
max_loops=max_loops,
)

if do_export_to_fits and export_multiscale:
Expand Down Expand Up @@ -1473,6 +1482,7 @@ def recipe_phangsalma_imaging(
convergence_fracflux=convergence_fracflux,
convergence_noise_z_threshold=convergence_noise_z_threshold,
threshold_value=singlescale_threshold_value,
max_loops=max_loops,
)

# Reset the current imaging to the results of the singlescale clean.
Expand Down
14 changes: 12 additions & 2 deletions phangsPipeline/handlerImagingChunked.py
Original file line number Diff line number Diff line change
Expand Up @@ -341,6 +341,7 @@ def run_imaging(
convergence_noise_z_threshold=None,
singlescale_threshold_value=1.0,
channel_noise_sigma_threshold=None,
max_loops=20,
extra_ext_in=None,
suffix_in=None,
extra_ext_out=None,
Expand Down Expand Up @@ -403,6 +404,9 @@ def run_imaging(
channel_noise_sigma_threshold : float
Threshold value for defining a channel as purely noise. Default is None,
which will not perform this check.
max_loops : int
Maximum number of clean loops for the multiscale and singlescale
clean stages. Default is 20.
extra_ext_in : str
Extra extension for input files.
suffix_in : str
Expand Down Expand Up @@ -492,6 +496,7 @@ def run_imaging(
convergence_noise_z_threshold=convergence_noise_z_threshold,
channel_noise_sigma_threshold=channel_noise_sigma_threshold,
singlescale_threshold_value=singlescale_threshold_value,
max_loops=max_loops,
dynamic_sizing=dynamic_sizing,
force_square=force_square,
overwrite=overwrite,
Expand Down Expand Up @@ -1231,6 +1236,7 @@ def task_multiscale_clean(
convergence_fracflux=0.01,
convergence_noise_z_threshold=None,
channel_noise_sigma_threshold=None,
max_loops=20,
backup=True,
gather_chunks_into_cube=False,
remove_chunks=False,
Expand Down Expand Up @@ -1322,7 +1328,7 @@ def task_multiscale_clean(
threshold_type='snr',
threshold_value=4.0,
min_loops=3,
max_loops=20,
max_loops=max_loops,
max_total_niter=None,
convergence_fracflux=convergence_fracflux,
convergence_totalflux=None,
Expand Down Expand Up @@ -1520,6 +1526,7 @@ def task_singlescale_clean(
remove_chunks=False,
threshold_value=1.0,
skip_singlescale_if_mask_empty=True,
max_loops=20,
backup=True,
):
"""
Expand Down Expand Up @@ -1607,7 +1614,7 @@ def task_singlescale_clean(
threshold_type='snr',
threshold_value=threshold_value,
min_loops=3,
max_loops=20,
max_loops=max_loops,
max_total_niter=None,
convergence_fracflux=convergence_fracflux,
convergence_totalflux=None,
Expand Down Expand Up @@ -1768,6 +1775,7 @@ def recipe_phangsalma_imaging(
convergence_noise_z_threshold=None,
channel_noise_sigma_threshold=None,
singlescale_threshold_value=1.0,
max_loops=20,
dynamic_sizing=True,
force_square=False,
export_multiscale=False,
Expand Down Expand Up @@ -1853,6 +1861,7 @@ def recipe_phangsalma_imaging(
convergence_noise_z_threshold=convergence_noise_z_threshold,
channel_noise_sigma_threshold=channel_noise_sigma_threshold,
skip_multiscale_if_mask_empty=skip_multiscale_if_mask_empty,
max_loops=max_loops,
gather_chunks_into_cube=False,
)

Expand All @@ -1875,6 +1884,7 @@ def recipe_phangsalma_imaging(
convergence_noise_z_threshold=convergence_noise_z_threshold,
threshold_value=singlescale_threshold_value,
skip_singlescale_if_mask_empty=skip_singlescale_if_mask_empty,
max_loops=max_loops,
gather_chunks_into_cube=False)

# Reset the current imaging to the results of the singlescale clean.
Expand Down
Loading