diff --git a/CHANGELOG.md b/CHANGELOG.md index 68b9ae5..ca6101a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/phangsPipeline/handlerPostprocess.py b/phangsPipeline/handlerPostprocess.py index f6303f5..0b84867 100644 --- a/phangsPipeline/handlerPostprocess.py +++ b/phangsPipeline/handlerPostprocess.py @@ -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: @@ -1256,7 +1261,7 @@ def task_compress( outfile=outdir + outfile, overwrite=True, inplace=False, - min_pixperbeam=3, + min_pixperbeam=min_pixperbeam, pad=1, ) elif postprocessing_method == "spectralcube": @@ -1264,7 +1269,7 @@ def task_compress( infile=f"{indir}{infile}.fits", outfile=f"{outdir}{outfile}.fits", overwrite=True, - min_pixperbeam=3, + min_pixperbeam=min_pixperbeam, pad=1, ) else: @@ -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: @@ -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( @@ -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 @@ -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: @@ -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