plancklens.patchy

This module contain methods for QE-related analytical predictions on data or filtering with inhomogeneous noise

plancklens.patchy.patchy.get_ivf_cls(cls_cmb_dat, cls_cmb_filt, lmin, lmax, nlevt_f, nlevp_f, nlevt_m, nlevp_m, transf, jt_tp=False)[source]

inverse filtered spectra (spectra of Cov^-1 X) for CMB inverse-variance filtering

Parameters:
  • cls_cmb_dat – dict of cmb cls of the data maps

  • cls_cmb_filt – dict of cmb cls used in the filtering matrix

  • lmin – minimum multipole considered

  • lmax – maximum multipole considered

  • nlevt_f – fiducial temperature noise level used in the filtering in uK-amin

  • nlevp_f – fiducial polarization noise level used in the filtering in uK-amin

  • nlevt_m – temperature noise level of the data in uK-amin

  • nlevp_m – polarization noise level of the data in uK-amin

  • transf – CMB transfer function

  • jt_tp – if set joint temperature-polarization filtering is performed. If not they are filtered independently

Returns:

dict of inverse-variance filtered maps spectra (for N0 calcs.) dict of filtering matrix spectra (for response calcs. This has no dependence on the data parts of the inputs)

plancklens.patchy.patchy.get_nhls(qe_key1, qe_key2, cls_cmb_dat, cls_cmb_filt, cls_weight, lmin, lmax, lmax_qlm, transf, nlevts_filt, nlevts_map, nlevps_filt, nlevps_map, joint_TP=False, cacher=<plancklens.helpers.cachers.cacher_mem object>)[source]

Collects unnormalized estimator noise levels for a list of filtering noise levels and data map noise levels

Parameters:
  • qe_key1 – first QE estimator key

  • qe_key2 – second QE estimator key

  • cls_cmb_dat – CMB cls of the data maps

  • cls_cmb_filt – CMB cls used for the filtering

  • cls_weight – CMB cls in the QE weights

  • lmin – minimum CMB multipole considered

  • lmax – maximum CMB multipole considered

  • lmax_qlm – QE output lmax

  • transf – CMB transfer function

  • nlevts_filt – list or array of filtering temperature noise levels

  • nlevts_map – list or array of data map temperature noise levels

  • nlevps_filt – list or array of filtering polarization noise levels

  • nlevps_map – list or array of data maptemperature noise levels

  • joint_TP – uses joint temperature and polarization filtering if set, separate if not

  • cacher – can be used to store results

Returns:

lists of reconstruction noise levels (GG, CC, GC CG for spin-weight QE)

Note

Results may be stored with the cacher but only the filtering and data noise levels, QE keys and joint_TP are differentiated in the filename

plancklens.patchy.patchy.get_patchy_N0s(qekey_in, npatches, pixivmap_t, pixivmap_p, cls_unl, cls_cmb_dat, cls_cmb_filt, cls_weight, lmin_ivf, lmax_ivf, lmax_qlm, transf, rvmap_uKamin_t_data=None, rvmap_uKamin_p_data=None, joint_TP=False, nlevt_fid=None, nlevp_fid=None, cacher=<plancklens.helpers.cachers.cacher_mem object>, source='p', patch_method='percentiles', verbose=False)[source]

Collects the effective reconstruction noise levels for different filtering and spectrum weighting schemes

Parameters:
  • qekey_in – QE anisotroy key

  • npatches – the variance map will be split into this number of regions of equal sky areas

  • pixivmap_t – inverse temperature noise pixel variance map used for the T. filtering

  • pixivmap_p – inverse polarization noise pixel variance map used for the Pol. filtering

  • cls_unl – unlensed CMB dict

  • cls_cmb_dat – CMB spectra dict entering the data maps

  • cls_cmb_filt – CMB spectra dict entering the filtering steps

  • cls_weight – CMB spectra dict entering the QE weights (numerators)

  • lmin_ivf – minimal CMB mutlipole

  • lmax_ivf – maximal CMB multipole

  • lmax_qlm – maximal QE multipole

  • transf – CMB transfer function cl

  • rvmap_uKamin_t_data (optional) – set this to the data temperature noise map (in uK amin), if different from the one defining the filtering

  • rvmap_uKamin_p_data (optional) – set this to the data polarisation noise map (in uK amin), if different from the one defining the filtering

  • joint_TP – set this to true if temperature and polarization are jointly filtered before building the QE

  • nlevt_fid – set this to the fiducial temperature noise value to use for the single full-sky normalization

  • nlevp_fid – set this to the fiducial polarisation noise value to use for the single full-sky normalization

  • cacher – can use this to store results (descriptors only use the noise levels, joint_TP and qe_keys though)

  • source – anistropy source for the responses calculations

Returns:

a dict of N0 arrays for different filtering and spectr weighting types MCcorr: prediction of the Monte-Carlo correction of the spectrum for inhom. filtering cMCcorr: Same for the cross-spectrum to the true lensing

Return type:

N0s

plancklens.patchy.patchy.get_responses(qe_key, cls_cmb_dat, cls_cmb_filt, cls_weight, lmin, lmax, lmax_qlm, transf, nlevts_filt, nlevps_filt, joint_TP=False, cacher=<plancklens.helpers.cachers.cacher_mem object>, source='p')[source]

Collects estimator responses for a list of filtering noise levels

Parameters:
  • qe_key – QE estimator key

  • cls_cmb_dat – CMB cls of the data maps

  • cls_cmb_filt – CMB cls used for the filtering

  • cls_weight – CMB cls in the QE weights

  • lmin – minimum CMB multipole considered

  • lmax – maximum CMB multipole considered

  • lmax_qlm – QE output lmax

  • transf – CMB transfer function

  • nlevts_filt – list or array of filtering temperature noise levels

  • nlevps_filt – list or array of filtering polarization noise levels

  • joint_TP – uses joint temperature and polarization filtering if set, separate if not

  • cacher – can be used to store results

  • source – QE response anisotropy source (defaults to lensing)

Returns:

lists of responses (GG, CC, GC CG for spin-weight QE)

Note

Results may be stored with the cacher but only the filtering noise levels, QE keys and joint_TP are differentiated in the filename

plancklens.patchy.patchy.mk_patches(Np, pix_ivmap, rvmap_uKamin_data=None, ret_masks=False, method='percentiles', verbose=False)[source]

Splits the variance maps into equal-area regions with different noise levels

Parameters:
  • Np – desired number of patches

  • pix_ivmap – input inverse pixel variance map used for the filtering

  • rvmap_uKamin_data – root variance map in uK amin of the data (if different from pix_ivmap)

  • ret_masks – returns the defined series of masks if set

  • method – which method should be used to perform the calculation percentiles: equal sky areas regions linear: equally spaced nlevs in uK (this is best in terms of convergence towards an integral)