Commit c9f66a56 authored by Guillaume Blanchy's avatar Guillaume Blanchy
Browse files

Implement injection_id

No related merge requests found
Showing with 13 additions and 4 deletions
+13 -4
......@@ -5,3 +5,4 @@ v2024.1.0
- Rename headers (#239)
- Rename strategies: "constant" -> "safe", "full_constant" -> "fixed" (#216)
- Remove tx_volt and vab from run_measurement()
- Add 'battery_voltage_tx' column for adjustable voltage.
......@@ -8,10 +8,9 @@ k = OhmPi()
# Update settings if needed
k.update_settings({"injection_duration": 1.})
k.update_settings({"strategy": "vmin"})
k.update_settings({"vab_init": 5.})
k.update_settings({"vab_req": 5.})
k.update_settings({"vmn_req": 1.})
k.update_settings({"nb_stack":1})
k.update_settings({"n_stacks":1})
# Set or load sequence
k.sequence = np.array([[1+i,4+i,2+i,3+i] for i in range(13)]) # set numpy array of shape (n,4)
......
......@@ -17,7 +17,7 @@ settings = {
'injection_duration': 0.2,
'nbr_meas': 1,
'sequence_delay': 1,
'nb_stack': 1,
'n_stacks': 1,
'export_path': 'data/measurement.csv'
}
......
......@@ -929,7 +929,15 @@ class OhmPi(object):
#print('\nTX: {:.3f}, V at Iab: {:.3f}'.format(self._hw.tx.gain, I*2*50))
#print('Rx: {:.3f}, V at Vmn: {:.3f}'.format(self._hw.rx.gain, Vmn*self._hw.rx._dg411_gain)
# battery voltage
if self._hw.tx.pwr.voltage_adjustable:
# read stored value as requesting it each time takes time
battv = self._hw.tx.pwr._battery_voltage
else:
battv = np.nan
# increment injection_id
self.injection_id += 1
d = {
"time": datetime.now().isoformat(),
......@@ -950,7 +958,7 @@ class OhmPi(object):
"vab_[V]": vab,
"channel_mn": 0,
"injection_id": self.injection_id,
"battery_voltage_tx_[V]": 0,
"battery_voltage_tx_[V]": battv,
#"CPU temp [degC]": self._hw.ctl.cpu_temperature,
"s_samples": len(self._hw.readings[x, 2]), # TODO: use only samples after a delay in each pulse
"strategy": strategy,
......@@ -1104,6 +1112,7 @@ class OhmPi(object):
n = 1
else:
n = self.sequence.shape[0]
self.injection_id = 0 # reset injection_id
for i in tqdm(range(0, n), "Sequence progress", unit='injection', ncols=100, colour='green'):
if self.sequence is None:
quad = np.array([0, 0, 0, 0])
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment