diff options
author | Aaron LI <aaronly.me@outlook.com> | 2016-12-13 18:46:05 +0800 |
---|---|---|
committer | Aaron LI <aaronly.me@outlook.com> | 2016-12-13 18:46:05 +0800 |
commit | 595f5a2be0e0257c1ef0168ecf7d31025c61c608 (patch) | |
tree | d6786eacf8f0e2e609e18e6cf2e0ee767a2fb891 /fg21sim/galactic/snr.py | |
parent | 35c33056c2da0e4ee1948c4b453567d86a3b7768 (diff) | |
download | fg21sim-595f5a2be0e0257c1ef0168ecf7d31025c61c608.tar.bz2 |
galactic/snr.py: Use HEALPix pixel area if object smaller than it
Diffstat (limited to 'fg21sim/galactic/snr.py')
-rw-r--r-- | fg21sim/galactic/snr.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/fg21sim/galactic/snr.py b/fg21sim/galactic/snr.py index bc39c7e..d331a88 100644 --- a/fg21sim/galactic/snr.py +++ b/fg21sim/galactic/snr.py @@ -88,8 +88,9 @@ class SuperNovaRemnants: self.checksum = self.configs.getn("output/checksum") self.clobber = self.configs.getn("output/clobber") self.nside = self.configs.getn("common/nside") + self.pixsize = hp.nside2resol(self.nside, arcmin=True) / 60.0 + self.pixarea = self.pixsize ** 2 # [ deg^2 ] self.freq_unit = au.Unit(self.configs.getn("frequency/unit")) - # logger.info("Loaded and set up configurations") def _load_catalog(self): @@ -224,6 +225,9 @@ class SuperNovaRemnants: freq_ref = self.catalog_flux_freq # [ MHz ] Fnu = flux * (frequency / freq_ref) ** (-specindex) # [ Jy ] omega = size[0] * size[1] # [ deg^2 ] + if omega < self.pixarea: + # The object is smaller than a pixel, so round up to a pixel area + omega = self.pixarea Tb = Fnu_to_Tb_fast(Fnu, omega, frequency) return Tb |