def _init_beams(self, primary, secondary): if primary is None: primary = BeamGaussian( np.radians(self.calibration.get('primbeam'))) self.primary_beam = primary if secondary is None: secondary = BeamGaussian( np.radians(self.calibration.get('primbeam')), backward=True) self.secondary_beam = secondary
def __init__(self, fwhm, backward=False, nripples=0): """ Parameters ---------- fwhm : float The Full-Width-Half-Maximum of the beam, in radians. backward : boolean, optional If true, the maximum of the beam is at theta=pi. """ BeamGaussian.__init__(self, fwhm, backward=backward) self.nripples = nripples
def _init_synthbeam(self, dtype, synthbeam_peak150_fwhm): sb = SyntheticBeam() sb.dtype = np.dtype(dtype) if not self.ripples: sb.peak150 = BeamGaussian(synthbeam_peak150_fwhm) else: sb.peak150 = BeamGaussianRippled(synthbeam_peak150_fwhm, nripples=self.nripples) self.synthbeam = sb
def _direct_convolution_(scene, position, area, nu, bandwidth, horn, primary_beam, secondary_beam, synthbeam, theta_max=30): rotation = DenseBlockDiagonalOperator(np.eye(3)[None, ...]) aperture = MultiQubicInstrument._get_aperture_integration_operator( horn) scene_nopol = QubicScene(scene.nside, kind='I') projection = MultiQubicInstrument._get_projection_operator( rotation, scene_nopol, nu, position, synthbeam, horn, primary_beam, verbose=False) masked_sky = MultiQubicInstrument._mask(scene, theta_max) peak_pos = projection.matrix.data.index pos = MultiQubicInstrument._check_peak(scene, peak_pos, peak_pos, theta_max, dtype=np.int32) value = MultiQubicInstrument._check_peak(scene, projection.matrix.data.value, peak_pos, theta_max, dtype=np.float64) integ = MultiQubicInstrument._get_detector_integration_operator( position, area, secondary_beam) b = BeamGaussian(synthbeam.peak150.fwhm / nu * 150e9) theta0, phi0, uvec0 = MultiQubicInstrument._index2coord( scene.nside, pos) theta, phi, uvec = MultiQubicInstrument._index2coord( scene.nside, masked_sky) dot = np.dot(uvec0, uvec.T) dot[dot > 1] = 1 dtheta = np.arccos(dot) # (#npeaks, #pixels_inside_mask) maps = b(dtheta, 0) maps /= np.sum(maps, axis=-1)[..., None] Map = np.sum((maps * value[..., None]), axis=1) Map = integ(aperture(Map)) Map *= bandwidth * deriv_and_const(nu, scene.nside) return MultiQubicInstrument._masked_beam(scene, Map, theta_max)