本文整理匯總了Python中qubic.QubicAcquisition.get_operator_nbytes方法的典型用法代碼示例。如果您正苦於以下問題:Python QubicAcquisition.get_operator_nbytes方法的具體用法?Python QubicAcquisition.get_operator_nbytes怎麽用?Python QubicAcquisition.get_operator_nbytes使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類qubic.QubicAcquisition
的用法示例。
在下文中一共展示了QubicAcquisition.get_operator_nbytes方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: test
# 需要導入模塊: from qubic import QubicAcquisition [as 別名]
# 或者: from qubic.QubicAcquisition import get_operator_nbytes [as 別名]
def test():
instrument = QubicInstrument()[:10]
sampling = create_random_pointings([0, 90], 30, 5)
nside = 64
scenes = QubicScene(nside, kind='I'), QubicScene(nside)
def func(scene, max_nbytes, ref1, ref2, ref3, ref4, ref5, ref6):
acq = QubicAcquisition(instrument, sampling, scene,
max_nbytes=max_nbytes)
sky = np.ones(scene.shape)
H = acq.get_operator()
actual1 = H(sky)
assert_same(actual1, ref1, atol=10)
actual2 = H.T(actual1)
assert_same(actual2, ref2, atol=10)
actual2 = (H.T * H)(sky)
assert_same(actual2, ref2, atol=10)
actual3, actual4 = tod2map_all(acq, ref1, disp=False)
assert_same(actual3, ref3, atol=10000)
assert_same(actual4, ref4)
actual5, actual6 = tod2map_each(acq, ref1, disp=False)
assert_same(actual5, ref5, atol=1000)
assert_same(actual6, ref6)
for scene in scenes:
acq = QubicAcquisition(instrument, sampling, scene)
sky = np.ones(scene.shape)
nbytes_per_sampling = acq.get_operator_nbytes() // len(acq.sampling)
H = acq.get_operator()
ref1 = H(sky)
ref2 = H.T(ref1)
ref3, ref4 = tod2map_all(acq, ref1, disp=False)
ref5, ref6 = tod2map_each(acq, ref1, disp=False)
for max_sampling in 10, 29, 30:
max_nbytes = None if max_sampling is None \
else max_sampling * nbytes_per_sampling
yield (func, scene, max_nbytes, ref1, ref2, ref3, ref4, ref5, ref6)