Ejemplo n.º 1
0
def apokasc(rmcommissioning=True, main=False):
    """
    NAME:
       apokasc
    PURPOSE:
       read the APOKASC data
    INPUT:
       rmcommissioning= (default: True) if True, only use data obtained after commissioning
       main= (default: False) if True, only select stars in the main survey
    OUTPUT:
       APOKASC data
    HISTORY:
       2013-10-01 - Written - Bovy (IAS)
    """
    if not _ESUTIL_LOADED:
        raise ImportError(
            "apogee.tools.read.apokasc function requires the esutil module for catalog matching"
        )
    #read allStar file
    data = allStar(rmcommissioning=rmcommissioning,
                   main=main,
                   adddist=False,
                   rmdups=False)
    #read the APOKASC file
    kascdata = fitsio.read(path.apokascPath())
    #Match these two
    h = esutil.htm.HTM()
    m1, m2, d12 = h.match(kascdata['RA'],
                          kascdata['DEC'],
                          data['RA'],
                          data['DEC'],
                          2. / 3600.,
                          maxmatch=1)
    data = data[m2]
    kascdata = kascdata[m1]
    kascdata = esutil.numpy_util.add_fields(kascdata,
                                            [('J0', float), ('H0', float),
                                             ('K0', float),
                                             ('APOGEE_TARGET1', '>i4'),
                                             ('APOGEE_TARGET2', '>i4'),
                                             ('APOGEE_ID', 'S18'),
                                             ('LOGG', float), ('TEFF', float),
                                             ('METALS', float),
                                             ('ALPHAFE', float),
                                             ('FNFE', float), ('FCFE', float)])
    kascdata['J0'] = data['J0']
    kascdata['H0'] = data['H0']
    kascdata['K0'] = data['K0']
    kascdata['APOGEE_ID'] = data['APOGEE_ID']
    kascdata['APOGEE_TARGET1'] = data['APOGEE_TARGET1']
    kascdata['APOGEE_TARGET2'] = data['APOGEE_TARGET2']
    kascdata['LOGG'] = data['LOGG']
    kascdata['TEFF'] = data['TEFF']
    kascdata['METALS'] = data['METALS']
    kascdata['ALPHAFE'] = data['ALPHAFE']
    kascdata['FNFE'] = data['FPARAM'][:, 5]
    kascdata['FCFE'] = data['FPARAM'][:, 4]
    return kascdata
Ejemplo n.º 2
0
def apokasc(rmcommissioning=True,
            main=False):
    """
    NAME:
       apokasc
    PURPOSE:
       read the APOKASC data
    INPUT:
       rmcommissioning= (default: True) if True, only use data obtained after commissioning
       main= (default: False) if True, only select stars in the main survey
    OUTPUT:
       APOKASC data
    HISTORY:
       2013-10-01 - Written - Bovy (IAS)
    """
    if not _ESUTIL_LOADED:
        raise ImportError("apogee.tools.read.apokasc function requires the esutil module for catalog matching")
    #read allStar file
    data= allStar(rmcommissioning=rmcommissioning,main=main,adddist=False,
                  rmdups=False)
    #read the APOKASC file
    kascdata= fitsio.read(path.apokascPath())
    #Match these two
    h=esutil.htm.HTM()
    m1,m2,d12 = h.match(kascdata['RA'],kascdata['DEC'],
                        data['RA'],data['DEC'],
                        2./3600.,maxmatch=1)
    data= data[m2]
    kascdata= kascdata[m1]
    kascdata= esutil.numpy_util.add_fields(kascdata,[('J0', float),
                                                     ('H0', float),
                                                     ('K0', float),
                                                     ('APOGEE_TARGET1','>i4'),
                                                     ('APOGEE_TARGET2','>i4'),
                                                     ('APOGEE_ID', 'S18'),
                                                     ('LOGG', float),
                                                     ('TEFF', float),
                                                     ('METALS', float),
                                                     ('ALPHAFE', float),
                                                     ('FNFE', float),
                                                     ('FCFE', float)])
    kascdata['J0']= data['J0']
    kascdata['H0']= data['H0']
    kascdata['K0']= data['K0']
    kascdata['APOGEE_ID']= data['APOGEE_ID']
    kascdata['APOGEE_TARGET1']= data['APOGEE_TARGET1']
    kascdata['APOGEE_TARGET2']= data['APOGEE_TARGET2']
    kascdata['LOGG']= data['LOGG']
    kascdata['TEFF']= data['TEFF']
    kascdata['METALS']= data['METALS']
    kascdata['ALPHAFE']= data['ALPHAFE']
    kascdata['FNFE']= data['FPARAM'][:,5]
    kascdata['FCFE']= data['FPARAM'][:,4]
    return kascdata
Ejemplo n.º 3
0
    read the APOKASC data
 INPUT:
    rmcommissioning= (default: True) if True, only use data obtained after commissioning
    main= (default: False) if True, only select stars in the main survey
 OUTPUT:
    APOKASC data
 HISTORY:
    2013-10-01 - Written - Bovy (IAS)
 """
 if not _ESUTIL_LOADED:
     raise ImportError("apogee.tools.read.apokasc function requires the esutil module for catalog matching")
 #read allStar file
 data= allStar(rmcommissioning=rmcommissioning,main=main,adddist=False,
               rmdups=False)
 #read the APOKASC file
 kascdata= fitsread(path.apokascPath())
 #Match these two
 h=esutil.htm.HTM()
 m1,m2,d12 = h.match(kascdata['RA'],kascdata['DEC'],
                     data['RA'],data['DEC'],
                     2./3600.,maxmatch=1)
 data= data[m2]
 kascdata= kascdata[m1]
 kascdata= esutil.numpy_util.add_fields(kascdata,[('J0', float),
                                                  ('H0', float),
                                                  ('K0', float),
                                                  ('APOGEE_TARGET1','>i4'),
                                                  ('APOGEE_TARGET2','>i4'),
                                                  ('APOGEE_ID', 'S18'),
                                                  ('LOGG', float),
                                                  ('TEFF', float),