本文整理汇总了Python中ion.services.dm.utility.granule.RecordDictionaryTool._rd[field]方法的典型用法代码示例。如果您正苦于以下问题:Python RecordDictionaryTool._rd[field]方法的具体用法?Python RecordDictionaryTool._rd[field]怎么用?Python RecordDictionaryTool._rd[field]使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ion.services.dm.utility.granule.RecordDictionaryTool
的用法示例。
在下文中一共展示了RecordDictionaryTool._rd[field]方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _data_dict_to_rdt
# 需要导入模块: from ion.services.dm.utility.granule import RecordDictionaryTool [as 别名]
# 或者: from ion.services.dm.utility.granule.RecordDictionaryTool import _rd[field] [as 别名]
def _data_dict_to_rdt(cls, data_dict, stream_def_id, coverage):
if stream_def_id:
rdt = RecordDictionaryTool(stream_definition_id=stream_def_id)
else:
rdt = RecordDictionaryTool(param_dictionary=coverage.parameter_dictionary)
if not data_dict:
log.warning('Retrieve returning empty set')
return rdt
if 'time' in data_dict and data_dict['time'].shape[0] == 0:
log.warning('Retrieve returning empty set')
return rdt
rdt[coverage.temporal_parameter_name] = data_dict[coverage.temporal_parameter_name]
for field in rdt.fields:
if field == 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.
if field in data_dict:
rdt._rd[field] = data_dict[field]
#rdt[k] = v
return rdt