当前位置: 首页>>代码示例>>Python>>正文


Python ParameterContext.qc_contexts方法代码示例

本文整理汇总了Python中coverage_model.ParameterContext.qc_contexts方法的典型用法代码示例。如果您正苦于以下问题:Python ParameterContext.qc_contexts方法的具体用法?Python ParameterContext.qc_contexts怎么用?Python ParameterContext.qc_contexts使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在coverage_model.ParameterContext的用法示例。


在下文中一共展示了ParameterContext.qc_contexts方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: create_simple_qc

# 需要导入模块: from coverage_model import ParameterContext [as 别名]
# 或者: from coverage_model.ParameterContext import qc_contexts [as 别名]
    def create_simple_qc(self):
        contexts = {}
        types_manager = TypesManager(self.dataset_management,None,None)
        t_ctxt = ParameterContext('time', param_type=QuantityType(value_encoding=np.dtype('float64')))
        t_ctxt.uom = 'seconds since 1900-01-01'
        t_ctxt_id = self.dataset_management.create_parameter_context(name='time', parameter_context=t_ctxt.dump())
        self.addCleanup(self.dataset_management.delete_parameter_context, t_ctxt_id)
        contexts['time'] = (t_ctxt, t_ctxt_id)
        
        temp_ctxt = ParameterContext('temp', param_type=QuantityType(value_encoding=np.dtype('float32')), fill_value=fill_value)
        temp_ctxt.uom = 'deg_C'
        temp_ctxt.ooi_short_name = 'TEMPWAT'
        temp_ctxt.qc_contexts = types_manager.make_qc_functions('temp','TEMPWAT',lambda *args, **kwargs : None)
        temp_ctxt_id = self.dataset_management.create_parameter_context(name='temp', parameter_context=temp_ctxt.dump(), ooi_short_name='TEMPWAT')
        self.addCleanup(self.dataset_management.delete_parameter_context, temp_ctxt_id)
        contexts['temp'] = temp_ctxt, temp_ctxt_id

        press_ctxt = ParameterContext('pressure', param_type=QuantityType(value_encoding=np.dtype('float32')), fill_value=fill_value)
        press_ctxt.uom = 'dbar'
        press_ctxt.ooi_short_name = 'PRESWAT'
        press_ctxt.qc_contexts = types_manager.make_qc_functions('pressure', 'PRESWAT', lambda *args, **kwargs : None)
        press_ctxt_id = self.dataset_management.create_parameter_context(name='pressure', parameter_context=press_ctxt.dump(), ooi_short_name='PRESWAT')
        self.addCleanup(self.dataset_management.delete_parameter_context, press_ctxt_id)
        contexts['pressure'] = press_ctxt, press_ctxt_id
        
        lat_ctxt = ParameterContext('lat', param_type=SparseConstantType(base_type=ConstantType(value_encoding='float64'), fill_value=fill_value), fill_value=fill_value)
        lat_ctxt.uom = 'degree_north'
        lat_ctxt_id = self.dataset_management.create_parameter_context(name='lat', parameter_context=lat_ctxt.dump())
        contexts['lat'] = lat_ctxt, lat_ctxt_id

        lon_ctxt = ParameterContext('lon', param_type=SparseConstantType(base_type=ConstantType(value_encoding='float64'), fill_value=fill_value), fill_value=fill_value)
        lon_ctxt.uom = 'degree_east'
        lon_ctxt_id = self.dataset_management.create_parameter_context(name='lon', parameter_context=lon_ctxt.dump())
        contexts['lon'] = lon_ctxt, lon_ctxt_id

        return contexts
开发者ID:MauriceManning,项目名称:coi-services,代码行数:38,代码来源:parameter_helper.py

示例2: create_simple_qc

# 需要导入模块: from coverage_model import ParameterContext [as 别名]
# 或者: from coverage_model.ParameterContext import qc_contexts [as 别名]
    def create_simple_qc(self):
        contexts = {}
        types_manager = TypesManager(self.dataset_management,None,None)
        t_ctxt = ParameterContext('time', param_type=QuantityType(value_encoding=np.dtype('float64')))
        t_ctxt.uom = 'seconds since 1900-01-01'
        t_ctxt_id = self.dataset_management.create_parameter_context(name='time', parameter_context=t_ctxt.dump())
        self.addCleanup(self.dataset_management.delete_parameter_context, t_ctxt_id)
        contexts['time'] = (t_ctxt, t_ctxt_id)
        
        temp_ctxt = ParameterContext('temp', param_type=QuantityType(value_encoding=np.dtype('float32')), fill_value=-9999)
        temp_ctxt.uom = 'deg_C'
        temp_ctxt.ooi_short_name = 'TEMPWAT'
        temp_ctxt.qc_contexts = types_manager.make_qc_functions('temp','TEMPWAT',lambda *args, **kwargs : None)
        temp_ctxt_id = self.dataset_management.create_parameter_context(name='temp', parameter_context=temp_ctxt.dump(), ooi_short_name='TEMPWAT')
        self.addCleanup(self.dataset_management.delete_parameter_context, temp_ctxt_id)
        contexts['temp'] = temp_ctxt, temp_ctxt_id

        return contexts
开发者ID:shenrie,项目名称:coi-services,代码行数:20,代码来源:parameter_helper.py


注:本文中的coverage_model.ParameterContext.qc_contexts方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。