chem.py 文件源码

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

项目:faampy 作者: ncasuk 项目源码 文件源码
def read_icl_na(ifile, apply_flag=False):
    """Reads in the ICL data from the Aerodyne Tunable IR Laser Direct
    Absorption Spectrometer (TILDAS) model QC-TILDAS-DUAL

    :param ifile: nasaAmes input filename
    :type ifile:
    :param apply_flag:
    :type apply_flag: boolean
    :return: pandas.DataFrame"""

    try:
        import nappy
    except:
        sys.stdout.write('Can not import nappy ...\n')
        return
    ds = nappy.openNAFile(ifile)
    ds.readData()

    timestamp = netCDF4.num2date(ds.X, ds.getIndependentVariable(0)[1])
    from collections import OrderedDict

    dict = OrderedDict()
    dict['timestamp'] = timestamp
    for i, v in enumerate(['c2h6_conc', 'c2h6_flag']):
        dict[v] = ds.V[i]
    df = pd.DataFrame(dict)
    df = df.set_index('timestamp')
    if apply_flag:
        df['c2h6_conc'][df['c2h6_flag'] != 0] = np.nan
    return df
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号