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


Python ParameterContext._derived_from_name方法代码示例

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


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

示例1: get_param_dict

# 需要导入模块: from coverage_model.parameter import ParameterContext [as 别名]
# 或者: from coverage_model.parameter.ParameterContext import _derived_from_name [as 别名]
    def get_param_dict(self):
        pdict = ParameterDictionary()

        cond_ctxt = ParameterContext('conductivity', param_type=QuantityType(value_encoding=np.float64))
        cond_ctxt.uom = 'unknown'
        cond_ctxt.fill_value = 0e0
        pdict.add_context(cond_ctxt)

        pres_ctxt = ParameterContext('pressure', param_type=QuantityType(value_encoding=np.float64))
        pres_ctxt.uom = 'unknown'
        pres_ctxt.fill_value = 0x0
        pdict.add_context(pres_ctxt)

        temp_ctxt = ParameterContext('temperature', param_type=QuantityType(value_encoding=np.float64))
        temp_ctxt.uom = 'unknown'
        temp_ctxt.fill_value = 0x0
        pdict.add_context(temp_ctxt)

        oxy_ctxt = ParameterContext('oxygen', param_type=QuantityType(value_encoding=np.float64))
        oxy_ctxt.uom = 'unknown'
        oxy_ctxt.fill_value = 0x0
        pdict.add_context(oxy_ctxt)

        internal_ts_ctxt = ParameterContext(name='internal_timestamp', param_type=QuantityType(value_encoding=np.float64))
        internal_ts_ctxt._derived_from_name = 'time'
        internal_ts_ctxt.uom = 'seconds'
        internal_ts_ctxt.fill_value = -1
        pdict.add_context(internal_ts_ctxt, is_temporal=True)

        driver_ts_ctxt = ParameterContext(name='driver_timestamp', param_type=QuantityType(value_encoding=np.float64))
        driver_ts_ctxt._derived_from_name = 'time'
        driver_ts_ctxt.uom = 'seconds'
        driver_ts_ctxt.fill_value = -1
        pdict.add_context(driver_ts_ctxt)

        return pdict
开发者ID:Bobfrat,项目名称:coi-services,代码行数:38,代码来源:test_result_set.py

示例2: load

# 需要导入模块: from coverage_model.parameter import ParameterContext [as 别名]
# 或者: from coverage_model.parameter.ParameterContext import _derived_from_name [as 别名]
def load():
    from coverage_model.parameter import ParameterContext
    from coverage_model.parameter_types import QuantityType, ArrayType, RecordType
    from coverage_model.basic_types import AxisTypeEnum
    import numpy as np
    contexts = []

    cond_ctxt = ParameterContext('conductivity', param_type=QuantityType(value_encoding=np.float32))
    cond_ctxt.uom = 'unknown'
    cond_ctxt.fill_value = 0e0
    contexts.append(cond_ctxt)

    pres_ctxt = ParameterContext('pressure', param_type=QuantityType(value_encoding=np.float32))
    pres_ctxt.uom = 'Pascal'
    pres_ctxt.fill_value = 0x0
    contexts.append(pres_ctxt)

    sal_ctxt = ParameterContext('salinity', param_type=QuantityType(value_encoding=np.float32))
    sal_ctxt.uom = 'PSU'
    sal_ctxt.fill_value = 0x0
    contexts.append(sal_ctxt)

    den_ctxt = ParameterContext('density', param_type=QuantityType(value_encoding=np.float32))
    den_ctxt.uom = 'kg/m3'
    den_ctxt.fill_value = 0x0
    contexts.append(den_ctxt)

    temp_ctxt = ParameterContext('temp', param_type=QuantityType(value_encoding=np.float32))
    temp_ctxt.uom = 'degree_Celsius'
    temp_ctxt.fill_value = 0e0
    contexts.append(temp_ctxt)

    t_ctxt = ParameterContext('time', param_type=QuantityType(value_encoding=np.int64))
    t_ctxt.uom = 'seconds since 1970-01-01'
    t_ctxt.fill_value = 0x0
    contexts.append(t_ctxt)

    lat_ctxt = ParameterContext('lat', param_type=QuantityType(value_encoding=np.float32))
    lat_ctxt.reference_frame = AxisTypeEnum.LAT
    lat_ctxt.uom = 'degree_north'
    lat_ctxt.fill_value = 0e0
    contexts.append(lat_ctxt)

    lon_ctxt = ParameterContext('lon', param_type=QuantityType(value_encoding=np.float32))
    lon_ctxt.reference_frame = AxisTypeEnum.LON
    lon_ctxt.uom = 'degree_east'
    lon_ctxt.fill_value = 0e0
    contexts.append(lon_ctxt)

    raw_ctxt = ParameterContext('raw', param_type=ArrayType())
    raw_ctxt.description = 'raw binary string values'
    raw_ctxt.uom = 'utf-8 byte string'
    contexts.append(raw_ctxt)

    port_ts_ctxt = ParameterContext(name='port_timestamp', param_type=QuantityType(value_encoding=np.float64))
    port_ts_ctxt._derived_from_name = 'time'
    port_ts_ctxt.uom = 'seconds'
    port_ts_ctxt.fill_value = -1
    contexts.append(port_ts_ctxt)

    driver_ts_ctxt = ParameterContext(name='driver_timestamp', param_type=QuantityType(value_encoding=np.float64))
    driver_ts_ctxt._derived_from_name = 'time'
    driver_ts_ctxt.uom = 'seconds'
    driver_ts_ctxt.fill_value = -1
    contexts.append(driver_ts_ctxt)

    internal_ts_ctxt = ParameterContext(name='internal_timestamp', param_type=QuantityType(value_encoding=np.float64))
    internal_ts_ctxt._derived_from_name = 'time'
    internal_ts_ctxt.uom = 'seconds'
    internal_ts_ctxt.fill_value = -1
    contexts.append(internal_ts_ctxt)

    timer_num_ctxt = ParameterContext(name='timer', param_type=QuantityType(value_encoding=np.float64))
    timer_num_ctxt.fill_value = -1
    contexts.append(timer_num_ctxt)

    serial_num_ctxt = ParameterContext(name='serial_num', param_type=QuantityType(value_encoding=np.int32))
    serial_num_ctxt.fill_value = -1
    contexts.append(serial_num_ctxt)

    count_ctxt = ParameterContext(name='counts', param_type=QuantityType(value_encoding=np.uint64))
    count_ctxt.fill_value = -1
    contexts.append(count_ctxt)

    checksum_ctxt = ParameterContext(name='checksum', param_type=QuantityType(value_encoding=np.int32))
    checksum_ctxt.fill_value = -1
    contexts.append(checksum_ctxt)

    pref_ts_ctxt = ParameterContext(name='preferred_timestamp', param_type=ArrayType())
    pref_ts_ctxt.description = 'name of preferred timestamp'
    contexts.append(pref_ts_ctxt)

    # TODO: This should probably be of type CategoryType when implemented
    qual_flag_ctxt = ParameterContext(name='quality_flag', param_type=ArrayType())
    qual_flag_ctxt.description = 'flag indicating quality'
    contexts.append(qual_flag_ctxt)

    viz_ts_ctxt = ParameterContext(name='viz_timestamp', param_type=QuantityType(value_encoding=np.float64))
    viz_ts_ctxt._derived_from_name = 'time'
    viz_ts_ctxt.uom = 'seconds'
#.........这里部分代码省略.........
开发者ID:lukecampbell,项目名称:parameter-definitions,代码行数:103,代码来源:standard.py


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