Skip to content
Snippets Groups Projects
Commit 7e079b60 authored by Sai Lakhan Ekal's avatar Sai Lakhan Ekal
Browse files

- fix writing to file for each stable read

- sleep 1 second between reads of the chamber
parent 573fbf06
No related branches found
No related tags found
No related merge requests found
25.0 35.0 10 10
\ No newline at end of file
35.0 40.0 1 10
......@@ -100,6 +100,7 @@ class Measurements:
'S22 PHASE': self.calculate_mean_phase(s22),
'S22 MAGNITUDE': self.calculate_mean_magnitude(s22)
})
time.sleep(1.)
for i in range(0, next_reads):
[temp, hum, mode, alarms] = self.chamber.read_monitor().split(',')
......@@ -108,24 +109,25 @@ class Measurements:
s12 = self.get_trace_data("Trace3")
s22 = self.get_trace_data("Trace4")
print('Read no.', i, ': ', temp, hum, mode, alarms)
writer.writerow({
'TIMESTAMP': int(time.time()),
'TARGET TEMPERATURE': next_temp,
'READBACK TEMPERATURE': temp,
'TARGET HUMIDITY': next_hum,
'READBACK HUMIDITY': hum,
'RF POWER': self.vna.get_current_power(),
'RF FREQUENCY': self.vna.get_current_cw_frequency(),
'EQUILIBRIUM INDICATOR': self.equi_indicator(),
'S11 PHASE': self.calculate_mean_phase(s11),
'S11 MAGNITUDE': self.calculate_mean_magnitude(s11),
'S21 PHASE': self.calculate_mean_phase(s21),
'S21 MAGNITUDE': self.calculate_mean_magnitude(s21),
'S12 PHASE': self.calculate_mean_phase(s12),
'S12 MAGNITUDE': self.calculate_mean_magnitude(s12),
'S22 PHASE': self.calculate_mean_phase(s22),
'S22 MAGNITUDE': self.calculate_mean_magnitude(s22)
})
writer.writerow({
'TIMESTAMP': int(time.time()),
'TARGET TEMPERATURE': next_temp,
'READBACK TEMPERATURE': temp,
'TARGET HUMIDITY': next_hum,
'READBACK HUMIDITY': hum,
'RF POWER': self.vna.get_current_power(),
'RF FREQUENCY': self.vna.get_current_cw_frequency(),
'EQUILIBRIUM INDICATOR': self.equi_indicator(),
'S11 PHASE': self.calculate_mean_phase(s11),
'S11 MAGNITUDE': self.calculate_mean_magnitude(s11),
'S21 PHASE': self.calculate_mean_phase(s21),
'S21 MAGNITUDE': self.calculate_mean_magnitude(s21),
'S12 PHASE': self.calculate_mean_phase(s12),
'S12 MAGNITUDE': self.calculate_mean_magnitude(s12),
'S22 PHASE': self.calculate_mean_phase(s22),
'S22 MAGNITUDE': self.calculate_mean_magnitude(s22)
})
time.sleep(1.)
except KeyboardInterrupt:
pass
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment