aboutsummaryrefslogtreecommitdiffstats
path: root/astro/oskar
diff options
context:
space:
mode:
authorAaron LI <aly@aaronly.me>2017-09-03 20:30:00 +0800
committerAaron LI <aly@aaronly.me>2017-09-03 20:30:00 +0800
commit17059ea1298c3003aea228ac1490b5e395de1ac6 (patch)
treef2303816173a00fdd2ee001efb9915db9953be43 /astro/oskar
parent97a5e67495c3a92e8bb82275f9168843bb7cb1ac (diff)
downloadatoolbox-17059ea1298c3003aea228ac1490b5e395de1ac6.tar.bz2
wsclean.py: Fix --args to pass extra arguments to WSClean
Diffstat (limited to 'astro/oskar')
-rwxr-xr-xastro/oskar/wsclean.py10
1 files 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]