Пример #1
0
	def set(self, excludeMethodInstance, index=None):
		'''add or change an exclude-instance in the container'''
		if index==None:
			self.appendExcludeMethod(excludeMethodInstance)
		else:
			_utils.checkModuleInstance(excludeMethodInstance,excludeMethods)
			self._list[int(index)] = excludeMethodInstance
Пример #2
0
	def set(self, calcMethodInstance, index=None):
		'''ad or change the calc-instance at a given index'''
		if index==None:
			self.appendCalcMethod(calcMethodInstance)
		else:
			_utils.checkModuleInstance(calcMethodInstance,calcMethods)
			self._list[int(index)] = calcMethodInstance
Пример #3
0
	def append(self, transformMethodInstance, adhoc=False):
		'''
		*adhoc*: transform each value right in the readout
		else the talues can be transformed via :func:`diaGrabber.target._matrixMethods.matrixMethods.transformDim`
		'''
		_utils.checkModuleInstance(transformMethodInstance,transformMethods)
		self.adhoc.append(bool(adhoc))
		self._list.append(transformMethodInstance)
Пример #4
0
	def setArgs(self, **kwargs):
		'''
		**Required kwargs** ("keyword arguments") are:

		==================     ===========  ==============   ============================
		Keyword	               Type         Example          Description
		==================     ===========  ==============   ============================
		*name*                 str          "one"            the name of the basisDimension
		*unit*                 str          "m/s"            the unit of the basisDimension
		*index*                int          0                the position in the source-file
		                                                     '0' will be the first one
		                       str          "counter"        see :py:meth:`setCounter`
		                                                     (with update=True)
		                                    "fixedCounter"   see :py:meth:`setCounter`
		                                                     (with update=False)
		==================     ===========  ==============   ============================

		**Optional kwargs** ("keyword arguments") are:

		==================     ===========  =============    ============================
		Keyword	               Type         Default          Description
		==================     ===========  =============    ============================
		*prefix*               float/str    1                the prefix of the
		                                                     unit. can be a float
		                                                     or a string like 'm' for milli
		                                                     see :py:func:`_evalPrefix` for all
		                                                     possibilities
		*merge*                instance     merge.last()     see                          :mod:`diaGrabber.source.methods.merge` for all possible options
		==================     ===========  =============    ============================
		'''
		prefix = None
		for key in kwargs:
			if key == "name":
				self.name = str(kwargs[key])
			elif key == "unit":
				self.unit = str(kwargs[key])
			elif key == "prefix":
				prefix = kwargs[key]
			elif key == "index":
				if type(kwargs[key]) != int:
					if kwargs[key] == "runningCounter" or kwargs[key] == "counter":
						self.setCounter(update=True)
						self.index = 0
					elif index == "fixedCounter":
						self.setCounter(update=False)
						self.index = 0
					else:
						sys.exit("ERROR: index has to be an iteger or 'runningCounter' or 'fixedCounter'")
				else:
					self.index = int(kwargs[key])
			elif key == "merge":
				_utils.checkModuleInstance(kwargs[key], mergeMethods)
				self._mergeMethod = kwargs[key]
			else:
				raise KeyError("keyword '%s' not known" %key)
		#after main loop to ensure that unit is set
		if prefix != None:
			self._evalPrefix(prefix)
Пример #5
0
	def __init__(self, sourceClassList):
		###SOURCECLASS-HANDLING
		self.sourceClassList = sourceClassList
			#if only one list is given or lists are given in tuple: formal as list
		if type(self.sourceClassList) != list:
			if type(self.sourceClassList) == tuple:
				self.sourceClassList = list(self.sourceClassList)
			else:
				self.sourceClassList = [self.sourceClassList]
			#check whether all entries in sourceClassList belongs to the module 'source'
		for sourceClass in self.sourceClassList:
			_utils.checkModuleInstance(sourceClass, source)

		self._fitBasisDims()
		self._combineMergeDims()

		self.mergeNames = []
		for i in self._merge_dim:
			self.mergeNames.append(i.name)
		self.basisNames = []
		for i in self._basis_dim:
			self.basisNames.append(i.name)
		self._setPlotOverlay()
Пример #6
0
	def append(self, excludeMethodInstance):
		'''add a new exclude-condition to the container. need a instance of :mod:`diaGrabber.source.methods.exclude` for this.'''
		_utils.checkModuleInstance(excludeMethodInstance,excludeMethods)
		self._list.append(excludeMethodInstance)
Пример #7
0
	def append(self, calcMethodInstance):
		'''add a new calc-procedure to the container, need a instance of :mod:`diaGrabber.source.methods.calc` for this.'''
		_utils.checkModuleInstance(calcMethodInstance,calcMethods)
		self._list.append(calcMethodInstance)