diff options
| author | Aaron LI <aly@aaronly.me> | 2017-09-13 01:03:20 +0800 | 
|---|---|---|
| committer | Aaron LI <aly@aaronly.me> | 2017-09-13 01:03:20 +0800 | 
| commit | 3d322b099ec2f62c112fe0328a634e5cc0223310 (patch) | |
| tree | 80e2fd53013b725bd9718bf931ca9e3a6ca5071e | |
| parent | b4f24c498271c4520cd840b84aa29ecdc4ce907a (diff) | |
| download | atoolbox-3d322b099ec2f62c112fe0328a634e5cc0223310.tar.bz2 | |
fits2skymodel.py: Convert image to float32; Fix a string format error
| -rwxr-xr-x | astro/oskar/fits2skymodel.py | 6 | 
1 files changed, 3 insertions, 3 deletions
diff --git a/astro/oskar/fits2skymodel.py b/astro/oskar/fits2skymodel.py index 4d2f847..324ee2a 100755 --- a/astro/oskar/fits2skymodel.py +++ b/astro/oskar/fits2skymodel.py @@ -179,7 +179,7 @@ class SkyModel:          Write the converted sky model for simulation.          """          if os.path.exists(outfile) and (not clobber): -            raise OSError("OSKAR sky model file already exists: " % outfile) +            raise OSError("OSKAR sky model file already exists: %s" % outfile)          sky = self.sky          counts = sky.shape[0]          percent = 100 * counts / self.image.size @@ -282,8 +282,8 @@ def main():                  os.mkdir(args.outdir)      with fits.open(args.infile) as f: -        image = f[0].data -        header = f[0].header +        image = f[0].data.astype(np.float32) +        header = f[0].header.copy(strip=True)      logger.info("Read input FITS image: %s" % args.infile)      # Check data unit  | 
