diff options
author | Aaron LI <aaronly.me@outlook.com> | 2016-10-05 10:13:31 +0800 |
---|---|---|
committer | Aaron LI <aaronly.me@outlook.com> | 2016-10-05 10:13:31 +0800 |
commit | 45e63d7b69a77bda12aa44aea4a4effc2ba90e53 (patch) | |
tree | 8bef5b5a22de95de946331d708a5bd2aa5b3d5b4 /fg21sim/galactic | |
parent | b3b2bb0363d320eb44f1a64afaeb5f8a45d461aa (diff) | |
download | fg21sim-45e63d7b69a77bda12aa44aea4a4effc2ba90e53.tar.bz2 |
Update to use the "write_fits_healpix()" function
Diffstat (limited to 'fg21sim/galactic')
-rw-r--r-- | fg21sim/galactic/synchrotron.py | 9 |
1 files changed, 4 insertions, 5 deletions
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): |