def test_measureXYZUVW(): """Check measurements of xyzuvw_now to astrometry occur properly. Will use extremely dense component as case study as this ensures stars all have more or less the same true values""" compact_comp_pars = np.copy(PARS[0]) compact_comp_pars[6] = 1e-15 compact_comp_pars[7] = 1e-15 compact_comp_pars[8] = 1e-15 starcounts = [1000] sd = SynthData(pars=np.array([compact_comp_pars]), starcounts=starcounts, Components=COMPONENTS) sd.generate_all_init_cartesian() sd.project_stars() sd.measure_astrometry() for colname in SynthData.DEFAULT_ASTR_COLNAMES: assert np.allclose(sd.GERROR[colname + '_error'], sd.table[colname + '_error']) # Check spread of data is similar to Gaia error, we use # a large tolerance so a small number of stars can be used assert np.isclose(sd.GERROR[colname + '_error'], np.std(sd.table[colname]), rtol=1e-1)
def test_projectStars(): """Check that the mean of stars after projection matches the mean of the component after projection""" starcounts = (int(1e3),) sd = SynthData(pars=PARS[:1], starcounts=starcounts, Components=COMPONENTS) sd.generate_all_init_cartesian() sd.project_stars() comp_mean_now, comp_covmatrix_now = \ sd.components[0].get_currentday_projection() final_xyzuvw = sd.extract_data_as_array([dim + '_now' for dim in 'xzyuvw']) assert np.allclose(comp_mean_now, final_xyzuvw.mean(axis=0), atol=1.)
def test_measureXYZUVW(): """Check measurements of xyzuvw_now to astrometry occur properly. Will use extremely dense component as case study as this ensures stars all have more or less the same true values""" compact_comp_pars = np.copy(PARS[0]) compact_comp_pars[6] = 1e-15 compact_comp_pars[7] = 1e-15 compact_comp_pars[8] = 1e-15 starcounts = [1000] sd = SynthData(pars=np.array([compact_comp_pars]), starcounts=starcounts, Components=COMPONENTS) sd.generate_all_init_cartesian() sd.project_stars() sd.measure_astrometry() for colname in SynthData.DEFAULT_ASTR_COLNAMES: assert np.allclose(sd.GERROR[colname + '_error'], sd.table[colname + '_error']) # Check spread of data is similar to Gaia error, we use # a large tolerance so a small number of stars can be used assert np.isclose(sd.GERROR[colname + '_error'], np.std(sd.table[colname]), rtol=1e-1)