diff --git a/src/FMM/params.yml b/src/FMM/params.yml index 6a00fa2..e69de29 100644 --- a/src/FMM/params.yml +++ b/src/FMM/params.yml @@ -1,77 +0,0 @@ -path_out: 'test_FastSim/' -datafilename: 'MC' - -CMB: - cmb: True - seed: 1 # CMB realization - r: 0 - Alens: 1 - -Foregrounds: - - Dust: True # Thermal Dust emission - Synchrotron: False # Synchrotron emission - -QUBIC: - - ### This section control the parameters related to QUBIC - - instrument: 'DB' # Instrumental design (DB or UWB) - npointings: 1000 # Number of time samples - nsub_in: 8 # Number of sub-acquisitions - nsub_out: 4 - nrec: 2 # Number of reconstructed frequency maps - convolution_in: True # Angular resolution in the input TOD - convolution_out: False # Angular resolution in the reconstruction - bandpass_correction: True # Correction to keep the edges of the integration band constant - NOISE: - ndet: 1 # Level of detector noise - npho150: 1 # Level of photon noise at 150 GHz - npho220: 1 # Level of photon noise at 220 GHz - detector_nep: 4.7e-17 # NEP of detector noise - SYNTHBEAM: - synthbeam_kmax: 1 # Order of synthesized beam diffraction (synthbeam_kmax = 1 means 9 peaks) - dtheta: 15 # Angle for coverage - -SKY: - - ### This section control the reconstructed sky - - nside: 32 # Nside of components - coverage_cut: 0.2 # Define a cut where the coverage is too low - RA_center: 0 - DEC_center: -57 - -PLANCK: - - ### This section define which external data are we using - - external_data: False - weight_planck: 0 # Weight of Planck data within the QUBIC patch - level_noise_planck: 1 # Noise level for Planck data - bandwidth_planck: 0.2 # Multiplicative factor to define the bandwidth of Planck's data - nsub_planck: 10 # Number of sub acquisitions for Planck's data - -Pipeline: - mapmaking: True # Run MapMaking Pipeline - spectrum: False # Compute Power Spectra of the frequency maps - -PCG: - - ### This section control PCG parameters - - n_iter_pcg: 100 # Number of PCG iterations - tol_pcg: 1.0e-12 # Tolerance for PCG - preconditioner: True - gif: True - resolution_plot: 12 - fwhm_plot: 0.005 - -Spectrum: - - ### This section define the parameters to compute the power spectra - - dl: 10 - lmin: 20 - lmax: 120 - aposize: 10 \ No newline at end of file diff --git a/src/FMM/pipeline.py b/src/FMM/pipeline.py index 728f0f5..d1d5907 100644 --- a/src/FMM/pipeline.py +++ b/src/FMM/pipeline.py @@ -4,6 +4,7 @@ import time import numpy as np +from scipy.optimize import minimize import qubic import yaml from pysimulators.interfaces.healpy import HealpixConvolutionGaussianOperator @@ -440,10 +441,10 @@ def get_convolution(self): fwhm_in = np.zeros(self.params["QUBIC"]["nsub_in"]) fwhm_out = np.zeros(self.params["QUBIC"]["nsub_out"]) fwhm_rec = np.zeros(self.params["QUBIC"]["nrec"]) - + ### FWHMs during map-making if self.params["QUBIC"]["convolution_in"]: - fwhm_in = self.joint.qubic.allfwhm.copy() + fwhm_in = self.joint_tod.qubic.allfwhm.copy() if self.params["QUBIC"]["convolution_out"]: fwhm_out = np.array([]) for irec in range(self.params["QUBIC"]["nrec"]): @@ -451,12 +452,12 @@ def get_convolution(self): fwhm_out, np.sqrt( self.joint.qubic.allfwhm[ - irec * self.fsub : (irec + 1) * self.fsub + irec * self.fsub_out : (irec + 1) * self.fsub_out ] ** 2 - np.min( self.joint.qubic.allfwhm[ - irec * self.fsub : (irec + 1) * self.fsub + irec * self.fsub_out : (irec + 1) * self.fsub_out ] ) ** 2 @@ -474,7 +475,7 @@ def get_convolution(self): fwhm_rec, np.min( self.joint.qubic.allfwhm[ - irec * self.fsub : (irec + 1) * self.fsub + irec * self.fsub_out : (irec + 1) * self.fsub_out ] ), ) @@ -520,18 +521,14 @@ def get_convolution(self): # Compute the expected resolution fwhm_rec = np.append( - fwhm_rec, - np.mean( - self.joint.qubic.allfwhm[ - irec * self.fsub : (irec + 1) * self.fsub - ] - ), + fwhm_rec, np.sum(numerator_fwhm) / np.sum(denominator_fwhm) ) - else: - fwhm_rec = np.array([]) - for irec in range(self.params["QUBIC"]["nrec"]): - fwhm_rec = np.append(fwhm_rec, 0) + # Compute the expected frequency + fraction = np.sum(numerator_nus) / np.sum(denominator_nus) + x0 = self.nus_Q[irec] + corrected_nu = minimize(fun, x0) + self.nus_Q[irec] = corrected_nu["x"] if self.rank == 0: print(f"FWHM for TOD generation : {fwhm_in}")