本文整理汇总了Python中ucar.unidata.data.grid.GridUtil.getDateTimeList方法的典型用法代码示例。如果您正苦于以下问题:Python GridUtil.getDateTimeList方法的具体用法?Python GridUtil.getDateTimeList怎么用?Python GridUtil.getDateTimeList使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ucar.unidata.data.grid.GridUtil
的用法示例。
在下文中一共展示了GridUtil.getDateTimeList方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: oldaverageOverTime
# 需要导入模块: from ucar.unidata.data.grid import GridUtil [as 别名]
# 或者: from ucar.unidata.data.grid.GridUtil import getDateTimeList [as 别名]
def oldaverageOverTime(field,makeTimes = 0):
"""@deprecated Average the values in each time step
If makeTimes is true (1) then we return a field mapping all of the times
to the average. Else we just return the average """
if (GridUtil.isTimeSequence(field)==0):
return field;
cnt = 0;
domainSet = field.getDomainSet()
current = None;
for t in range(domainSet.getLength()):
cnt=cnt+1
rangeValue = field.getSample(t)
if(current is None):
current = rangeValue.clone();
else:
current = current+rangeValue;
if(cnt == 0):
return None;
current = current/cnt;
if(makeTimes):
return Util.makeTimeField(current, GridUtil.getDateTimeList(field))
return current