aboutsummaryrefslogtreecommitdiffstats
path: root/fg21sim
diff options
context:
space:
mode:
authorAaron LI <aaronly.me@outlook.com>2016-10-05 10:13:31 +0800
committerAaron LI <aaronly.me@outlook.com>2016-10-05 10:13:31 +0800
commit45e63d7b69a77bda12aa44aea4a4effc2ba90e53 (patch)
tree8bef5b5a22de95de946331d708a5bd2aa5b3d5b4 /fg21sim
parentb3b2bb0363d320eb44f1a64afaeb5f8a45d461aa (diff)
downloadfg21sim-45e63d7b69a77bda12aa44aea4a4effc2ba90e53.tar.bz2
Update to use the "write_fits_healpix()" function
Diffstat (limited to 'fg21sim')
-rw-r--r--fg21sim/galactic/synchrotron.py9
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):