utils.py 文件源码

python
阅读 30 收藏 0 点赞 0 评论 0

项目:SWEETer-Cat 作者: DanielAndreasen 项目源码 文件源码
def planetAndStar(how='inner'):
    """Read the SWEET-Cat and ExoplanetEU databases and merge them.

    Input
    -----
    how : str (default: 'inner')
      How to merge the two DataFrames. See pd.merge for documentation

    Output
    ------
    d : pd.DataFrame
      The DataFrame of merged DataFrame
    c : list
      The columns that can be used for plotting
    """
    df, columns = readSC()
    deu = readExoplanetEU()
    cols = ['stName', 'plMass', 'plRadius', 'period', 'sma', 'eccentricity',
            'inclination', 'discovered', 'dist', 'b',
            'mag_v', 'mag_i', 'mag_j', 'mag_h', 'mag_k', 'plDensity']
    d = pd.merge(df, deu, left_on='Star', right_on='stName', how=how)
    d['radius'] = list(map(stellar_radius, d['mass'], d['logg']))
    d['teq0'] = d.teff * np.sqrt((d.radius*700000)/(2*d.sma*150000000))
    c = columns + cols[1:]
    return d, c
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号