From d4b05a8233310bb0c7cd319f2a30cd91142a5671 Mon Sep 17 00:00:00 2001 From: Aaron LI Date: Tue, 22 Aug 2017 14:37:06 +0800 Subject: fits2skymodel.py: Fix several small bugs --- astro/oskar/fits2skymodel.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/astro/oskar/fits2skymodel.py b/astro/oskar/fits2skymodel.py index cc66092..1852013 100755 --- a/astro/oskar/fits2skymodel.py +++ b/astro/oskar/fits2skymodel.py @@ -176,7 +176,7 @@ class SkyModel: def write_fits(self, outfile, oldheader=None, clobber=False): if os.path.exists(outfile) and (not clobber): - raise OSError("Sky FITS already exists: " % outfile) + raise OSError("Sky FITS already exists: %s" % outfile) if oldheader is not None: header = oldheader header.extend(self.fits_header, update=True) @@ -196,7 +196,7 @@ class SkyModel: def write_mask(self, outfile, clobber=False): if os.path.exists(outfile) and (not clobber): - raise OSError("Sky mask already exists: " % outfile) + raise OSError("Sky mask already exists: %s" % outfile) header = self.fits_header header.add_history(datetime.now().isoformat()) header.add_history(" ".join(sys.argv)) @@ -243,8 +243,8 @@ def main(): help="save a FITS version of the converted sky model") parser.add_argument("-o", "--outdir", dest="outdir", help="output directory for sky model files") - exgrp.add_argument("--create-mask", dest="create_mask", - help="create a FITS mask for the output sky model") + parser.add_argument("--create-mask", dest="create_mask", + help="create a FITS mask for the output sky model") parser.add_argument("infile", help="input FITS image") parser.add_argument("outfile", nargs="?", help="output OSKAR sky model (default: " + -- cgit v1.2.2