コード例 #1
0
def create_acquisition_operator_REC(pointing,
                                    d,
                                    nf_sub_rec,
                                    verbose=False,
                                    instrument=None):
    # scene
    s = qubic.QubicScene(d)
    if d['nf_sub'] == 1:
        if verbose:
            print('Making a QubicInstrument.')
        q = qubic.QubicInstrument(d)
        # one subfreq for recons
        _, nus_edge, _, _, _, _ = qubic.compute_freq(
            d['filter_nu'] / 1e9, nf_sub_rec, d['filter_relative_bandwidth'])
        arec = qubic.QubicAcquisition(q, pointing, s, d)

        return arec
    else:
        if instrument is None:
            if verbose:
                print('Making a QubicMultibandInstrument.')
            q = qubic.QubicMultibandInstrument(d)
        else:
            q = instrument
        # number of sub frequencies for reconstruction
        _, nus_edge, _, _, _, _ = qubic.compute_freq(
            d['filter_nu'] / 1e9, nf_sub_rec, d['filter_relative_bandwidth'])
        # Operator for Maps Reconstruction
        arec = qubic.QubicMultibandAcquisition(q, pointing, s, d, nus_edge)
        return arec
コード例 #2
0
ファイル: SpectroImLib.py プロジェクト: satorchi/qubic
def create_acquisition_operator_REC(pointing, d, nf_sub_rec):
    # Polychromatic instrument model
    q = qubic.QubicMultibandInstrument(d)
    # scene
    s = qubic.QubicScene(d)
    # number of sub frequencies for reconstruction
    _, nus_edge, _, _, _, _ = qubic.compute_freq(
        d['filter_nu'] / 1e9, nf_sub_rec, d['filter_relative_bandwidth'])
    # Operator for Maps Reconstruction
    arec = qubic.QubicMultibandAcquisition(q, pointing, s, d, nus_edge)
    return arec
コード例 #3
0
ファイル: SpectroImLib.py プロジェクト: mgiard/qubic
def create_acquisition_operator_TOD(pointing, d):
    # Polychromatic instrument model
    q = qubic.QubicMultibandInstrument(d)
    # scene
    s = qubic.QubicScene(d)
    # number of sub frequencies to build the TOD
    _, nus_edge_in, _, _, _, _ = qubic.compute_freq(
        d['filter_nu'] / 1e9, d['filter_relative_bandwidth'],
        d['nf_sub'])  # Multiband instrument model
    # Multi-band acquisition model for TOD fabrication
    atod = qubic.QubicMultibandAcquisition(q, pointing, s, d, nus_edge_in)
    return atod
コード例 #4
0
def get_tod(d, p, x0):
    # Polychromatic instrument model
    q = qubic.QubicMultibandInstrument(d)

    # Scene
    s = qubic.QubicScene(d)

    # Number of sub frequencies to build the TOD
    _, nus_edge_in, _, _, _, _ = qubic.compute_freq(
        d['filter_nu'] / 1e9, d['filter_relative_bandwidth'], d['nf_sub'])

    # Multi-band acquisition operator
    a = qubic.QubicMultibandAcquisition(q, p, s, d, nus_edge_in)

    tod, _ = a.get_observation(x0, noiseless=True)

    return q, tod
コード例 #5
0
ファイル: ForegroundsSED.py プロジェクト: mwrightqub/qubic
def make_covTD(d):
	"""
	Usually coverage map is provided in a separate file. But if not the case, this method can compute a coverage map
	Parameters:
	d: Qubic dictionary
	Return:
	cov: coverage map in a.QubicMultibandAcquisition shape (nfreq, npix).
	"""

	pointing = qubic.get_pointing(d)
	q= qubic.QubicMultibandInstrument(d)
	s= qubic.QubicScene(d)
	nf_sub_rec = d['nf_recon']
	_, nus_edge, nus, _, _, _ = qubic.compute_freq(d['filter_nu'] / 1e9, 
												   nf_sub_rec, d['filter_relative_bandwidth'])
	arec = qubic.QubicMultibandAcquisition(q, pointing, s, d, nus_edge)
	cov = arec.get_coverage()
	return cov
コード例 #6
0
def create_acquisition_operator_TOD(pointing, d, verbose=False):
    # scene
    s = qubic.QubicScene(d)
    if d['nf_sub'] == 1:
        if verbose:
            print('Making a QubicInstrument.')
        q = qubic.QubicInstrument(d)
        return qubic.QubicAcquisition(q, pointing, s, d)
    else:
        # Polychromatic instrument model
        if verbose:
            print('Making a QubicMultibandInstrument.')
        q = qubic.QubicMultibandInstrument(d)
        # number of sub frequencies to build the TOD
        _, nus_edge_in, _, _, _, _ = qubic.compute_freq(
            d['filter_nu'] / 1e9,
            d['nf_sub'],  # Multiband instrument model
            d['filter_relative_bandwidth'])
        # Multi-band acquisition model for TOD fabrication
        return qubic.QubicMultibandAcquisition(q, pointing, s, d, nus_edge_in)
コード例 #7
0
def get_tod(d, p, x0, closed_horns=None):
    """

    Parameters
    ----------
    d : dictionnary
    p : pointing
    x0 : sky
    closed_horns : array
        index of closed horns

    Returns
    -------
    Returns an instrument with closed horns and TOD
    """
    # Polychromatic instrument model
    q = qubic.QubicMultibandInstrument(d)
    # q = qubic.QubicInstrument(d)
    if closed_horns is not None:
        for i in range(d['nf_sub']):
            for h in closed_horns:
                q[i].horn.open[h] = False

    # Scene
    s = qubic.QubicScene(d)

    # Number of sub frequencies to build the TOD
    _, nus_edge_in, _, _, _, _ = qubic.compute_freq(
        d['filter_nu'] / 1e9, d['nf_sub'], d['filter_relative_bandwidth'])

    # Multi-band acquisition operator
    a = qubic.QubicMultibandAcquisition(q, p, s, d, nus_edge_in)
    # a = qubic.QubicPolyAcquisition(q, p, s, d)

    tod = a.get_observation(x0, convolution=False, noiseless=True)

    return q, tod
コード例 #8
0
arcToRad = np.pi / (180 * 60.)
source = hp.sphtfunc.smoothing(source, fwhm=30 * arcToRad)
x0[:, :, component] = source
hp.mollview(x0[0, :, component])
plt.show()

if p.fix_az:
    center = (fix_azimuth['az'], fix_azimuth['el'])
else:
    center = qubic.equ2gal(d['RA_center'], d['DEC_center'])

# Make TOD
Nbfreq_in, nus_edge_in, nus_in, deltas_in, Delta_in, Nbbands_in = qubic.compute_freq(d['filter_nu'] / 1e9,
                                                                                     d['nf_sub'],
                                                                                     d['filter_relative_bandwidth'])
a = qubic.QubicMultibandAcquisition(q, p, s, d, nus_edge_in)

TOD = a.get_observation(x0, noiseless=True, convolution=False)

plt.plot(TOD[0, :])
plt.xlabel('pointing index')
plt.ylabel('TOD')
plt.show()

# Map making
if alaImager:
    nf_sub_rec = 1
    d['synthbeam_kmax'] = 0
    if oneComponent:
        d['kind'] = 'I'
    q = qubic.QubicInstrument(d)