lib.QskySim module

class lib.QskySim.Qubic_sky(skyconfig, d, output_directory='./', output_prefix='qubic_sky')[source]

Bases: sky

Define a sky object as seen by Qubic

Methods

create_noise_maps(sigma_sec, coverage[, ...])

This returns a realization of noise maps for I, Q and U with no correlation between them, according to a noise RMS map built according to the coverage specified as an attribute to the class The optional effective_variance_invcov keyword is a modification law to be applied to the coverage in order to obtain more realistic noise profile.

get_fullsky_convolved_maps([FWHMdeg, verbose])

This returns full sky maps at each subfrequency convolved by the beam of the instrument at each frequency or with another beam if FWHMdeg is provided.

get_partial_sky_maps_withnoise([coverage, ...])

This returns maps in the same way as with get_simple_sky_map but cut according to the coverage and with noise added according to this coverage and the RMS in muK.sqrt(sec) given by sigma_sec The default integration time is 4 years but can be modified with optional variable Nyears Note that the maps are convolved with the instrument beam by default, or with FWHMdeg (can be an array) if provided.

get_simple_sky_map()

Create as many skies as the number of input frequencies.

smoothing(maps, FWHMdeg, Nf, central_nus[, ...])

Convolve the maps to the FWHM at each sub-frequency or to a common beam if FWHMdeg is given.

theoretical_noise_maps(sigma_sec, coverage)

This returns a map of the RMS noise (not an actual realization, just the expected RMS - No covariance)

create_noise_maps(sigma_sec, coverage, covcut=0.1, nsub=1, Nyears=4, verbose=False, seed=None, effective_variance_invcov=None, clnoise=None, sub_bands_cov=None)[source]

This returns a realization of noise maps for I, Q and U with no correlation between them, according to a noise RMS map built according to the coverage specified as an attribute to the class The optional effective_variance_invcov keyword is a modification law to be applied to the coverage in order to obtain more realistic noise profile. It is a law for effective RMS as a function of inverse coverage and is 2D array with the first one being (nx samples) inverse coverage and the second being the corresponding effective variance to be used through interpolation when generating the noise. The clnoise option is used to apply a convolution to the noise to obtain spatially correlated noise. This cl should be calculated from the c(theta) of the noise that can be measured using the function ctheta_parts() below. The transformation of this C9theta) into Cl has to be done using wrappers on camb function found in camb_interface.py of the QUBIC software: the functions to back and forth from ctheta to cl are: cl_2_ctheta and ctheta_2_cell. The simulation of the noise itself calls a function of camb_interface called simulate_correlated_map(). :type sigma_sec: :param sigma_sec: :type coverage: :param coverage: :type Nyears: :param Nyears: :type verbose: :param verbose: :type seed: :param seed: :type effective_variance_invcov: :param effective_variance_invcov:

get_fullsky_convolved_maps(FWHMdeg=None, verbose=None)[source]

This returns full sky maps at each subfrequency convolved by the beam of the instrument at each frequency or with another beam if FWHMdeg is provided. when FWHMdeg is 0, the maps are not convolved.

Parameters:
  • FWHMdeg (float)

  • verbose (bool)

get_partial_sky_maps_withnoise(coverage=None, version_FastSim='01', sigma_sec=None, Nyears=4.0, FWHMdeg=None, seed=None, noise_profile=True, spatial_noise=True, nunu_correlation=True, noise_only=False, integrate_into_band=True, verbose=False, noise_covcut=0.1)[source]

This returns maps in the same way as with get_simple_sky_map but cut according to the coverage and with noise added according to this coverage and the RMS in muK.sqrt(sec) given by sigma_sec The default integration time is 4 years but can be modified with optional variable Nyears Note that the maps are convolved with the instrument beam by default, or with FWHMdeg (can be an array) if provided. If seed is provided, it will be used for the noise realization. If not it will be a new realization at each call. The optional effective_variance_invcov keyword is a modification law to be applied to the coverage in order to obtain more realistic noise profile. It is a law for effective RMS as a function of inverse coverage and is 2D array with the first one being (nx samples) inverse coverage and the second being the corresponding effective variance to be used through interpolation when generating the noise.

Parameters:
  • coverage (array) – Coverage map of the sky. By default, we load a coverage centered on the galactic center with 10000 pointings.

  • version_FastSim (str) – Version of the FastSimulator files: 01, 02, 03… For now, only 01 exists.

  • sigma_sec (float)

  • Nyears (float) – Integration time for observation to scale the noise, by default it is 4.

  • FWHMdeg

  • seed

  • noise_profile

  • spatial_noise (bool) – If True, spatial noise correlations are added. True by default.

  • nunu_correlation (bool) – If True, correlations between frequency sub-bands are added. True by default.

  • noise_only (bool) – If True, only returns the noise maps and the coverage (without the sky signal).

  • integrate_into_band (bool) – If True, averaging input sub-band maps into reconstruction sub-bands. True by default.

  • verbose (bool)

Return type:

maps + noisemaps, maps, noisemaps, coverage

smoothing(maps, FWHMdeg, Nf, central_nus, verbose=True)[source]

Convolve the maps to the FWHM at each sub-frequency or to a common beam if FWHMdeg is given.

theoretical_noise_maps(sigma_sec, coverage, Nyears=4, verbose=False)[source]

This returns a map of the RMS noise (not an actual realization, just the expected RMS - No covariance)

Parameters:
  • sigma_sec (float) – Noise level.

  • coverage (array) – The coverage map.

  • Nyears (int)

  • verbose (bool)

class lib.QskySim.sky(skyconfig, d, instrument, out_dir, out_prefix, lmax=None)[source]

Bases: object

Define a sky object as seen by an instrument.

Methods

get_simple_sky_map()

Create as many skies as the number of input frequencies.

get_simple_sky_map()[source]

Create as many skies as the number of input frequencies. Instrumental effects are not considered. Return a vector of shape (number_of_input_subfrequencies, npix, 3)