Skip to content

Commit

Permalink
Merge pull request #141 from galsci/color_corr_d12
Browse files Browse the repository at this point in the history
Implement color correction in d12
  • Loading branch information
zonca authored Dec 1, 2022
2 parents 32a6476 + dbf3efc commit a56a05e
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 1 deletion.
3 changes: 3 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
@@ -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 <https://github.com/galsci/pysm/pull/134>`_, affects `s4`, `s5`, `s6`, `s7`
- Brand new implementation of small scales injection for GNILC Dust `PR 133 <https://github.com/galsci/pysm/pull/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 <https://github.com/galsci/pysm/pull/129>`_
Expand Down
1 change: 1 addition & 0 deletions pysm3/data/presets.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 7 additions & 0 deletions pysm3/models/dust_layers.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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)
Expand All @@ -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)):
Expand Down
2 changes: 1 addition & 1 deletion pysm3/tests/test_dust_layers.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

0 comments on commit a56a05e

Please # to comment.