text
stringlengths 0
828
|
|---|
elif version < Version.fromstring(self.class_version):
|
if version < Version(0, 1):
|
self.time = [None]*len(self.data)
|
self.version = str(Version(0, 1))"
|
955,"def c_drop(self, frequency):
|
'''
|
Capacitance of an electrode covered in liquid, normalized per unit
|
area (i.e., units are F/mm^2).
|
'''
|
try:
|
return np.interp(frequency,
|
self._c_drop['frequency'],
|
self._c_drop['capacitance']
|
)
|
except:
|
pass
|
return self._c_drop"
|
956,"def c_filler(self, frequency):
|
'''
|
Capacitance of an electrode covered in filler media (e.g., air or oil),
|
normalized per unit area (i.e., units are F/mm^2).
|
'''
|
try:
|
return np.interp(frequency,
|
self._c_filler['frequency'],
|
self._c_filler['capacitance']
|
)
|
except:
|
pass
|
return self._c_filler"
|
957,"def _upgrade(self):
|
""""""
|
Upgrade the serialized object if necessary.
|
Raises:
|
FutureVersionError: file was written by a future version of the
|
software.
|
""""""
|
logging.debug(""[FeedbackCalibration]._upgrade()"")
|
version = Version.fromstring(self.version)
|
logging.debug('[FeedbackCalibration] version=%s, class_version=%s',
|
str(version), self.class_version)
|
if version > Version.fromstring(self.class_version):
|
logging.debug('[FeedbackCalibration] version>class_version')
|
raise FutureVersionError(Version.fromstring(self.class_version),
|
version)
|
elif version < Version.fromstring(self.class_version):
|
if version < Version(0, 1):
|
self._c_filler = None
|
self._c_drop = None
|
self.version = str(Version(0, 1))
|
if version < Version(0, 2):
|
self.hw_version = Version(1)
|
self.version = str(Version(0, 2))
|
logging.info('[FeedbackCalibration] upgrade to version %s',
|
self.version)
|
if version < Version(0, 2):
|
self.hw_version = Version(1)
|
self.version = str(Version(0, 2))
|
logging.info('[FeedbackCalibration] upgrade to version %s',
|
self.version)
|
if version < Version(0, 3):
|
self.version = str(Version(0, 3))
|
logging.info('[FeedbackCalibration] upgrade to version %s',
|
self.version)"
|
958,"def force_to_voltage(self, force, frequency):
|
'''
|
Convert a force in uN/mm to voltage.
|
Parameters
|
----------
|
force : float
|
Force in **uN/mm**.
|
frequency : float
|
Actuation frequency.
|
Returns
|
-------
|
float
|
Actuation voltage to apply :data:`force` at an actuation frequency
|
of :data:`frequency`.
|
'''
|
c_drop = self.calibration.c_drop(frequency)
|
# if c_filler hasn't been set, assume c_filler = 0
|
if self.calibration._c_filler:
|
c_filler = self.calibration.c_filler(frequency)
|
else:
|
c_filler = 0
|
return np.sqrt(force * 1e-9/ (0.5 * (c_drop - c_filler)))"
|
959,"def series_capacitance(self, channel, resistor_index=None):
|
'''
|
Parameters
|
----------
|
channel : int
|
Analog channel index.
|
resistor_index : int, optional
|
Series resistor channel index.
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.