Example #1
0
def find_crossmatch_failures(survey):

    r = pd.read_hdf('/data/jls/GaiaDR2/spectro/%s_input.hdf5' % survey)

    #    columns = ['parallax', 'parallax_error',
    #               'pmra', 'pmdec',
    #               'pmra_error', 'pmdec_error',
    #               'parallax_pmra_corr', 'parallax_pmdec_corr', 'pmra_pmdec_corr',
    #               'source_id', 'G', 'GBP', 'GRP', 'eG', 'eGRP', 'eGBP',
    #               'a_g_val', 'a_g_percentile_lower', 'a_g_percentile_upper']

    #   r = r.drop(columns, axis=1)

    if survey == 'GES':
        rx = load_ges()
    if survey == 'APOGEE':
        rx = load_apogee()
    if survey == 'RAVE':
        rx = load_rave(use_dr5=True)
    if survey == 'RAVEON':
        rx = load_rave(use_dr5=False)
    if survey == 'GALAH':
        rx = load_galah()
    if survey == 'LAMOST':
        rx = load_lamost()
        rx = format_columns(rx)

    rx = crossmatch_gaia_spectro(rx, no_proper_motion=False, dist_max=5.)
    print len(rx), np.count_nonzero(r.source_id > 0), np.count_nonzero(
        rx.source_id > 0), np.count_nonzero(r.source_id != rx.source_id)
    rx = rx[(rx.source_id > 0)
            & (r.source_id != rx.source_id)].reset_index(drop=True)

    rx.to_hdf('/data/jls/GaiaDR2/spectro/%s_input_pm.hdf5' % survey, 'data')
Example #2
0
def run_apogee():
    apogee = load_apogee(output_file=output_folder + 'APOGEE_input.hdf5', use_dr1=DR1)
    return
    apogee = check_photometry(apogee)
    run_distance_pipeline(apogee,
                          output_folder + 'APOGEE_distances%s.hdf5' % name_str,
                          'APOGEE_ID', 'APOGEE',
                          npool=npool,
                          with_parallax=with_parallax, thin_mag=0.1)
Example #3
0
def run_apogee_fillin():
    apogee = load_apogee(use_dr1=DR1)
    apogee2 = Table.read(output_folder + 'APOGEE_distances.hdf5')
    apogee = check_photometry(
        apogee[apogee2['flag'] == 3].reset_index(drop=True))
    run_distance_pipeline(apogee,
                          output_folder + 'APOGEE_distances_fillin.hdf5',
                          'APOGEE_ID',
                          'APOGEE',
                          npool=npool,
                          with_parallax=with_parallax)
Example #4
0
def run_apogee():
    apogee = load_apogee(use_dr1=DR1)
    if TEST:
        apogee = apogee.sample(n=TESTNUMBER,
                               random_state=random_seed).reset_index(drop=True)
    apogee = check_photometry(apogee)
    run_distance_pipeline(apogee,
                          output_folder + 'APOGEE_distances%s.hdf5' % name_str,
                          'APOGEE_ID',
                          'APOGEE',
                          npool=npool,
                          with_parallax=with_parallax)