lib.Fitting.QreadMC module

lib.Fitting.QreadMC.get_maps(file)[source]

Returns the full maps of a simulation. :type file: :param file: A fits file saved from a simulation. :type file: str

Returns:

  • Reconstructed maps, convolved maps and the difference between both,

  • all with a shape (#subbands, #pixels, 3).

lib.Fitting.QreadMC.get_maps_many_files(rep_simu, name, verbose=True)[source]

Get all the maps you want to analyze from many fits files. :type rep_simu: :param rep_simu: Repository where the fits files are. :type rep_simu: str :type name: :param name: Name of the files you are interested in. :type name: str :type verbose: :param verbose: :type verbose: bool

Returns:

  • A list with the names of all the files you took.

  • Three arrays containing the reconstructed maps, the convolved maps

  • and the difference between both.

lib.Fitting.QreadMC.get_patch(file, seenmap)[source]

Returns the observed patch in the maps to save memory. :type file: :param file: A fits file saved from a simulation. :type file: str :type seenmap: :param seenmap: Array of booleans of shape #pixels,

True inside the patch and False outside.

Returns:

  • Reconstructed patches, convolved patches and difference between both,

  • all with a shape (#subbands, #pixels_seen, 3).

lib.Fitting.QreadMC.get_patch_many_files(rep_simu, name, badval=-1.6375e+30, rtol=1e-05, atol=1e-08, verbose=True)[source]

Get all the patches you want to analyze from many fits files. :type rep_simu: :param rep_simu: Repository where the fits files are. :type rep_simu: str :type name: :param name: Name of the files you are interested in. :type name: str :type badval: :param badval: The value of the pixel considered as UNSEEN :type badval: float :type rtol: :param rtol: Relative tolerance for badval :type rtol: float :type atol: :param atol: Absolute tolerance for badval :type atol: float :type verbose: :param verbose: :type verbose: bool

Returns:

  • A list with the names of all the files you took.

  • Three arrays containing the reconstructed patches, the convolved patches

  • and the difference between both.

lib.Fitting.QreadMC.get_seenmap(file, badval=-1.6375e+30, rtol=1e-05, atol=1e-08)[source]

Returns an array with the pixels seen or not. :type file: :param file: A fits file saved from a simulation. :type file: str :type badval: :param badval: The value of the pixel considered as UNSEEN :type badval: float :type rtol: :param rtol: Relative tolerance for badval :type rtol: float :type atol: :param atol: Absolute tolerance for badval :type atol: float

Returns:

seenmap – Array of booleans of shape #pixels, True inside the patch and False outside.

Return type:

array

lib.Fitting.QreadMC.make_zones(patch, nzones, nside, center, seenmap, angle=False, dtheta=15.0, verbose=True, doplot=True)[source]

Mask a path to get different concentric zones.

Parameters:
  • patch (array) – Patch you want to cut of shape (#subbands, #pix_seen, 3)

  • nzones (int) – Number of zones you want to make.

  • nside (int)

  • center (array) – Coordinates of the center of the patch in degree (lon, lat)

  • seenmap (array) – Array of booleans of shape #pixels, True inside the patch and False outside.

  • angle (bool) – If True, you make only 2 zones, inside and outside dtheta.

  • dtheta (float) – Size of the patch were the pointing was done (degree), by default it is 15°.

  • verbose (bool)

  • doplot (bool) – If True, makes a plot with the different zones obtained.

Returns:

  • A list with the number of pixels in each zone.

  • A list with the patch masked to get each zone.

lib.Fitting.QreadMC.pix2ang(ns, center, seenmap=None)[source]

For each pixel observed, returns the angle between the pixel vector and the central pixel vector.

lib.Fitting.QreadMC.save_simu_fits(maps_recon, cov, nus, nus_edge, maps_convolved, save_dir, simu_name)[source]

Save a complete simulation in a .fits file for one number of reconstructed subbands. :type maps_recon: :param maps_recon: Reconstructed maps in each subband. :type maps_recon: array :type cov: :param cov: Coverage of the sky. :type cov: array :type nus: :param nus: Central frequencies of each subband reconstructed. :type nus: array :type nus_edge: :param nus_edge: Edge frequencies of each subband reconstructed. :type nus_edge: array :type maps_convolved: :param maps_convolved: Maps convolved at the resolution of each subband. :type maps_convolved: array :type save_dir: :param save_dir: Directory where the .fits is saved. :type save_dir: str :type simu_name: :param simu_name: Name of the simulation. :type simu_name: str