msg_base.py 文件源码

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

项目:satpy 作者: pytroll 项目源码 文件源码
def dec10216(data):
    """Unpacking the 10 bit data to 16 bit"""

    arr10 = data.astype(np.uint16).flat
    new_shape = list(data.shape[:-1]) + [(data.shape[-1] * 8) / 10]
    new_shape = [int(s) for s in new_shape]
    arr16 = np.zeros(new_shape, dtype=np.uint16)
    arr16.flat[::4] = np.left_shift(arr10[::5], 2) + \
        np.right_shift((arr10[1::5]), 6)
    arr16.flat[1::4] = np.left_shift((arr10[1::5] & 63), 4) + \
        np.right_shift((arr10[2::5]), 4)
    arr16.flat[2::4] = np.left_shift(arr10[2::5] & 15, 6) + \
        np.right_shift((arr10[3::5]), 2)
    arr16.flat[3::4] = np.left_shift(arr10[3::5] & 3, 8) + \
        arr10[4::5]
    return arr16
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号