Skip to content

Commit

Permalink
implement color correction in d12
Browse files Browse the repository at this point in the history
Close #128
  • Loading branch information
zonca committed Dec 1, 2022
1 parent 63b29ba commit b3f197b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
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

0 comments on commit b3f197b

Please sign in to comment.