def test_primary_beam(): def primary_beam(theta, phi): import numpy as np with settingerr(invalid='ignore'): return theta <= np.radians(9) a = QubicAcquisition(150, s, primary_beam=primary_beam) p = a.get_projection_operator() assert_equal(p.matrix.ncolmax, 5)
delta_az = 15. angspeed_psi = 0.1 maxpsi = 45. nsweeps_el = 300 duration = 24 # hours ts = 20 # seconds sampling = create_sweeping_pointings( [racenter, deccenter], duration, ts, angspeed, delta_az, nsweeps_el, angspeed_psi, maxpsi) # acquisition model acq = QubicAcquisition(150, sampling, kind='I', synthbeam_fraction=0.99, detector_sigma=sigma, detector_fknee=fknee, detector_fslope=fslope, detector_ncorr=ncorr) C = acq.get_convolution_peak_operator() P = acq.get_projection_operator() H = P * C # produce the Time-Ordered data y = H(x0) # noise psd = _gaussian_psd_1f(len(acq.sampling), sigma=sigma, fknee=fknee, fslope=fslope, sampling_frequency=1/ts) invntt = acq.get_invntt_operator() noise = acq.get_noise() # map-making coverage = P.pT1() mask = coverage > 10 P = P.restrict(mask, inplace=True)
[racenter, deccenter], duration, ts, angspeed, delta_az, nsweeps_el, angspeed_psi, maxpsi) tods = {} pTxs = {} pT1s = {} pTx_pT1s = {} cbiks = {} outputs = {} kinds = ['I', 'QU', 'IQU'] input_maps = [I, np.array([Q, U]).T, np.array([I, Q, U]).T] for kind, input_map in zip(kinds, input_maps): acq = QubicAcquisition(150, pointings, kind=kind) P = acq.get_projection_operator() W = acq.get_hwp_operator() H = W * P coverage = P.pT1() tod = H(input_map) tods[kind] = tod pTxs[kind] = H.T(tod)[coverage > 0] if kind != 'QU': pTx_pT1 = P.pTx_pT1(tod) pTx_pT1s[kind] = pTx_pT1[0][coverage > 0], pTx_pT1[1][coverage > 0] cbik = P.canonical_basis_in_kernel() mask = coverage > 10 P = P.restrict(mask, inplace=True) unpack = UnpackOperator(mask, broadcast='rightward') x0 = unpack.T(input_map)