Skip to content

Commit

Permalink
Merge pull request #24 from mathias77515/Tom-dev2
Browse files Browse the repository at this point in the history
Typo correction
  • Loading branch information
TomLaclavere authored Sep 13, 2024
2 parents bbbe911 + 8d960a1 commit de360d5
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 92 deletions.
77 changes: 0 additions & 77 deletions src/FMM/params.yml
Original file line number Diff line number Diff line change
@@ -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
27 changes: 12 additions & 15 deletions src/FMM/pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -440,23 +441,23 @@ 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"]):
fwhm_out = np.append(
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
Expand All @@ -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
]
),
)
Expand Down Expand Up @@ -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}")
Expand Down

0 comments on commit de360d5

Please sign in to comment.