Skip to content

Commit

Permalink
Add num_beams
Browse files Browse the repository at this point in the history
  • Loading branch information
AlecThomson committed Apr 18, 2024
1 parent 6cd6463 commit ffff9a8
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
13 changes: 11 additions & 2 deletions arrakis/imager.py
Original file line number Diff line number Diff line change
Expand Up @@ -615,6 +615,7 @@ def fix_ms_askap_corrs(ms: Path, *args, **kwargs) -> Path:
def main(
msdir: Path,
out_dir: Path,
num_beams: int = 36,
temp_dir_images: Optional[Path] = None,
temp_dir_wsclean: Optional[Path] = None,
cutoff: Optional[float] = None,
Expand Down Expand Up @@ -652,6 +653,7 @@ def main(
Args:
msdir (Path): Path to the directory containing the MS files.
out_dir (Path): Path to the directory where the images will be written.
num_beams (int, optional): Number of beams to image. Defaults to 36.
temp_dir_images (Optional[Path], optional): Path for temporary files to be written. Defaults to None.
temp_dir_wsclean (Optional[Path], optional): Path for temporary files to be written by WSClean. Defaults to None.
cutoff (Optional[float], optional): WSClean cutoff. Defaults to None.
Expand Down Expand Up @@ -691,8 +693,8 @@ def main(
mslist = sorted(msdir.glob(ms_glob_pattern))

assert (len(mslist) > 0) & (
len(mslist) == 36
), f"Incorrect number of MS files found: {len(mslist)} / 36"
len(mslist) == num_beams
), f"Incorrect number of MS files found: {len(mslist)} / {num_beams} - glob pattern: {ms_glob_pattern}"

logger.info(f"Will image {len(mslist)} MS files in {msdir} to {out_dir}")
cleans = []
Expand Down Expand Up @@ -1009,6 +1011,12 @@ def imager_parser(parent_parser: bool = False) -> argparse.ArgumentParser:
default=False,
help="Do not apply the ASKAP MS corrections from the package fixms. ",
)
parser.add_argument(
"--num_beams",
type=int,
help="Number of beams to image",
default=36,
)

group = parser.add_argument_group("wsclean container options")
mxg = group.add_mutually_exclusive_group()
Expand Down Expand Up @@ -1043,6 +1051,7 @@ def cli():
main(
msdir=args.msdir,
out_dir=args.datadir,
num_beams=args.num_beams,
temp_dir_wsclean=args.temp_dir_wsclean,
temp_dir_images=args.temp_dir_images,
cutoff=args.psf_cutoff,
Expand Down
1 change: 1 addition & 0 deletions arrakis/process_spice.py
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,7 @@ def main(args: configargparse.Namespace) -> None:
)(
msdir=args.msdir,
out_dir=args.datadir,
num_beams=args.num_beams,
temp_dir_wsclean=args.temp_dir_wsclean,
temp_dir_images=args.temp_dir_images,
cutoff=args.psf_cutoff,
Expand Down

0 comments on commit ffff9a8

Please sign in to comment.