From a53d33bbb30e926aded63f2324e712877ba726da Mon Sep 17 00:00:00 2001 From: Erik Rosolowsky Date: Sat, 20 Jun 2026 16:10:22 +0000 Subject: [PATCH] BUGFIX: cleanmask support for sdintimaging Update CHANGELOG --- CHANGELOG.md | 1 + phangsPipeline/handlerImaging.py | 15 +++++++++++---- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f99f7d08..260f973c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -36,6 +36,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Calculation of additional number of channels in regrid mstransform call (#344). - Fix stokes passed as integer string to imsubimage in 4D mosaic path (#349). - Import recipe_phangs_flat_mask in handlerDerived (#357). +- Fix crash with using cleanmasks combined with new sdintimaging implementation (#360) ### Dependencies - Bump actions/upload-artifact from 6 to 7 (#313). diff --git a/phangsPipeline/handlerImaging.py b/phangsPipeline/handlerImaging.py index 32e851ca..721f58eb 100644 --- a/phangsPipeline/handlerImaging.py +++ b/phangsPipeline/handlerImaging.py @@ -817,10 +817,17 @@ def task_read_clean_mask( imaging_method=imaging_method) # import_and_align_mask - msr.import_and_align_mask(in_file=this_cleanmask, - out_file=fname_dict['mask'], - template=fname_dict['image'], - blank_to_match=True) + if imaging_method == 'tclean': + msr.import_and_align_mask(in_file=this_cleanmask, + out_file=fname_dict['mask'], + template=fname_dict['image'], + blank_to_match=True) + elif imaging_method == 'sdintimaging': + template_name = fname_dict['image'].replace('.joint.', '.sd.') + msr.import_and_align_mask(in_file=this_cleanmask, + out_file=fname_dict['mask'], + template=template_name, + blank_to_match=True) # AKL - propose to deprecate # clean_call.set_param('usemask','user')