From 45e63d7b69a77bda12aa44aea4a4effc2ba90e53 Mon Sep 17 00:00:00 2001 From: Aaron LI Date: Wed, 5 Oct 2016 10:13:31 +0800 Subject: Update to use the "write_fits_healpix()" function --- fg21sim/galactic/synchrotron.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'fg21sim/galactic') diff --git a/fg21sim/galactic/synchrotron.py b/fg21sim/galactic/synchrotron.py index 614aae9..44716f9 100644 --- a/fg21sim/galactic/synchrotron.py +++ b/fg21sim/galactic/synchrotron.py @@ -14,6 +14,8 @@ from astropy.io import fits import astropy.units as au import healpy as hp +from ..utils import write_fits_healpix + logger = logging.getLogger(__name__) @@ -203,11 +205,8 @@ class Synchrotron: ) if self.use_float: hpmap = hpmap.astype(np.float32) - hdu = fits.BinTableHDU.from_columns([ - fits.Column(name="I", array=hpmap, - format=FITS_COLUMN_FORMATS.get(hpmap.dtype)) - ], header=header) - hdu.writeto(filepath, clobber=self.clobber, checksum=True) + write_fits_healpix(filepath, hpmap, header=header, + clobber=self.clobber) logger.info("Write simulated map to file: {0}".format(filepath)) def simulate(self, frequencies): -- cgit v1.2.2