本文整理汇总了Python中ion.services.dm.utility.granule.RecordDictionaryTool._rd[k]方法的典型用法代码示例。如果您正苦于以下问题:Python RecordDictionaryTool._rd[k]方法的具体用法?Python RecordDictionaryTool._rd[k]怎么用?Python RecordDictionaryTool._rd[k]使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ion.services.dm.utility.granule.RecordDictionaryTool
的用法示例。
在下文中一共展示了RecordDictionaryTool._rd[k]方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _cov2granule
# 需要导入模块: from ion.services.dm.utility.granule import RecordDictionaryTool [as 别名]
# 或者: from ion.services.dm.utility.granule.RecordDictionaryTool import _rd[k] [as 别名]
def _cov2granule(cls, coverage, start_time=None, end_time=None, stride_time=None, stream_def_id=None, parameters=None, tdoa=None):
if tdoa is None:
if start_time is not None:
start_time = cls.convert_time(coverage, start_time)
if end_time is not None:
end_time = cls.convert_time(coverage, end_time)
slice_ = slice(start_time, end_time, stride_time)
if stream_def_id:
rdt = RecordDictionaryTool(stream_definition_id=stream_def_id)
else:
rdt = RecordDictionaryTool(param_dictionary=coverage.parameter_dictionary)
if tdoa:
vdict = coverage.get_value_dictionary(parameters or rdt.fields, domain_slice=tdoa)
else:
vdict = coverage.get_value_dictionary(parameters or rdt.fields, temporal_slice=slice_)
if not vdict:
log.warning('Retrieve returning empty set')
return rdt
rdt[coverage.temporal_parameter_name] = vdict[coverage.temporal_parameter_name]
for k,v in vdict.iteritems():
if k == coverage.temporal_parameter_name:
continue
# The values have already been inside a coverage so we know they're safe and they exist, so they can be inserted directly.
rdt._rd[k] = v
#rdt[k] = v
return rdt