From d6139eda9b113f0ef04a82881e6d31f174863d91 Mon Sep 17 00:00:00 2001 From: Andrea Zonca Date: Thu, 1 Dec 2022 09:16:40 -0800 Subject: [PATCH 1/3] implement color correction in d12 Close #128 --- pysm3/data/presets.cfg | 1 + pysm3/models/dust_layers.py | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/pysm3/data/presets.cfg b/pysm3/data/presets.cfg index 8e353302..b6ca1035 100644 --- a/pysm3/data/presets.cfg +++ b/pysm3/data/presets.cfg @@ -180,6 +180,7 @@ freq_ref = "353 GHz" map_mbb_index = "mkd_dust/2048/thermaldust_specind{layer}.fits" map_mbb_temperature = "mkd_dust/2048/thermaldust_temp{layer}.fits" num_layers = 6 +color_correction = 0.911 unit_layers = "MJy/sr" unit_mbb_temperature = "K" max_nside = 2048 diff --git a/pysm3/models/dust_layers.py b/pysm3/models/dust_layers.py index 43a5d45b..e232681e 100644 --- a/pysm3/models/dust_layers.py +++ b/pysm3/models/dust_layers.py @@ -18,6 +18,7 @@ def __init__( map_mbb_index, map_mbb_temperature, nside, + color_correction=1, max_nside=None, num_layers=1, unit_layers=None, @@ -51,6 +52,9 @@ def __init__( Alternatively an array of shape (num_layers, num_pix) nside: int Resolution parameter at which this model is to be calculated (with `ud_grade`) + color_correction: float + Scalar correction factor multiplied to the maps, implemented to add + a color correction factor to Planck HFI 353 GHz maps """ super().__init__(nside=nside, max_nside=max_nside, map_dist=map_dist) num_pix = hp.nside2npix(nside) @@ -66,6 +70,9 @@ def __init__( else: self.layers = u.Quantity(map_layers, unit_layers) + self.color_correction = color_correction + self.layers *= self.color_correction + self.freq_ref = u.Quantity(freq_ref).to(u.GHz) with u.set_enabled_equivalencies(u.cmb_equivalencies(self.freq_ref)): From 18398446fbceddadab9dd4a06f34bca86f19c6a8 Mon Sep 17 00:00:00 2001 From: Andrea Zonca Date: Thu, 1 Dec 2022 09:27:09 -0800 Subject: [PATCH 2/3] add color correction to unit test --- pysm3/tests/test_dust_layers.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pysm3/tests/test_dust_layers.py b/pysm3/tests/test_dust_layers.py index 4c4134ac..913a9956 100644 --- a/pysm3/tests/test_dust_layers.py +++ b/pysm3/tests/test_dust_layers.py @@ -54,6 +54,6 @@ def test_model_d12(freq): 8, unit=u.MJy / u.sr, field=(0, 1, 2), - ) + ) * 0.911 assert_quantity_allclose(expected_map, emission, rtol=1e-5) From dbf3efcfb7d0973f5a8ee60e166f28b0005f0307 Mon Sep 17 00:00:00 2001 From: Andrea Zonca Date: Thu, 1 Dec 2022 09:30:32 -0800 Subject: [PATCH 3/3] Document color correction of d12 and issue in last beta --- CHANGES.rst | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGES.rst b/CHANGES.rst index 97ca2373..f7eb6097 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -1,9 +1,12 @@ 3.4.0 (unreleased) ================== +- Implementation of color correction (multiply by a factor of 0.911) in `d12` https://github.com/galsci/pysm/pull/141 + 3.4.0b4 (2022-11-21) ==================== +- **Known issue**: `d12` was missing color correction, see https://github.com/galsci/pysm/issues/128#issuecomment-1332843288 - Brand new implementation of small scales injection for Synchrotron `PR 134 `_, affects `s4`, `s5`, `s6`, `s7` - Brand new implementation of small scales injection for GNILC Dust `PR 133 `_, affects `d9`, `d10`, `d11` - Fix bug in `InterpolatingComponent`, when the user requested a frequency between 2 available points, the weighting of the 2 relevant maps was switched, see `PR 129 `_