netcdf_utils.py 文件源码

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

项目:satpy 作者: pytroll 项目源码 文件源码
def _collect_attrs(self, name, obj):
        """Collect all the attributes for the provided file object.
        """
        for key in obj.ncattrs():
            value = getattr(obj, key)
            value = np.squeeze(value)
            if issubclass(value.dtype.type, str) or np.issubdtype(value.dtype, np.character):
                self.file_content["{}/attr/{}".format(name, key)] = str(value)
            else:
                self.file_content["{}/attr/{}".format(name, key)] = value
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号