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 @@ -28,6 +28,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Add tests for utilsLines, and tidy up formatting (#403).
- Add optional file string in derived for nonstandard workflows (#406).
- Use SD pipeline weights in single-dish linear mosaicking (#397).
- Expose ``min_pixperbeam`` for cube compression in ``loop_postprocess`` (#411).

### Changed

Expand Down
21 changes: 18 additions & 3 deletions phangsPipeline/handlerPostprocess.py
Original file line number Diff line number Diff line change
Expand Up @@ -1202,12 +1202,17 @@ def task_compress(
out_pb_tag='pb_trimmed',
extra_ext_in='',
extra_ext_out='',
check_files=True
check_files=True,
min_pixperbeam: int = 3,
):
"""
For one target, product, config combination, compress the cube
to the smallest reasonable volume. Also align the primary beam
file out onto this grid.

Args:
min_pixperbeam (int, optional): Minimum number of pixels per beam to keep when
rebinning the cube. Defaults to 3.
"""

if postprocessing_method not in ALLOWED_POSTPROCESSING_METHODS:
Expand Down Expand Up @@ -1256,15 +1261,15 @@ def task_compress(
outfile=outdir + outfile,
overwrite=True,
inplace=False,
min_pixperbeam=3,
min_pixperbeam=min_pixperbeam,
pad=1,
)
elif postprocessing_method == "spectralcube":
scr.trim_cube(
infile=f"{indir}{infile}.fits",
outfile=f"{outdir}{outfile}.fits",
overwrite=True,
min_pixperbeam=3,
min_pixperbeam=min_pixperbeam,
pad=1,
)
else:
Expand Down Expand Up @@ -2256,11 +2261,16 @@ def recipe_cleanup_one_target(
check_files=True,
ext_ext='',
postprocessing_method="casa",
min_pixperbeam: int = 3,
):
"""
Recipe that cleans up the output for one target, converting to
Kelvin, compressing and trimming the cube and then exporting
as a FITS file.

Args:
min_pixperbeam (int, optional): Minimum number of pixels per beam to keep when
rebinning during compression. Defaults to 3.
"""

if postprocessing_method not in ALLOWED_POSTPROCESSING_METHODS:
Expand All @@ -2276,6 +2286,7 @@ def recipe_cleanup_one_target(
do_trimrind=True,
extra_ext_in=ext_ext,
extra_ext_out=ext_ext,
min_pixperbeam=min_pixperbeam,
)

self.task_convert_units(
Expand Down Expand Up @@ -2321,6 +2332,7 @@ def loop_postprocess(
feather_noapod: bool = False,
feather_before_mosaic: bool = False,
make_directories: bool = True,
min_pixperbeam: int = 3,
):
"""
Loops over the full set of targets, products, and
Expand Down Expand Up @@ -2350,6 +2362,8 @@ def loop_postprocess(
Defaults to False.
make_directories (bool, optional): If True, will make directories that don't already exist.
Defaults to True.
min_pixperbeam (int, optional): Minimum number of pixels per beam to keep when
rebinning during the cleanup (compression) step. Defaults to 3.
"""

if postprocessing_method not in ALLOWED_POSTPROCESSING_METHODS:
Expand Down Expand Up @@ -2628,6 +2642,7 @@ def loop_postprocess(
config=this_config,
check_files=True,
postprocessing_method=postprocessing_method,
min_pixperbeam=min_pixperbeam,
)

# Build reports summarizing the properties of the final
Expand Down
Loading