sims

module reference

sims_lib

sims/sims_lib.py: library for collecting and handling simulations. Eventually, delensalot needs a get_sim_pmap() and get_sim_tmap(), which are the maps of the observed sky. But data may come as cls, unlensed alms, …, . So this module allows to start analysis with,
  • cls,

  • alms_unl

  • alm_len + noise

  • obs_sky

and is a mapper between them, so that get_sim_pmap() and get_sim_tmap() always returns observed maps.

class delensalot.sims.sims_lib.Cls(lmax=-123456789, phi_lmax=-123456789, CMB_fn=-123456789, phi_fn=-123456789, phi_field='potential')[source]

class for accessing CAMB-like file for CMB power spectra, optionally a distinct file for the lensing potential

class delensalot.sims.sims_lib.Simhandler(flavour, space, geominfo=-123456789, maps=-123456789, field=-123456789, cls_lib=-123456789, unl_lib=-123456789, len_lib=-123456789, obs_lib=-123456789, noise_lib=-123456789, libdir=-123456789, libdir_noise=-123456789, libdir_phi=-123456789, fns=-123456789, fnsnoise=-123456789, fnsP=-123456789, lmax=-123456789, transfunction=-123456789, nlev=-123456789, spin=0, CMB_fn=-123456789, phi_fn=-123456789, phi_field=-123456789, phi_space=-123456789, epsilon=1e-07, phi_lmax=-123456789, libdir_suffix=-123456789, lenjob_geominfo=-123456789, cacher=<delensalot.core.cachers.cacher_mem object>)[source]

Entry point for data handling and generating simulations. Data can be cl, unl, len, or obs, .. and alms or maps. Simhandler connects the individual libraries and decides what can be generated. E.g.: If obs data provided, len data cannot be generated. This structure makes sure we don’t “hallucinate” data

class delensalot.sims.sims_lib.Xobs(lmax, maps=-123456789, transfunction=-123456789, len_lib=-123456789, unl_lib=-123456789, epsilon=-123456789, noise_lib=-123456789, libdir=-123456789, fns=-123456789, nlev=-123456789, libdir_noise=-123456789, fnsnoise=-123456789, spin=-123456789, space=-123456789, geominfo=-123456789, field=-123456789, cacher=-123456789, libdir_suffix=-123456789)[source]

class for generating observed CMB realizations from sky maps together with a noise realization and transfer function to mimick an experiment

get_sim_obs(simidx, space, field, spin=2)[source]

_summary_

Parameters:
  • simidx (_type_) – _description_

  • space (_type_) – _description_

  • field (_type_) – _description_

  • spin (int, optional) – _description_. Defaults to 2.

Returns:

_description_

Return type:

_type_

class delensalot.sims.sims_lib.Xsky(lmax, unl_lib=-123456789, libdir=-123456789, fns=-123456789, spin=-123456789, epsilon=1e-07, space=-123456789, geominfo=-123456789, isfrozen=False, lenjob_geominfo=-123456789)[source]

class for generating lensed CMB and phi realizations from unlensed realizations, using lenspyx for the lensing operation

get_sim_sky(simidx, space, field, spin=2)[source]

returns a lensed simulation field (temperature, polarization) in space (map, alm) and as spin (0,2). Note, spin is only applicable for pol, and returns QU for spin=2, and EB for spin=0.

Parameters:
  • simidx (_type_) – _description_

  • space (_type_) – _description_

  • field (_type_) – _description_

  • spin (int, optional) – _description_. Defaults to 2.

Returns:

_description_

Return type:

_type_

class delensalot.sims.sims_lib.Xunl(lmax, cls_lib=-123456789, libdir=-123456789, fns=-123456789, fnsP=-123456789, libdir_phi=-123456789, phi_field='potential', phi_space=-123456789, phi_lmax=-123456789, space=-123456789, geominfo=-123456789, isfrozen=False, spin=-123456789)[source]

class for generating unlensed CMB and phi realizations from power spectra

get_sim_phi(simidx, space)[source]
Parameters:
  • simidx (_type_) – _description_

  • space (_type_) – _description_

  • spin (int, optional) – _description_. Defaults to 2.

Returns:

_description_

Return type:

_type_

get_sim_unl(simidx, space, field, spin=2)[source]

returns an unlensed simulation field (temp,pol) in space (map, alm) and as spin (0,2). Note, spin is only applicable for pol, and returns QU for spin=2, and EB for spin=0.

Parameters:
  • simidx (_type_) – _description_

  • space (_type_) – _description_

  • field (_type_) – _description_

  • spin (int, optional) – _description_. Defaults to 2.

Returns:

_description_

Return type:

_type_