text
stringlengths
0
828
self.version = str(Version(0, 2))
self.fb_resistor[self.V_fb > 5] = -1
self.hv_resistor[self.V_hv > 5] = -1
if version < Version(0, 3):
self.attempt = 0
if version < Version(0, 4):
del self.sampling_time_ms
del self.delay_between_samples_ms
self.voltage = self.options.voltage
del self.options
del self.attempt
if version < Version(0, 5):
self.area = 0
self.version = str(Version(0, 5))
if version < Version(0, 6):
self.amplifier_gain = None
self.vgnd_hv = None
self.vgnd_fb = None
self.version = str(Version(0, 6))
logging.info('[FeedbackResults] upgrade to version %s' %
self.version)
else:
# Else the versions are equal and don't need to be upgraded.
pass"
946,"def V_total(self):
'''
Compute the input voltage (i.e., ``V1``) based on the measured
high-voltage feedback values for ``V2``, using the high-voltage
transfer function.
See also
--------
:meth:`V_actuation` for diagram with ``V1`` and ``V2`` labelled.
'''
ind = mlab.find(self.hv_resistor >= 0)
V1 = np.empty(self.hv_resistor.shape)
V1.fill(np.nan)
V1[ind] = compute_from_transfer_function(self.calibration.hw_version
.major, 'V1',
V2=self.V_hv[ind], R1=10e6,
R2=self.calibration.R_hv
[self.hv_resistor[ind]],
C2=self.calibration.C_hv
[self.hv_resistor[ind]],
f=self.frequency)
# convert to masked array
V1 = np.ma.masked_invalid(pd.Series(V1, pd.to_datetime(self.time, unit='s')
).interpolate(method='time').values)
V1.fill_value = np.nan
V1.data[V1.mask] = V1.fill_value
return V1"
947,"def V_actuation(self):
'''
Return the voltage drop across the device (i.e., the ``Z1`` load) for
each feedback measurement.
Consider the feedback circuit diagrams below for the feedback
measurement circuits of the two the control board hardware versions.
.. code-block:: none
# Hardware V1 # # Hardware V2 #
V_1 @ frequency V_1 @ frequency
┬ β”― β”―
β”‚ β”Œβ”€β”΄β”€β” β”Œβ”€β”΄β”€β” β”Œβ”€β”€β”€β”
V_actuation β”‚ β”‚Z_1β”‚ β”‚Z_1β”‚ β”Œβ”€β”€Z_2β”œβ”€β”
β”‚ β””β”€β”¬β”€β”˜ β””β”€β”¬β”€β”˜ β”‚ β””β”€β”€β”€β”˜ β”‚
β”΄ β”œβ”€β”€β”€O V_2 β”‚ β”‚ β”‚\ β”œβ”€β”€β”€O V_2
β”Œβ”€β”΄β”€β” └────┴──│-\__β”‚
β”‚Z_2β”‚ β”Œβ”€β”€β”‚+/
β””β”€β”¬β”€β”˜ β”‚ β”‚/
═╧═ β”‚
Β― ═╧═
Β―
Note that in the case of **hardware version 1**, the input voltage
``V1`` is divided across ``Z1`` *and* the feedback measurement load
``Z2``. Therefore, the effective *actuation* voltage across the DMF
device is less than ``V1``. Specifically, the effective *actuation*
voltage is ``V1 - V2``.
In **hardware version 2**, since the positive terminal of the op-amp is
attached to *(virtual)* ground, the negative op-amp terminal is also at
ground potential. It follows that the actuation voltage is equal to
``V1`` on **hardware version 2**.
'''
if self.calibration.hw_version.major == 1:
return self.V_total() - np.array(self.V_fb)
else:
return self.V_total()"
948,"def Z_device(self, filter_order=None, window_size=None, tol=0.05):
'''
Compute the impedance *(including resistive and capacitive load)* of
the DMF device *(i.e., dielectric and droplet)*.
See :func:`calibrate.compute_from_transfer_function`
for details.
'''
ind = mlab.find(self.fb_resistor >= 0)