本文整理汇总了Python中coverage_model.ParameterContext.uom方法的典型用法代码示例。如果您正苦于以下问题:Python ParameterContext.uom方法的具体用法?Python ParameterContext.uom怎么用?Python ParameterContext.uom使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类coverage_model.ParameterContext
的用法示例。
在下文中一共展示了ParameterContext.uom方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: create_extended_parsed_contexts
# 需要导入模块: from coverage_model import ParameterContext [as 别名]
# 或者: from coverage_model.ParameterContext import uom [as 别名]
def create_extended_parsed_contexts(self):
contexts, funcs = self.create_parsed_params()
expr, expr_id = funcs['density_L2']
density_lookup_map = {'conductivity':'conductivity_L1', 'temp':'temp_L1', 'pressure':'pressure_L1', 'lat':'lat_lookup', 'lon':'lon_lookup'}
expr.param_map = density_lookup_map
density_lookup_ctxt = ParameterContext('density_lookup', param_type=ParameterFunctionType(expr), variability=VariabilityEnum.TEMPORAL)
density_lookup_ctxt.uom = 'kg m-3'
density_lookup_ctxt_id = self.dataset_management.create_parameter_context(name='density_lookup', parameter_context=density_lookup_ctxt.dump(), parameter_function_id=expr_id)
self.addCleanup(self.dataset_management.delete_parameter_context, density_lookup_ctxt_id)
contexts['density_lookup'] = density_lookup_ctxt, density_lookup_ctxt_id
lat_lookup_ctxt = ParameterContext('lat_lookup', param_type=ConstantType(QuantityType(value_encoding=np.dtype('float32'))), fill_value=-9999)
lat_lookup_ctxt.axis = AxisTypeEnum.LAT
lat_lookup_ctxt.uom = 'degree_north'
lat_lookup_ctxt.lookup_value = 'lat'
lat_lookup_ctxt.document_key = ''
lat_lookup_ctxt_id = self.dataset_management.create_parameter_context(name='lat_lookup', parameter_context=lat_lookup_ctxt.dump())
self.addCleanup(self.dataset_management.delete_parameter_context, lat_lookup_ctxt_id)
contexts['lat_lookup'] = lat_lookup_ctxt, lat_lookup_ctxt_id
lon_lookup_ctxt = ParameterContext('lon_lookup', param_type=ConstantType(QuantityType(value_encoding=np.dtype('float32'))), fill_value=-9999)
lon_lookup_ctxt.axis = AxisTypeEnum.LON
lon_lookup_ctxt.uom = 'degree_east'
lon_lookup_ctxt.lookup_value = 'lon'
lon_lookup_ctxt.document_key = ''
lon_lookup_ctxt_id = self.dataset_management.create_parameter_context(name='lon_lookup', parameter_context=lon_lookup_ctxt.dump())
self.addCleanup(self.dataset_management.delete_parameter_context, lon_lookup_ctxt_id)
contexts['lon_lookup'] = lon_lookup_ctxt, lon_lookup_ctxt_id
return contexts, funcs
示例2: create_simple_array
# 需要导入模块: from coverage_model import ParameterContext [as 别名]
# 或者: from coverage_model.ParameterContext import uom [as 别名]
def create_simple_array(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_sample', param_type=ArrayType(inner_encoding='float32'))
temp_ctxt.uom = 'deg_C'
temp_ctxt.ooi_short_name = 'TEMPWAT'
temp_ctxt.display_name = 'Temperature'
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
cond_ctxt = ParameterContext('cond_sample', param_type=ArrayType(inner_encoding='float64'))
cond_ctxt.uom = 'deg_C'
cond_ctxt.ooi_short_name = 'CONDWAT'
cond_ctxt.display_anme = 'Conductivity'
cond_ctxt_id = self.dataset_management.create_parameter_context(name='cond', parameter_context=cond_ctxt.dump(), ooi_short_name='CONDWAT')
self.addCleanup(self.dataset_management.delete_parameter_context, cond_ctxt_id)
contexts['cond'] = cond_ctxt, cond_ctxt_id
func = self.create_matrix_offset_function()
func.param_map = {'x':'temp_sample', 'y':'cond_sample'}
temp_offset = ParameterContext('temp_offset', param_type=ParameterFunctionType(func))
temp_offset.uom = '1'
temp_offset_id = self.dataset_management.create_parameter_context(name='temp_offset', parameter_context=temp_offset.dump())
self.addCleanup(self.dataset_management.delete_parameter_context, temp_offset_id)
contexts['temp_offset'] = temp_offset, temp_offset_id
return contexts
示例3: create_lookup_contexts
# 需要导入模块: from coverage_model import ParameterContext [as 别名]
# 或者: from coverage_model.ParameterContext import uom [as 别名]
def create_lookup_contexts(self):
contexts = {}
t_ctxt = ParameterContext('time', param_type=QuantityType(value_encoding=np.dtype('float64')))
t_ctxt.uom = 'seconds since 01-01-1900'
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_id = self.dataset_management.create_parameter_context(name='temp', parameter_context=temp_ctxt.dump())
self.addCleanup(self.dataset_management.delete_parameter_context, temp_ctxt_id)
contexts['temp'] = temp_ctxt, temp_ctxt_id
offset_ctxt = ParameterContext('offset_a', param_type=QuantityType(value_encoding='float32'), fill_value=-9999)
offset_ctxt.lookup_value = True
offset_ctxt_id = self.dataset_management.create_parameter_context(name='offset_a', parameter_context=offset_ctxt.dump())
self.addCleanup(self.dataset_management.delete_parameter_context, offset_ctxt_id)
contexts['offset_a'] = offset_ctxt, offset_ctxt_id
func = NumexprFunction('calibrated', 'temp + offset', ['temp','offset'], param_map={'temp':'temp', 'offset':'offset_a'})
func.lookup_values = ['LV_offset']
calibrated = ParameterContext('calibrated', param_type=ParameterFunctionType(func, value_encoding='float32'), fill_value=-9999)
calibrated_id = self.dataset_management.create_parameter_context(name='calibrated', parameter_context=calibrated.dump())
self.addCleanup(self.dataset_management.delete_parameter_context, calibrated_id)
contexts['calibrated'] = calibrated, calibrated_id
return contexts
示例4: create_contexts
# 需要导入模块: from coverage_model import ParameterContext [as 别名]
# 或者: from coverage_model.ParameterContext import uom [as 别名]
def create_contexts(self):
context_ids = []
cond_ctxt = ParameterContext('conductivity_test', param_type=QuantityType(value_encoding=np.float32))
cond_ctxt.uom = 'unknown'
cond_ctxt.fill_value = 0e0
context_ids.append(self.dataset_management.create_parameter_context(name='conductivity_test', parameter_context=cond_ctxt.dump()))
pres_ctxt = ParameterContext('pressure_test', param_type=QuantityType(value_encoding=np.float32))
pres_ctxt.uom = 'Pascal'
pres_ctxt.fill_value = 0x0
context_ids.append(self.dataset_management.create_parameter_context(name='pressure_test', parameter_context=pres_ctxt.dump()))
sal_ctxt = ParameterContext('salinity_test', param_type=QuantityType(value_encoding=np.float32))
sal_ctxt.uom = 'PSU'
sal_ctxt.fill_value = 0x0
context_ids.append(self.dataset_management.create_parameter_context(name='salinity_test', parameter_context=sal_ctxt.dump()))
temp_ctxt = ParameterContext('temp_test', param_type=QuantityType(value_encoding=np.float32))
temp_ctxt.uom = 'degree_Celsius'
temp_ctxt.fill_value = 0e0
context_ids.append(self.dataset_management.create_parameter_context(name='temp_test', parameter_context=temp_ctxt.dump()))
t_ctxt = ParameterContext('time_test', param_type=QuantityType(value_encoding=np.int64))
t_ctxt.uom = 'seconds since 1970-01-01'
t_ctxt.fill_value = 0x0
context_ids.append(self.dataset_management.create_parameter_context(name='time_test', parameter_context=t_ctxt.dump()))
return context_ids
示例5: create_simple_cc
# 需要导入模块: from coverage_model import ParameterContext [as 别名]
# 或者: from coverage_model.ParameterContext import uom [as 别名]
def create_simple_cc(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_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
func = NumexprFunction('offset', 'temp + offset', ['temp','offset'])
types_manager.get_pfunc = lambda pfid : func
func = types_manager.evaluate_pmap('pfid', {'temp':'temp', 'offset':'CC_coefficient'})
func_id = self.dataset_management.create_parameter_function('offset', func.dump())
self.addCleanup(self.dataset_management.delete_parameter_function, func_id)
offset_ctxt = ParameterContext('offset', param_type=ParameterFunctionType(func), fill_value=fill_value)
offset_ctxt.uom = '1'
offset_ctxt_id = self.dataset_management.create_parameter_context('offset', offset_ctxt.dump(), parameter_function_id=func_id)
self.addCleanup(self.dataset_management.delete_parameter_context, offset_ctxt_id)
contexts['offset'] = offset_ctxt, offset_ctxt_id
return contexts
示例6: create_illegal_char
# 需要导入模块: from coverage_model import ParameterContext [as 别名]
# 或者: from coverage_model.ParameterContext import uom [as 别名]
def create_illegal_char(self):
contexts = {}
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)
i_ctxt = ParameterContext('ice-cream', param_type=QuantityType(value_encoding=np.dtype('float32')))
i_ctxt.uom = '1'
i_ctxt_id = self.dataset_management.create_parameter_context(name='ice-cream', parameter_context=i_ctxt.dump())
self.addCleanup(self.dataset_management.delete_parameter_context, i_ctxt_id)
contexts['ice-cream'] = (i_ctxt, i_ctxt_id)
return contexts
示例7: create_simple_qc
# 需要导入模块: from coverage_model import ParameterContext [as 别名]
# 或者: from coverage_model.ParameterContext import uom [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
示例8: get_cc_value
# 需要导入模块: from coverage_model import ParameterContext [as 别名]
# 或者: from coverage_model.ParameterContext import uom [as 别名]
def get_cc_value(self, value):
placeholder = value.lower()
# Check to see if this coefficient exists already
hits, _ = Container.instance.resource_registry.find_resources(name=placeholder, restype=RT.ParameterContext, id_only=True)
if hits:
return hits[0], placeholder
pc = ParameterContext(name=placeholder, param_type=SparseConstantType(value_encoding='float64'), fill_value=-9999.)
pc.uom = '1'
ctxt_id = self.dataset_management.create_parameter_context(name=placeholder, parameter_context=pc.dump())
return ctxt_id, placeholder
示例9: create_qc_contexts
# 需要导入模块: from coverage_model import ParameterContext [as 别名]
# 或者: from coverage_model.ParameterContext import uom [as 别名]
def create_qc_contexts(self):
contexts = {}
qc_whatever_ctxt = ParameterContext('qc_whatever', param_type=ArrayType())
qc_whatever_ctxt.uom = '1'
qc_whatever_ctxt_id = self.dataset_management.create_parameter_context(name='qc_whatever', parameter_context=qc_whatever_ctxt.dump())
self.addCleanup(self.dataset_management.delete_parameter_context, qc_whatever_ctxt_id)
contexts['qc_whatever'] = qc_whatever_ctxt, qc_whatever_ctxt_id
nexpr = NumexprFunction('range_qc', 'min < var > max', ['min','max','var'])
expr_id = self.dataset_management.create_parameter_function(name='range_qc', parameter_function=nexpr.dump())
self.addCleanup(self.dataset_management.delete_parameter_function, expr_id)
pmap = {'min':0, 'max':20, 'var':'temp'}
nexpr.param_map = pmap
temp_qc_ctxt = ParameterContext('temp_qc', param_type=ParameterFunctionType(function=nexpr), variability=VariabilityEnum.TEMPORAL)
temp_qc_ctxt.uom = '1'
temp_qc_ctxt_id = self.dataset_management.create_parameter_context(name='temp_qc', parameter_context=temp_qc_ctxt.dump(), parameter_function_id=expr_id)
self.addCleanup(self.dataset_management.delete_parameter_context, temp_qc_ctxt_id)
contexts['temp_qc'] = temp_qc_ctxt, temp_qc_ctxt_id
return contexts
示例10: create_lookup_contexts
# 需要导入模块: from coverage_model import ParameterContext [as 别名]
# 或者: from coverage_model.ParameterContext import uom [as 别名]
def create_lookup_contexts(self):
contexts = {}
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())
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_id = self.dataset_management.create_parameter_context(name='temp', parameter_context=temp_ctxt.dump())
contexts['temp'] = temp_ctxt, temp_ctxt_id
offset_ctxt = ParameterContext(name='offset_a', param_type=SparseConstantType(base_type=ConstantType(value_encoding='float64'), fill_value=fill_value))
offset_ctxt.uom = ''
offset_ctxt.lookup_value = 'offset_a'
offset_ctxt.document_key = ''
offset_ctxt_id = self.dataset_management.create_parameter_context(name='offset_a', parameter_context=offset_ctxt.dump())
self.addCleanup(self.dataset_management.delete_parameter_context, offset_ctxt_id)
contexts['offset_a'] = offset_ctxt, offset_ctxt_id
offsetb_ctxt = ParameterContext('offset_b', param_type=SparseConstantType(base_type=ConstantType(value_encoding='float64'), fill_value=fill_value))
offsetb_ctxt.uom = ''
offsetb_ctxt.lookup_value = 'offset_b'
offsetb_ctxt.document_key = 'coefficient_document'
offsetb_ctxt_id = self.dataset_management.create_parameter_context(name='offset_b', parameter_context=offsetb_ctxt.dump())
self.addCleanup(self.dataset_management.delete_parameter_context, offsetb_ctxt_id)
contexts['offset_b'] = offsetb_ctxt, offsetb_ctxt_id
offsetc_ctxt = ParameterContext('offset_c', param_type=SparseConstantType(base_type=ConstantType(value_encoding='float64'), fill_value=fill_value))
offsetc_ctxt.uom = ''
offsetc_ctxt.lookup_value = 'offset_c'
offsetc_ctxt.document_key = '$designator_OFFSETC'
offsetc_ctxt_id = self.dataset_management.create_parameter_context(name='offset_c', parameter_context=offsetc_ctxt.dump())
self.addCleanup(self.dataset_management.delete_parameter_context, offsetc_ctxt_id)
contexts['offset_c'] = offsetc_ctxt, offsetc_ctxt_id
func = NumexprFunction('calibrated', 'temp + offset', ['temp','offset'], param_map={'temp':'temp', 'offset':'offset_a'})
func.lookup_values = ['LV_offset']
calibrated = ParameterContext('calibrated', param_type=ParameterFunctionType(func, value_encoding='float32'), fill_value=fill_value)
calibrated.uom = 'deg_C'
calibrated_id = self.dataset_management.create_parameter_context(name='calibrated', parameter_context=calibrated.dump())
self.addCleanup(self.dataset_management.delete_parameter_context, calibrated_id)
contexts['calibrated'] = calibrated, calibrated_id
func = NumexprFunction('calibrated_b', 'temp + offset_a + offset_b', ['temp','offset_a', 'offset_b'], param_map={'temp':'temp', 'offset_a':'offset_a', 'offset_b':'offset_b'})
func.lookup_values = ['LV_offset_a', 'LV_offset_b']
calibrated_b = ParameterContext('calibrated_b', param_type=ParameterFunctionType(func, value_encoding='float32'), fill_value=fill_value)
calibrated_b.uom = 'deg_C'
calibrated_b_id = self.dataset_management.create_parameter_context(name='calibrated_b', parameter_context=calibrated_b.dump())
self.addCleanup(self.dataset_management.delete_parameter_context, calibrated_b_id)
contexts['calibrated_b'] = calibrated_b, calibrated_b_id
return contexts
示例11: get_lookup_value
# 需要导入模块: from coverage_model import ParameterContext [as 别名]
# 或者: from coverage_model.ParameterContext import uom [as 别名]
def get_lookup_value(self,value):
placeholder = value.replace('LV_','')
document_key = ''
if '||' in placeholder:
document_key, placeholder = placeholder.split('||')
document_val = placeholder
placeholder = '%s_%s' % (placeholder, uuid4().hex)
pc = ParameterContext(name=placeholder, param_type=SparseConstantType(base_type=ConstantType(value_encoding='float64'), fill_value=-9999.))
pc.lookup_value = document_val
pc.document_key = document_key
pc.uom = '1'
pc.visible = False
ctxt_id = self.dataset_management.create_parameter_context(name=placeholder, parameter_context=pc.dump())
return ctxt_id, placeholder
示例12: create_simple_qc
# 需要导入模块: from coverage_model import ParameterContext [as 别名]
# 或者: from coverage_model.ParameterContext import uom [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
示例13: make_grt_qc
# 需要导入模块: from coverage_model import ParameterContext [as 别名]
# 或者: from coverage_model.ParameterContext import uom [as 别名]
def make_grt_qc(self, name, data_product):
pfunc_id, pfunc = self.find_grt()
grt_min_id, grt_min_name = self.get_lookup_value('LV_grt_$designator_%s||grt_min_value' % data_product)
grt_max_id, grt_max_name = self.get_lookup_value('LV_grt_$designator_%s||grt_max_value' % data_product)
pmap = {'dat':name, 'dat_min':grt_min_name,'dat_max':grt_max_name}
pfunc.param_map = pmap
pfunc.lookup_values = [grt_min_id, grt_max_id]
dp_name = self.dp_name(data_product)
pc = ParameterContext(name='%s_glblrng_qc' % dp_name.lower(), param_type=ParameterFunctionType(pfunc, value_encoding='|i1'))
pc.uom = '1'
pc.ooi_short_name = '%s_GLBLRNG_QC' % dp_name
pc.display_name = '%s Global Range Test Quality Control Flag' % dp_name
pc.description = "The OOI Global Range quality control algorithm generates a QC flag for the input data point indicating whether it falls within a given range."
ctxt_id = self.dataset_management.create_parameter_context(name='%s_glblrng_qc' % dp_name.lower(), parameter_type='function', parameter_context=pc.dump(), parameter_function_id=pfunc_id, ooi_short_name=pc.ooi_short_name, units='1', value_encoding='int8', display_name=pc.display_name, description=pc.description)
return ctxt_id, pc
示例14: make_manual_upload_data_product
# 需要导入模块: from coverage_model import ParameterContext [as 别名]
# 或者: from coverage_model.ParameterContext import uom [as 别名]
def make_manual_upload_data_product(self):
# Get a precompiled parameter dictionary with basic ctd fields
pdict_id = self.dataset_management.read_parameter_dictionary_by_name('ctd_parsed_param_dict',id_only=True)
context_ids = self.dataset_management.read_parameter_contexts(pdict_id, id_only=True)
# Add a handful of Calibration Coefficient parameters
for cc in ['temp_hitl_qc', 'cond_hitl_qc']:
c = ParameterContext(cc, param_type=BooleanType())
c.uom = '1'
context_ids.append(self.dataset_management.create_parameter_context(cc, c.dump()))
pdict_id = self.dataset_management.create_parameter_dictionary('manup_dict', context_ids, temporal_context='time')
data_product_id = self.create_data_product('manup_dp', pdict_id=pdict_id)
self.activate_data_product(data_product_id)
dataset_id, _ = self.resource_registry.find_objects(data_product_id, PRED.hasDataset, id_only=True)
return data_product_id, dataset_id[0]
示例15: make_cal_data_product
# 需要导入模块: from coverage_model import ParameterContext [as 别名]
# 或者: from coverage_model.ParameterContext import uom [as 别名]
def make_cal_data_product(self):
# Get a precompiled parameter dictionary with basic ctd fields
pdict_id = self.dataset_management.read_parameter_dictionary_by_name('ctd_parsed_param_dict',id_only=True)
context_ids = self.dataset_management.read_parameter_contexts(pdict_id, id_only=True)
# Add a handful of Calibration Coefficient parameters
for cc in ['cc_ta0', 'cc_ta1', 'cc_ta2', 'cc_ta3', 'cc_toffset']:
c = ParameterContext(cc, param_type=SparseConstantType(value_encoding='float32', fill_value=-9999))
c.uom = '1'
context_ids.append(self.dataset_management.create_parameter_context(cc, c.dump()))
pdict_id = self.dataset_management.create_parameter_dictionary('calcoeff_dict', context_ids, temporal_context='time')
data_product_id = self.create_data_product('calcoeff_dp', pdict_id=pdict_id)
self.activate_data_product(data_product_id)
dataset_id, _ = self.resource_registry.find_objects(data_product_id, PRED.hasDataset, id_only=True)
return data_product_id, dataset_id[0]