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
71119df0
Commit
71119df0
authored
2 years ago
by
Martin Killenberg
Browse files
Options
Downloads
Patches
Plain Diff
improve plot headers
parent
f1c05b60
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
+13
-6
13 additions, 6 deletions
Python_script/prototype.py
with
13 additions
and
6 deletions
Python_script/prototype.py
+
13
−
6
View file @
71119df0
...
...
@@ -75,6 +75,8 @@ class Measurements:
next_soaking
=
int
(
list_of_values
[
2
])
# soaking_time
next_reads
=
int
(
list_of_values
[
3
])
# number of stable readings
self
.
measurement_plot
.
fig
.
suptitle
(
"
Measurement
"
+
str
(
measurement_number
)
+
'
:
'
+
str
(
next_temp
)
+
'
degC,
'
+
str
(
next_hum
)
+
'
rel. hum.
'
,
color
=
"
red
"
)
self
.
perform_single_measurement
(
self
.
output_basename
+
'
_
'
+
str
(
measurement_number
)
+
'
.csv
'
,
next_temp
,
next_hum
,
next_soaking
,
next_reads
)
measurement_number
+=
1
...
...
@@ -84,12 +86,12 @@ class Measurements:
plt
.
close
()
return
measurement_number
if
self
.
standby
:
standby_response
=
self
.
chamber
.
set_mode
(
'
STANDBY
'
)
print
(
standby_response
)
return
measurement_number
def
perform_temperature_sweep
(
self
,
start_temp
,
stop_temp
,
temp_step
,
target_hum
,
soaking_time
,
n_stable_reads
):
current_temp
=
start_temp
temperatures
=
[]
...
...
@@ -100,8 +102,12 @@ class Measurements:
for
temp
in
temperatures
:
output_name
=
self
.
output_basename
+
'
_
'
+
str
(
temp
)
+
'
deg.csv
'
self
.
measurement_plot
.
fig
.
suptitle
(
"
Temp. sweep measurement
"
+
str
(
temperatures
.
index
(
temp
)
+
1
)
+
'
/
'
+
str
(
len
(
temperatures
))
+
'
:
'
+
str
(
temp
)
+
'
degC,
'
+
str
(
target_hum
)
+
'
rel. hum.
'
,
color
=
"
red
"
)
self
.
perform_single_measurement
(
output_name
,
temp
,
target_hum
,
soaking_time
,
n_stable_reads
)
plt
.
close
()
return
temperatures
def
perform_single_measurement
(
self
,
output
,
target_temp
,
target_hum
,
soaking_time
,
n_stable_reads
):
...
...
@@ -320,7 +326,7 @@ class Measurements:
return
(
target_hum
-
self
.
max_delta_hum
<=
float
(
readback_hum
))
and
\
(
float
(
readback_hum
)
<=
target_hum
+
self
.
max_delta_hum
)
def
plot_output
(
output_basename
,
measurements_appendices
,
show_blocking_plot
):
def
plot_output
(
output_basename
,
measurements_appendices
,
show_blocking_plot
,
title
=
''
):
list_of_frames
=
[]
for
m
in
measurements_appendices
:
measurement_name
=
output_basename
+
'
_
'
+
str
(
m
)
...
...
@@ -329,7 +335,7 @@ def plot_output(output_basename, measurements_appendices, show_blocking_plot):
combined_data_frame
=
pd
.
concat
(
list_of_frames
,
ignore_index
=
True
,
sort
=
False
)
if
show_blocking_plot
:
plt
.
ioff
()
plot
=
MeasurementPlot
.
MeasurementPlot
()
plot
=
MeasurementPlot
.
MeasurementPlot
(
title
)
plot
.
draw
(
combined_data_frame
,
output_basename
+
'
_graph.pdf
'
)
def
run_temperature_sweep_from_file
(
temperature_sweep_file
,
meas
):
...
...
@@ -397,14 +403,15 @@ if __name__ == '__main__':
try
:
if
args
.
file
:
n_measurements
=
mes
.
perform_measurements
(
args
.
file
)
plot_output
(
output_basename
,
range
(
n_measurements
),
args
.
plot
)
plot_output
(
output_basename
,
range
(
n_measurements
),
args
.
plot
,
output_basename
)
if
args
.
temperaturesweepfile
:
temperatures
=
run_temperature_sweep_from_file
(
args
.
temperaturesweepfile
,
mes
)
#run analysis here
temp_extensions
=
[]
for
t
in
temperatures
:
temp_extensions
.
append
(
str
(
t
)
+
'
deg
'
)
plot_output
(
output_basename
,
temp_extensions
,
args
.
plot
)
plot_output
(
output_basename
,
temp_extensions
,
args
.
plot
,
output_basename
+
'
: Temperature sweep
'
+
str
(
temperatures
[
0
])
+
'
degC to
'
+
str
(
temperatures
[
-
1
])
+
'
degC
'
)
print
(
str
(
temp_extensions
))
finally
:
mes
.
chamber
.
close
()
...
...
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