这个问题刚刚出现,我有一个答案,但我想在这里分享......
“是否可以基于 cell_methods 创建虹膜约束?”
我有一个数据文件,可以加载生成许多多维数据集。
我只想提取那些包含整体传播的内容,我可以从它们的 cell_methods 中识别它们,这些方法设置为:
(CellMethod(method=u'standard_deviation', coord_names=(u'realization',),Intervals=(), comments=()),)
有没有办法过滤负载,以便我只读取所需的“整体传播”数据?
最佳答案
为此,您需要使用“cube_func”方法。
http://scitools.org.uk/iris/docs/latest/iris/iris.html?highlight=constraint#iris.Constraint
所以,大致就像......
def cube_is_mean(cube):
return any(cm.method == 'mean' for cm in cube.cell_methods)
means_constraint = iris.Constraint(cube_func=cube_is_mean)
关于python-iris - 是否可以基于 cell_methods 创建虹膜约束?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45169004/