csv.py 文件源码

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

项目:lehrex 作者: lkluft 项目源码 文件源码
def read_scat(filename, var_regex='CLB_B\d{5}', var_key='CLB_MATRIX',
              **kwargs):
    """Read scattering coefficients from CSV file.

    Parameters:
        filename (str): Path to CSV file.
        var_regex (str): Python regular expression [0] matching
            the variable name of the profile.
        var_key (str): Dictionary key for extracted profile.
        **kwargs: Additional keyword arguments passed to `read_profile`.

    [0] https://docs.python.org/3.1/library/re.html

    Returns:
        ndarray, ndarray: scattering coefficient, height levels
    """
    output = read_profile(
        filename,
        var_key=var_key,
        var_regex=var_regex,
        **kwargs,
        )

    back_scat = output[var_key]
    back_scat = np.ma.masked_less(back_scat, 0)

    output[var_key] = back_scat

    return output
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号