From 17059ea1298c3003aea228ac1490b5e395de1ac6 Mon Sep 17 00:00:00 2001 From: Aaron LI Date: Sun, 3 Sep 2017 20:30:00 +0800 Subject: wsclean.py: Fix --args to pass extra arguments to WSClean --- astro/oskar/wsclean.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/astro/oskar/wsclean.py b/astro/oskar/wsclean.py index 29cfdbb..da22e7f 100755 --- a/astro/oskar/wsclean.py +++ b/astro/oskar/wsclean.py @@ -11,6 +11,7 @@ import os +import re import argparse import subprocess import time @@ -35,8 +36,9 @@ def main(): parser = argparse.ArgumentParser(description="Run WSClean") parser.add_argument("-n", "--dry-run", dest="dryrun", action="store_true", help="do not actually run WSClean") - parser.add_argument("--args", dest="args", nargs="*", - help="additional arguments for WSClean") + parser.add_argument("--args", dest="args", + help="additional arguments for WSClean " + + "(in a quoted string separated by space)") parser.add_argument("--dirty", dest="dirty", action="store_true", help="only create dirty images (by setting niter=0)") parser.add_argument("--update-model", dest="update_model", @@ -116,7 +118,9 @@ def main(): # additional WSClean arguments if args.args: - cmdargs += args.args + extra_args = re.split(r"\s+", args.args.strip()) + print("Additional WSClean arguments:", extra_args) + cmdargs += extra_args nameprefix = args.name.rstrip("-_") cmdargs += ["-name", nameprefix] -- cgit v1.2.2