Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
Climate Lab Test Stand
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
MSK-SW
Low-Level Radio Frequency
Climate Lab
Climate Lab Test Stand
Commits
75efdfac
Commit
75efdfac
authored
2 years ago
by
Martin Killenberg
Browse files
Options
Downloads
Patches
Plain Diff
update online plot while taking stable measurementes
parent
b6b6a348
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Python_script/prototype.py
+11
-9
11 additions, 9 deletions
Python_script/prototype.py
with
11 additions
and
9 deletions
Python_script/prototype.py
+
11
−
9
View file @
75efdfac
...
...
@@ -138,7 +138,8 @@ class Measurements:
print
(
'
Setpoint:
'
+
str
(
next_temp
)
+
'
'
+
str
(
next_hum
)
+
'
| Temp:
'
+
data
.
temp
+
'
°C
'
+
'
| Humid:
'
+
data
.
hum
+
'
%
'
+
'
| soaking read nr
'
+
str
(
len
(
magnitudes_queue
)))
self
.
write_data
(
writer
,
next_temp
,
next_hum
,
data
,
self
.
cook_up_equi_indicator
())
self
.
store_and_plot_data
(
next_temp
,
next_hum
,
data
,
self
.
cook_up_equi_indicator
())
writer
.
writerow
(
self
.
data_collection
[
-
1
])
if
self
.
temperature_stable
and
self
.
humidity_stable
and
self
.
magnitude_stable
and
\
self
.
phase_stable
:
...
...
@@ -164,7 +165,8 @@ class Measurements:
self
.
phase_stable
=
(
reference_phase
-
self
.
max_delta_phase
<=
phase
)
and
\
(
phase
<=
reference_phase
+
self
.
max_delta_phase
)
supposedly_stable_measurements
.
append
([
data
,
self
.
cook_up_equi_indicator
()])
self
.
store_and_plot_data
(
next_temp
,
next_hum
,
data
,
self
.
cook_up_equi_indicator
())
supposedly_stable_measurements
.
append
(
self
.
data_collection
[
-
1
])
if
(
self
.
temperature_stable
and
self
.
humidity_stable
and
self
.
magnitude_stable
and
self
.
phase_stable
):
...
...
@@ -175,13 +177,14 @@ class Measurements:
print
(
'
Measurement not stable. Retrying.
'
)
break
for
[
d
,
measurement
_equi
]
in
supposedly_stable_measurements
:
for
measurement
in
supposedly_stable_measurements
:
if
all_measurements_stable
:
equi
=
TEMPERATURE_STABLE
|
HUMIDITY_STABLE
|
MAGNITUDE_STABLE
|
PHASE_STABLE
|
MEASUREMENT_STABLE
measurement
[
'
EQUILIBRIUM_INDICATOR
'
]
=
TEMPERATURE_STABLE
|
HUMIDITY_STABLE
|
\
MAGNITUDE_STABLE
|
PHASE_STABLE
|
\
MEASUREMENT_STABLE
do_another_measurement
=
False
else
:
equi
=
measurement_equi
self
.
write_data
(
writer
,
next_temp
,
next_hum
,
d
,
equi
)
writer
.
writerow
(
measurement
)
except
KeyboardInterrupt
:
pass
...
...
@@ -202,7 +205,7 @@ class Measurements:
return
MeasurementData
(
int
(
self
.
clock
.
time
()),
temp
,
hum
,
power
,
frequency
,
s11
,
s21
,
s12
,
s22
)
def
write
_data
(
self
,
writer
,
target_temp
,
target_hum
,
data
,
equi_indicator
):
def
store_and_plot
_data
(
self
,
target_temp
,
target_hum
,
data
,
equi_indicator
):
measurement
=
{
'
TIMESTAMP
'
:
data
.
timestamp
,
'
TARGET_TEMPERATURE
'
:
target_temp
,
...
...
@@ -221,7 +224,6 @@ class Measurements:
'
S22_PHASE
'
:
self
.
calculate_mean_phase
(
data
.
s22
),
'
S22_MAGNITUDE
'
:
self
.
calculate_mean_magnitude
(
data
.
s22
)
}
writer
.
writerow
(
measurement
)
self
.
data_collection
.
append
(
measurement
)
data_frame
=
pd
.
DataFrame
(
self
.
data_collection
)
self
.
measurement_plot
.
draw
(
data_frame
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment