Skip to content

Commit

Permalink
Merge pull request #347 from litebird/co_maps
Browse files Browse the repository at this point in the history
Update Mbs
  • Loading branch information
paganol authored Nov 27, 2024
2 parents bbc4f7d + 2e82830 commit f948459
Show file tree
Hide file tree
Showing 22 changed files with 530 additions and 283 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ The function is executable by: `python -m litebird_sim.plot_fp` [#345](https://g

- Simulation.add_noise() uses self.random as default random number generator [#349](https://github.com/litebird/litebird_sim/pull/349)

- Mbs updated, code aligned to pysm 3.4.0, CO lines included plus other new foreground models [#347](https://github.com/litebird/litebird_sim/pull/347)

# Version 0.13.0

- **Breaking change**: new API for pointing computation [#319](https://github.com/litebird/litebird_sim/pull/319). Here is a in-depth list of all the breaking changes in this PR:
Expand Down
45 changes: 44 additions & 1 deletion docs/source/sky_maps.rst
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,22 @@ framework to generate a CMB map::

import litebird_sim as lbs

nside = 512

sim = lbs.Simulation(base_path="../output", random_seed=12345)
params = lbs.MbsParameters(
make_cmb=True,
make_fg=True,
fg_models=["pysm_synch_0", "pysm_freefree_1"],
nside=nside,
)
mbs = lbs.Mbs(
simulation=sim,
parameters=params,
channel_list=[
lbs.FreqChannelInfo.from_imo(
sim.imo,
"/releases/v1.3/satellite/LFT/L1-040/channel_info",
"/releases/vPTEP/satellite/LFT/L1-040/channel_info",
),
],
)
Expand All @@ -59,6 +63,7 @@ multipole of these alms with ``lmax_alms``, the default value is
:math:`4\times N_{side}`. If ``gaussian_smooth`` is False, Mbs returns
the umbeamed maps or alms.


Available emission models
-------------------------

Expand All @@ -70,20 +75,44 @@ following:

- ``pysm_ame_1``

- ``pysm_ame_2``

- CO Lines:

- ``pysm_co_1``

- ``pysm_co_2``

- ``pysm_co_3``

- Dust:

- ``pysm_dust_0``

- ``pysm_dust_1``

- ``pysm_dust_2``

- ``pysm_dust_3``

- ``pysm_dust_4``

- ``pysm_dust_5``

- ``pysm_dust_6``

- ``pysm_dust_7``

- ``pysm_dust_8``

- ``pysm_dust_9``

- ``pysm_dust_10``

- ``pysm_dust_11``

- ``pysm_dust_12``

- Free-free:

- ``pysm_freefree_1``
Expand All @@ -94,6 +123,20 @@ following:

- ``pysm_synch_1``

- ``pysm_synch_2``

- ``pysm_synch_3``

- ``pysm_synch_4``

- ``pysm_synch_5``

- ``pysm_synch_6``


See `here <https://github.com/galsci/pysm/blob/3.4.0/pysm3/data/presets.cfg>`_ for
details of the foreground modes implemented.


Monte Carlo simulations
-----------------------
Expand Down
27 changes: 27 additions & 0 deletions litebird_sim/mbs/fg_models/pysm_ame_2.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#PYSM model for ame (a2)
#two population, one with fixed peak emissivity, the other with variable
#temperature and polarization

[ame_TP]
[ame_TP.comp1]
class = "SpDustPol"
map_I = "pysm_2/ame_t_new.fits"
unit_I = "uK_RJ"
freq_ref_I = "22.8 GHz"
emissivity = "pysm_2/emissivity.txt"
freq_peak = "pysm_2/ame_nu_peak_0.fits"
freq_ref_peak = "30 GHz"
pol_frac = 0.02
angle_Q = "pysm_2/dust_q_new.fits"
angle_U = "pysm_2/dust_u_new.fits"
[ame_TP.comp2]
class = "SpDustPol"
map_I = "pysm_2/ame2_t_new.fits"
unit_I = "uK_RJ"
freq_ref_I = "41 GHz"
emissivity = "pysm_2/emissivity.txt"
freq_peak = "33.35 GHz"
freq_ref_peak = "30 GHz"
pol_frac = 0.02
angle_Q = "pysm_2/dust_q_new.fits"
angle_U = "pysm_2/dust_u_new.fits"
3 changes: 3 additions & 0 deletions litebird_sim/mbs/fg_models/pysm_co_1.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[co1]
class = "COLines"
has_polarization = false
4 changes: 4 additions & 0 deletions litebird_sim/mbs/fg_models/pysm_co_2.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[co2]
class = "COLines"
has_polarization = true
polarization_fraction = 0.001
5 changes: 5 additions & 0 deletions litebird_sim/mbs/fg_models/pysm_co_3.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[co3]
class = "COLines"
has_polarization = true
polarization_fraction = 0.001
include_high_galactic_latitude_clouds = true
10 changes: 10 additions & 0 deletions litebird_sim/mbs/fg_models/pysm_dust_10.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#PYSM model for dust (d10)

[dust_poltens_var_spec]
class = "ModifiedBlackBody"
map_I = "dust_gnilc/gnilc_dust_template_nside{nside}_2023.02.10.fits"
map_mbb_index = "dust_gnilc/gnilc_dust_beta_nside{nside}_2023.06.06.fits"
map_mbb_temperature = "dust_gnilc/gnilc_dust_Td_nside{nside}_2023.06.06.fits"
freq_ref_I = "353 GHz"
freq_ref_P = "353 GHz"
max_nside = 8192
20 changes: 20 additions & 0 deletions litebird_sim/mbs/fg_models/pysm_dust_11.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#PYSM model for dust (d11)

[dust_poltens_var_spec_random]
class = "ModifiedBlackBodyRealization"
amplitude_modulation_temp_alm = "dust_gnilc/raw/gnilc_dust_temperature_modulation_alms_lmax768.fits.gz"
amplitude_modulation_pol_alm = "dust_gnilc/raw/gnilc_dust_polarization_modulation_alms_lmax768.fits.gz"
largescale_alm = "dust_gnilc/raw/gnilc_dust_largescale_template_logpoltens_alm_nside2048_lmax1024_complex64.fits.gz"
small_scale_cl = "dust_gnilc/raw/gnilc_dust_small_scales_logpoltens_cl_lmax16384.fits.gz"
largescale_alm_mbb_index = "dust_gnilc/raw/gnilc_dust_largescale_template_beta_alm_nside2048_lmax1024.fits.gz"
small_scale_cl_mbb_index = "dust_gnilc/raw/gnilc_dust_small_scales_beta_cl_lmax16384_2023.06.06.fits.gz"
largescale_alm_mbb_temperature = "dust_gnilc/raw/gnilc_dust_largescale_template_Td_alm_nside2048_lmax1024.fits.gz"
small_scale_cl_mbb_temperature = "dust_gnilc/raw/gnilc_dust_small_scales_Td_cl_lmax16384_2023.06.06.fits.gz"
freq_ref = "353 GHz"
# Remove the galplane_fix option to skip applying the galactic plane fix
galplane_fix = "dust_gnilc/raw/gnilc_dust_galplane.fits.gz"
galplane_fix_beta_Td = "dust_gnilc/raw/gnilc_dust_beta_Td_galplane.fits.gz"
# Configuration for reproducing d10
# seeds = [8192,777,888]
# synalm_lmax = 16384
max_nside = 8192
13 changes: 13 additions & 0 deletions litebird_sim/mbs/fg_models/pysm_dust_12.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#PYSM model for dust (d12)

[dust_layers]
class = "ModifiedBlackBodyLayers"
map_layers = "mkd_dust/2048/thermaldust_ampl{layer}.fits"
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
15 changes: 15 additions & 0 deletions litebird_sim/mbs/fg_models/pysm_dust_2.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#PYSM model for dust (d2)

[dust_var_spec_mean1p59_std0p2]
class = "ModifiedBlackBody"
map_I = "pysm_2/dust_t_new.fits"
map_Q = "pysm_2/dust_q_new.fits"
map_U = "pysm_2/dust_u_new.fits"
unit_I = "uK_RJ"
unit_Q = "uK_RJ"
unit_U = "uK_RJ"
map_mbb_index = "pysm_2/beta_mean1p59_std0p2.fits"
map_mbb_temperature = "pysm_2/dust_temp.fits"
unit_mbb_temperature = "K"
freq_ref_I = "545 GHz"
freq_ref_P = "353 GHz"
15 changes: 15 additions & 0 deletions litebird_sim/mbs/fg_models/pysm_dust_3.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#PYSM model for dust (d3)

[dust_var_spec_mean1p59_std0p3]
class = "ModifiedBlackBody"
map_I = "pysm_2/dust_t_new.fits"
map_Q = "pysm_2/dust_q_new.fits"
map_U = "pysm_2/dust_u_new.fits"
unit_I = "uK_RJ"
unit_Q = "uK_RJ"
unit_U = "uK_RJ"
map_mbb_index = "pysm_2/beta_mean1p59_std0p3.fits"
map_mbb_temperature = "pysm_2/dust_temp.fits"
unit_mbb_temperature = "K"
freq_ref_I = "545 GHz"
freq_ref_P = "353 GHz"
17 changes: 17 additions & 0 deletions litebird_sim/mbs/fg_models/pysm_dust_6.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#PYSM model for dust (d6)


[dust_decorrelated]
class = "DecorrelatedModifiedBlackBody"
correlation_length = 5.0
map_I = "pysm_2/dust_t_new.fits"
map_Q = "pysm_2/dust_q_new.fits"
map_U = "pysm_2/dust_u_new.fits"
unit_I = "uK_RJ"
unit_Q = "uK_RJ"
unit_U = "uK_RJ"
map_mbb_index = "pysm_2/dust_beta.fits"
map_mbb_temperature = "pysm_2/dust_temp.fits"
unit_mbb_temperature = "K"
freq_ref_I = "545 GHz"
freq_ref_P = "353 GHz"
2 changes: 1 addition & 1 deletion litebird_sim/mbs/fg_models/pysm_dust_8.cfg
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#PYSM model for dust (d7)
#PYSM model for dust (d8)
#taken from Hensley&Draine2017 (https://arxiv.org/pdf/1611.08607.pdf)
#and Hensley&Bull2017 (https://arxiv.org/pdf/1709.07897.pdf)

Expand Down
12 changes: 12 additions & 0 deletions litebird_sim/mbs/fg_models/pysm_dust_9.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#PYSM model for dust (d9)

[dust_poltens_fixed_spec]
class = "ModifiedBlackBody"
map_I = "dust_gnilc/gnilc_dust_template_nside{nside}_2023.02.10.fits"
# from Planck 2018 XI
map_mbb_index = 1.48
map_mbb_temperature = 19.6
unit_mbb_temperature = "K"
freq_ref_I = "353 GHz"
freq_ref_P = "353 GHz"
max_nside = 8192
1 change: 1 addition & 0 deletions litebird_sim/mbs/fg_models/pysm_freefree_1.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ map_I = "pysm_2/ff_t_new.fits"
unit_I = "uK_RJ"
map_pl_index = -2.14
freq_ref_I = "30 GHz"
has_polarization = false
13 changes: 13 additions & 0 deletions litebird_sim/mbs/fg_models/pysm_synch_2.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#PSYM model for synchrotron (s2)

[synch_var_spec_lat]
class = "PowerLaw"
map_I = "pysm_2/synch_t_new.fits"
map_Q = "pysm_2/synch_q_new.fits"
map_U = "pysm_2/synch_u_new.fits"
unit_I = "uK_RJ"
unit_Q = "uK_RJ"
unit_U = "uK_RJ"
map_pl_index = "pysm_2/beta_latvar.fits"
freq_ref_I = "408 MHz"
freq_ref_P = "23 GHz"
15 changes: 15 additions & 0 deletions litebird_sim/mbs/fg_models/pysm_synch_3.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#PSYM model for synchrotron (s3)

[synch_var_spec_curved]
class = "CurvedPowerLaw"
map_I = "pysm_2/synch_t_new.fits"
map_Q = "pysm_2/synch_q_new.fits"
map_U = "pysm_2/synch_u_new.fits"
unit_I = "uK_RJ"
unit_Q = "uK_RJ"
unit_U = "uK_RJ"
map_pl_index = "pysm_2/synch_beta.fits"
freq_ref_I = "408 MHz"
freq_ref_P = "23 GHz"
spectral_curvature = -0.052
freq_curve = "23 GHz"
9 changes: 9 additions & 0 deletions litebird_sim/mbs/fg_models/pysm_synch_4.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#PSYM model for synchrotron (s4)

[synch_poltens_fixed_spec]
class = "PowerLaw"
map_I = "synch/synch_template_nside{nside}_2023.02.25.fits"
map_pl_index = -3.1
freq_ref_I = "23 GHz"
freq_ref_P = "23 GHz"
max_nside = 8192
9 changes: 9 additions & 0 deletions litebird_sim/mbs/fg_models/pysm_synch_5.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#PSYM model for synchrotron (s5)

[synch_poltens_var_spec]
class = "PowerLaw"
map_I = "synch/synch_template_nside{nside}_2023.02.25.fits"
map_pl_index = "synch/synch_beta_nside{nside}_2023.02.16.fits"
freq_ref_I = "23 GHz"
freq_ref_P = "23 GHz"
max_nside = 8192
18 changes: 18 additions & 0 deletions litebird_sim/mbs/fg_models/pysm_synch_6.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#PSYM model for synchrotron (s6)

[synch_var_spec_random]
class = "PowerLawRealization"
largescale_alm = "synch/raw/synch_largescale_template_logpoltens_alm_lmax128_2023.02.24.fits.gz"
amplitude_modulation_temp_alm = "synch/raw/synch_temperature_modulation_alms_lmax64_2023.02.24.fits.gz"
amplitude_modulation_pol_alm = "synch/raw/synch_polarization_modulation_alms_lmax64_2023.02.24.fits.gz"
amplitude_modulation_beta_alm = "synch/raw/synch_amplitude_modulation_alms_lmax768.fits.gz"
small_scale_cl = "synch/raw/synch_small_scales_cl_lmax16384_2023.02.24.fits.gz"
largescale_alm_pl_index = "synch/raw/synch_largescale_beta_alm_nside512_lmax768.fits.gz"
small_scale_cl_pl_index = "synch/raw/synch_small_scales_beta_cl_lmax16384.fits.gz"
freq_ref = "23 GHz"
max_nside = 8192
# Remove the galplane_fix option to skip applying the galactic plane fix
galplane_fix = "synch/raw/synch_galplane.fits.gz"
# Configuration for reproducing s5
# seeds = [555,444]
# synalm_lmax = 16384
Loading

0 comments on commit f948459

Please sign in to comment.