diff options
author | Aaron LI <aly@aaronly.me> | 2017-09-01 16:10:51 +0800 |
---|---|---|
committer | Aaron LI <aly@aaronly.me> | 2017-09-01 16:10:51 +0800 |
commit | 774bff57c34da5d7e2fa950a03d9cab51c60ec64 (patch) | |
tree | 8a3d9a90cf8422fa7f9c01235bb575542ad05865 /astro/oskar | |
parent | 1cb34b9251bad2e53f62f461a106de0d212c47d0 (diff) | |
download | atoolbox-774bff57c34da5d7e2fa950a03d9cab51c60ec64.tar.bz2 |
wsclean.py: Remove -image.fits when only create dirty image
And some minor tweaks.
Diffstat (limited to 'astro/oskar')
-rwxr-xr-x | astro/oskar/wsclean.py | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/astro/oskar/wsclean.py b/astro/oskar/wsclean.py index aef358e..18e4b4c 100755 --- a/astro/oskar/wsclean.py +++ b/astro/oskar/wsclean.py @@ -10,6 +10,7 @@ # +import os import argparse import subprocess import time @@ -21,7 +22,9 @@ def wsclean(args): print("CMD: %s" % " ".join(cmd)) subprocess.check_call(cmd) t2 = time.perf_counter() - print("Elapsed time: %.1f [min]" % ((t2-t1)/60)) + print("-----------------------------------------------------------") + print("WSClean Elapsed time: %.1f [min]" % ((t2-t1)/60)) + print("-----------------------------------------------------------") def main(): @@ -48,8 +51,7 @@ def main(): parser.add_argument("--pixelsize", dest="pixelsize", type=float, required=True, help="output image pixel size [arcsec]") - parser.add_argument("--taper-gaussian", dest="taper_gaussian", - type=float, + parser.add_argument("--taper-gaus", dest="taper_gaus", type=float, help="taper the weights with a Gaussian function " + "to reduce the contribution of long baselines. " + "Gaussian beam size in [arcsec].") @@ -103,18 +105,23 @@ def main(): else: cmdargs += ["-auto-threshold", str(args.threshold_auto)] - if args.taper_gaussian: - cmdargs += ["-taper-gaussian", str(args.taper_gaussian)] + if args.taper_gaus: + cmdargs += ["-taper-gaussian", str(args.taper_gaus)] # additional WSClean arguments if args.args: cmdargs += args.args - cmdargs += ["-name", args.name.rstrip("-_")] + nameprefix = args.name.rstrip("-_") + cmdargs += ["-name", nameprefix] cmdargs += args.ms wsclean(cmdargs) + if args.dirty: + # Remove the output "-image" since it is identical to "-dirty" + os.remove(nameprefix+"-image.fits") + if __name__ == "__main__": main() |