def _create_parameter(self): pdict = ParameterDictionary() pdict = self._add_location_time_ctxt(pdict) pres_ctxt = ParameterContext('pressure', param_type=QuantityType(value_encoding=numpy.float32)) pres_ctxt.uom = 'Pascal' pres_ctxt.fill_value = 0x0 pdict.add_context(pres_ctxt) temp_ctxt = ParameterContext('temp', param_type=QuantityType(value_encoding=numpy.float32)) temp_ctxt.uom = 'degree_Celsius' temp_ctxt.fill_value = 0e0 pdict.add_context(temp_ctxt) cond_ctxt = ParameterContext('conductivity', param_type=QuantityType(value_encoding=numpy.float32)) cond_ctxt.uom = 'unknown' cond_ctxt.fill_value = 0e0 pdict.add_context(cond_ctxt) raw_fixed_ctxt = ParameterContext('raw_fixed', param_type=QuantityType(value_encoding=numpy.float32)) raw_fixed_ctxt.uom = 'unknown' raw_fixed_ctxt.fill_value = 0e0 pdict.add_context(raw_fixed_ctxt) raw_blob_ctxt = ParameterContext('raw_blob', param_type=QuantityType(value_encoding=numpy.float32)) raw_blob_ctxt.uom = 'unknown' raw_blob_ctxt.fill_value = 0e0 pdict.add_context(raw_blob_ctxt) return pdict
def _merge_contexts(cls, contexts, temporal): pdict = ParameterDictionary() for context in contexts: if context.name == temporal: context.axis = AxisTypeEnum.TIME pdict.add_context(context, is_temporal=True) else: pdict.add_context(context) return pdict