當前位置: 首頁>>代碼示例>>Python>>正文


Python QubicAcquisition.get_observation方法代碼示例

本文整理匯總了Python中qubic.QubicAcquisition.get_observation方法的典型用法代碼示例。如果您正苦於以下問題:Python QubicAcquisition.get_observation方法的具體用法?Python QubicAcquisition.get_observation怎麽用?Python QubicAcquisition.get_observation使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在qubic.QubicAcquisition的用法示例。


在下文中一共展示了QubicAcquisition.get_observation方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: write_reference

# 需要導入模塊: from qubic import QubicAcquisition [as 別名]
# 或者: from qubic.QubicAcquisition import get_observation [as 別名]
def write_reference():
    np.random.seed(0)
    p = create_random_pointings([0, 90], NPTG, ANGLE)
    FitsArray([p.azimuth, p.elevation, p.pitch, p.angle_hwp]).save(FILEPTG)
    for kind, map, filename in zip(['I', 'IQU'], [MAPIQU[..., 0], MAPIQU],
                                   [FILETODI, FILETODIQU]):
        acq = QubicAcquisition(INSTRUMENT, p, nside=256, kind=kind)
        tod = acq.get_observation(map, noiseless=True)
        FitsArray(tod).save(filename)
開發者ID:MStolpovskiy,項目名稱:qubic,代碼行數:11,代碼來源:test_simulations.py

示例2: PlanckAcquisition

# 需要導入模塊: from qubic import QubicAcquisition [as 別名]
# 或者: from qubic.QubicAcquisition import get_observation [as 別名]
acq_planck = PlanckAcquisition(150, acq_qubic.scene, true_sky=convolved_sky)
acq_fusion = QubicPlanckAcquisition(acq_qubic, acq_planck)

H = acq_fusion.get_operator()
invntt = acq_fusion.get_invntt_operator()
y = acq_fusion.get_observation()

A = H.T * invntt * H
b = H.T * invntt * y

solution_fusion = pcg(A, b, disp=True, maxiter=maxiter, tol=tol)

acq_qubic = QubicAcquisition(150, sampling, scene, effective_duration=1)
H = acq_qubic.get_operator()
invntt = acq_qubic.get_invntt_operator()
y, sky_convolved = acq_qubic.get_observation(sky, convolution=True)

A = H.T * invntt * H
b = H.T * invntt * y

solution_qubic = pcg(A, b, disp=True, maxiter=maxiter, tol=tol)


# some display
def display(input, msg, iplot=1):
    out = []
    for i, (kind, lim) in enumerate(zip('IQU', [50, 5, 5])):
        map = input[..., i]
        out += [hp.gnomview(map, rot=center, reso=5, xsize=800, min=-lim,
                            max=lim, title=msg + ' ' + kind,
                            sub=(3, 3, iplot + i), return_projected_map=True)]
開發者ID:jchamilton75,項目名稱:qubic,代碼行數:33,代碼來源:script_qubicplanck.py

示例3: gal2equ

# 需要導入模塊: from qubic import QubicAcquisition [as 別名]
# 或者: from qubic.QubicAcquisition import get_observation [as 別名]
# read the input map
x0 = qubic.io.read_map(qubic.data.PATH + 'syn256_pol.fits', field='I_STOKES')
nside = 256

# let's take the galactic north pole as the center of the observation field
center_gal = 0, 90
center = gal2equ(center_gal[0], center_gal[1])

# sampling model
np.random.seed(0)
sampling = create_random_pointings(center, 1000, 10)
scene = QubicScene(nside, kind='I')

# acquisition model
acq = QubicAcquisition(150, sampling, scene)
y, x0_convolved = acq.get_observation(x0, convolution=True, noiseless=True)

# map-making
x, coverage = tod2map_all(acq, y, disp=True, tol=1e-4, coverage_threshold=0)
mask = coverage > 0


# some display
def display(x, title):
    x = x.copy()
    x[~mask] = np.nan
    hp.gnomview(x, rot=center_gal, reso=5, xsize=600, min=-200, max=200,
                title=title)

display(x0, 'Original map')
display(x0_convolved, 'Convolved original map')
開發者ID:MStolpovskiy,項目名稱:qubic,代碼行數:33,代碼來源:script_ga_random_nopol.py

示例4: func

# 需要導入模塊: from qubic import QubicAcquisition [as 別名]
# 或者: from qubic.QubicAcquisition import get_observation [as 別名]
 def func(kind, map, filename):
     acq = QubicAcquisition(INSTRUMENT, p, nside=256, kind=kind)
     tod = acq.get_observation(map, noiseless=True)
     ref = FitsArray(filename)
     np.testing.assert_almost_equal(tod, ref)
開發者ID:MStolpovskiy,項目名稱:qubic,代碼行數:7,代碼來源:test_simulations.py

示例5: import

# 需要導入模塊: from qubic import QubicAcquisition [as 別名]
# 或者: from qubic.QubicAcquisition import get_observation [as 別名]
from qubic import (
    create_random_pointings, gal2equ, QubicAcquisition, QubicScene,
    tod2map_all)
import numpy as np
import qubic

# read the input map
input_map = qubic.io.read_map(qubic.data.PATH + 'syn256_pol.fits',
                              field='I_STOKES')
nside = 256

# let's take the galactic north pole as the center of the observation field
center_gal = 0, 90
center = gal2equ(center_gal[0], center_gal[1])

# sampling model
np.random.seed(0)
sampling = create_random_pointings(center, 1000, 10)
scene = QubicScene(nside, kind='I')

# acquisition model
acq = QubicAcquisition(150, sampling, scene)
hit = acq.get_hitmap()

# Produce the Time-Ordered data
tod = acq.get_observation(input_map)
output_map, coverage = tod2map_all(acq, tod)

print acq.comm.rank, output_map[coverage > 0][:5]
print acq.comm.rank, hit[hit > 0][:10]
開發者ID:MStolpovskiy,項目名稱:qubic,代碼行數:32,代碼來源:script_mpi.py


注:本文中的qubic.QubicAcquisition.get_observation方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。