def test_satellite_and_annual_parallax_calculation():
"""test parallax calculation with Spitzer data"""
model_with_par = Model({'t_0':2457181.93930, 'u_0':0.08858, 't_E':20.23090,
'pi_E_N':-0.05413, 'pi_E_E':-0.16434},
coords="18:17:54.74 -22:59:33.4")
model_with_par.parallax(satellite=True, earth_orbital=True,
topocentric=False)
model_with_par.parameters.t_0_par = 2457181.9
data_OGLE = MulensData(file_name=SAMPLE_FILE_02, add_2450000=True)
data_Spitzer = MulensData(
file_name=SAMPLE_FILE_03, ephemerides_file=SAMPLE_FILE_03_EPH,
add_2450000=True)
model_with_par.set_datasets([data_OGLE, data_Spitzer])
ref_OGLE = np.loadtxt(SAMPLE_FILE_02_REF, unpack=True, usecols=[5])
ref_Spitzer = np.loadtxt(SAMPLE_FILE_03_REF, unpack=True, usecols=[5])
np.testing.assert_almost_equal(model_with_par.data_magnification[0],
ref_OGLE, decimal=2)
ratio = model_with_par.data_magnification[1] / ref_Spitzer
np.testing.assert_almost_equal(ratio, [1.]*len(ratio), decimal=3)
评论列表
文章目录