def test_2mass_catalog_generation(): """Test the generation of a catalog from a 2MASS query """ two_mass_mirage, two_mass_query_results = create_catalog.get_2MASS_ptsrc_catalog( 80.4, -69.8, 120) comparison_file = os.path.join(TEST_DATA_DIR, 'catalog_generation/TwoMass_test.cat') comparison_table = ascii.read(comparison_file) assert all(two_mass_mirage.ra == comparison_table['x_or_RA'].data)
def test_2mass_plus_besaoncon_convenience_function(): """Test the convenience function that queries 2MASS and Besancon and combines the two catalogs """ twomass, query = create_catalog.get_2MASS_ptsrc_catalog(80.4, -69.8, 120) both = create_catalog.twoMASS_plus_background(80.4, -69.8, 120, kmag_limits=(16, 25), email='*****@*****.**') assert len(twomass.table) < len(both.table)
def test_2mass_catalog_generation(): """Test the generation of a catalog from a 2MASS query """ two_mass_mirage, two_mass_query_results = create_catalog.get_2MASS_ptsrc_catalog(80.4, -69.8, 120) comparison_file = os.path.join(TEST_DATA_DIR, 'catalog_generation/TwoMass_test.cat') comparison_table = ascii.read(comparison_file) assert two_mass_query_results.colnames == ['ra', 'dec', 'clon', 'clat', 'err_maj', 'err_min', 'err_ang', 'designation', 'j_m', 'j_cmsig', 'j_msigcom', 'j_snr', 'h_m', 'h_cmsig', 'h_msigcom', 'h_snr', 'k_m', 'k_cmsig', 'k_msigcom', 'k_snr', 'ph_qual', 'rd_flg', 'bl_flg', 'cc_flg', 'ndet', 'gal_contam', 'mp_flg', 'hemis', 'xdate', 'scan', 'glon', 'glat', 'a', 'dist_opt', 'phi_opt', 'b_m_opt', 'vr_m_opt', 'nopt_mchs', 'ext_key', 'j_h', 'h_k', 'j_k'] assert two_mass_mirage.table.colnames == ['index', 'x_or_RA', 'y_or_Dec', '2mass_j_m_magnitude', '2mass_h_m_magnitude', '2mass_k_m_magnitude'] assert len(two_mass_mirage.ra) == len(comparison_table['x_or_RA'].data)