From de3a72df65ec07070f715a2a6aa886c983464353 Mon Sep 17 00:00:00 2001 From: Aaron LI Date: Tue, 9 Jan 2018 21:37:04 +0800 Subject: astro/fits2skymodel: Fix a minus sign for WCS CDELT1 and other two minor fixes --- astro/oskar/fits2skymodel.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'astro/oskar/fits2skymodel.py') diff --git a/astro/oskar/fits2skymodel.py b/astro/oskar/fits2skymodel.py index bcbb328..1617c9a 100755 --- a/astro/oskar/fits2skymodel.py +++ b/astro/oskar/fits2skymodel.py @@ -1,6 +1,6 @@ #!/usr/bin/env python3 # -# Copyright (c) 2017 Weitian LI +# Copyright (c) 2017-2018 Weitian LI # MIT License # @@ -114,7 +114,7 @@ class SkyModel: wcs_.wcs.ctype = ["RA---"+self.projection, "DEC--"+self.projection] wcs_.wcs.crval = np.array([self.ra0, self.dec0]) wcs_.wcs.crpix = np.array([shape[1], shape[0]]) / 2.0 + 1 - wcs_.wcs.cdelt = np.array([delta, delta]) + wcs_.wcs.cdelt = np.array([-delta, delta]) # NOTE the minus sign return wcs_ @property @@ -204,7 +204,7 @@ class SkyModel: logger.info("Source counts: %d (%.1f%%)" % (counts, percent)) header = ("Frequency = %.3f [MHz]\n" % self.freq + "Pixel size = %.2f [arcsec]\n" % self.pixelsize + - "K2JyPixel = %.2f\n" % self.factor_K2JyPixel + + "K2JyPixel = %.3e\n" % self.factor_K2JyPixel + "RA0 = %.4f [deg]\n" % self.ra0 + "Dec0 = %.4f [deg]\n" % self.dec0 + "Minimum value = %.4e [K]\n" % self.minvalue + @@ -225,7 +225,7 @@ class SkyModel: header = self.fits_header header.add_history(datetime.now().isoformat()) header.add_history(" ".join(sys.argv)) - image = self.image + image = self.image.copy() image[~self.mask] = np.nan image *= self.factor_K2JyPixel hdu = fits.PrimaryHDU(data=image, header=header) -- cgit v1.2.2