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
472f98e7
Commit
472f98e7
authored
2 years ago
by
Sai Lakhan Ekal
Browse files
Options
Downloads
Patches
Plain Diff
Debug and improved plotting function to get legend for all plots
parent
e55bc717
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Python_script/prototype.py
+32
-24
32 additions, 24 deletions
Python_script/prototype.py
with
32 additions
and
24 deletions
Python_script/prototype.py
+
32
−
24
View file @
472f98e7
...
@@ -87,10 +87,12 @@ class Measurements:
...
@@ -87,10 +87,12 @@ class Measurements:
self
.
temperature_stable
=
False
self
.
temperature_stable
=
False
self
.
humidity_stable
=
False
self
.
humidity_stable
=
False
self
.
temperature_stable
=
(
next_temp
-
self
.
target_accuracy
[
0
]
<=
float
(
temp
))
and
(
float
(
temp
)
<=
next_temp
+
self
.
target_accuracy
[
0
])
self
.
temperature_stable
=
(
next_temp
-
self
.
target_accuracy
[
0
]
<=
float
(
temp
))
and
\
self
.
humidity_stable
=
(
next_hum
-
self
.
target_accuracy
[
1
]
<=
float
(
hum
))
and
(
float
(
hum
)
<=
next_hum
+
self
.
target_accuracy
[
1
])
(
float
(
temp
)
<=
next_temp
+
self
.
target_accuracy
[
0
])
self
.
humidity_stable
=
(
next_hum
-
self
.
target_accuracy
[
1
]
<=
float
(
hum
))
and
\
(
float
(
hum
)
<=
next_hum
+
self
.
target_accuracy
[
1
])
# The queue must no be longer than the max number of soaking reads.
# The queue must no
t
be longer than the max number of soaking reads.
# If the queue is already full, we have to pop the first element before we can add the
# If the queue is already full, we have to pop the first element before we can add the
# current measurement.
# current measurement.
if
len
(
magnitudes_queue
)
==
number_of_soaking_reads
:
if
len
(
magnitudes_queue
)
==
number_of_soaking_reads
:
...
@@ -126,7 +128,8 @@ class Measurements:
...
@@ -126,7 +128,8 @@ class Measurements:
+
'
| soaking read nr
'
+
str
(
len
(
magnitudes_queue
)))
+
'
| soaking read nr
'
+
str
(
len
(
magnitudes_queue
)))
self
.
data_write
(
writer
,
next_temp
,
next_hum
,
temp
,
hum
,
s11
,
s21
,
s12
,
s22
)
self
.
data_write
(
writer
,
next_temp
,
next_hum
,
temp
,
hum
,
s11
,
s21
,
s12
,
s22
)
if
self
.
temperature_stable
and
self
.
humidity_stable
and
self
.
magnitude_stable
and
self
.
phase_stable
:
if
self
.
temperature_stable
and
self
.
humidity_stable
and
self
.
magnitude_stable
and
\
self
.
phase_stable
:
print
(
'
SOAKING FINISHED!
'
)
print
(
'
SOAKING FINISHED!
'
)
break
break
else
:
else
:
...
@@ -223,17 +226,32 @@ class Measurements:
...
@@ -223,17 +226,32 @@ class Measurements:
data
=
pd
.
read_csv
(
output_file
)
data
=
pd
.
read_csv
(
output_file
)
fig
,
ax1
=
plt
.
subplots
(
2
,
figsize
=
(
8
,
8
))
fig
,
ax1
=
plt
.
subplots
(
2
,
figsize
=
(
8
,
8
))
fig
.
suptitle
(
"
Graphical representation of chamber output
"
,
color
=
"
red
"
)
path_collection01
=
ax1
[
0
].
scatter
(
data
.
TIMESTAMP
,
data
.
S11_PHASE
,
c
=
'
red
'
,
marker
=
'
<
'
,
label
=
'
Phase
'
)
twin2_0
=
ax1
[
0
].
twinx
()
twin2_0
=
ax1
[
0
].
twinx
()
path_collection02
=
twin2_0
.
scatter
(
data
.
TIMESTAMP
,
data
.
S11_MAGNITUDE
,
c
=
'
#3120E0
'
,
marker
=
'
4
'
,
label
=
'
Magnitude
'
)
twin3_0
=
ax1
[
0
].
twinx
()
twin3_0
=
ax1
[
0
].
twinx
()
twin
2_1
=
ax1
[
1
].
twinx
(
)
twin
3_0
.
spines
[
'
right
'
].
set_position
((
'
outward
'
,
40
)
)
twin3_1
=
ax1
[
1
].
twinx
(
)
path_collection03
=
twin3_0
.
scatter
(
data
.
TIMESTAMP
,
data
.
EQUILIBRIUM_INDICATOR
,
c
=
'
black
'
,
marker
=
"
.
"
,
label
=
'
Equilibrium_Indicator
'
)
fig
.
suptitle
(
"
Graphical representation of chamber output
"
,
color
=
"
red
"
)
ax1
[
0
].
set_xlabel
(
"
TIMESTAMP
"
)
ax1
[
0
].
set_ylabel
(
"
PHASE
"
,
color
=
'
red
'
)
twin2_0
.
set_ylabel
(
"
MAGNITUDE
"
,
color
=
'
#3120E0
'
)
twin3_0
.
set_ylabel
(
"
EQUILIBRIUM_INDICATOR
"
,
color
=
'
black
'
)
ax1
[
0
].
grid
(
True
,
linestyle
=
"
:
"
)
all_path_collections
=
[
path_collection01
,
path_collection02
,
path_collection03
]
labels
=
[
pc
.
get_label
()
for
pc
in
all_path_collections
]
ax1
[
0
].
legend
(
all_path_collections
,
labels
,
loc
=
'
lower right
'
)
ax1
[
1
].
scatter
(
data
.
TIMESTAMP
,
data
.
READBACK_TEMPERATURE
,
c
=
'
blue
'
,
marker
=
'
p
'
)
path_collection11
=
ax1
[
1
].
scatter
(
data
.
TIMESTAMP
,
data
.
READBACK_TEMPERATURE
,
c
=
'
blue
'
,
marker
=
'
p
'
,
label
=
"
Temperature
"
)
twin2_1
.
scatter
(
data
.
TIMESTAMP
,
data
.
READBACK_HUMIDITY
,
c
=
'
green
'
,
marker
=
"
*
"
)
twin2_1
=
ax1
[
1
].
twinx
()
path_collection12
=
twin2_1
.
scatter
(
data
.
TIMESTAMP
,
data
.
READBACK_HUMIDITY
,
c
=
'
green
'
,
marker
=
"
*
"
,
label
=
"
Humidity
"
)
twin3_1
=
ax1
[
1
].
twinx
()
twin3_1
.
spines
[
'
right
'
].
set_position
((
'
outward
'
,
40
))
twin3_1
.
spines
[
'
right
'
].
set_position
((
'
outward
'
,
40
))
twin3_1
.
scatter
(
data
.
TIMESTAMP
,
data
.
EQUILIBRIUM_INDICATOR
,
c
=
'
black
'
,
marker
=
"
.
"
)
path_collection13
=
twin3_1
.
scatter
(
data
.
TIMESTAMP
,
data
.
EQUILIBRIUM_INDICATOR
,
c
=
'
black
'
,
marker
=
"
.
"
,
label
=
"
Equilibrium_Indicator
"
)
ax1
[
1
].
set_xlabel
(
"
TIMESTAMP
"
)
ax1
[
1
].
set_xlabel
(
"
TIMESTAMP
"
)
ax1
[
1
].
set_ylabel
(
"
TEMPERATURE
"
,
color
=
'
blue
'
)
ax1
[
1
].
set_ylabel
(
"
TEMPERATURE
"
,
color
=
'
blue
'
)
...
@@ -241,23 +259,13 @@ class Measurements:
...
@@ -241,23 +259,13 @@ class Measurements:
twin3_1
.
set_ylabel
(
"
EQUILIBRIUM_INDICATOR
"
,
color
=
'
black
'
)
twin3_1
.
set_ylabel
(
"
EQUILIBRIUM_INDICATOR
"
,
color
=
'
black
'
)
ax1
[
1
].
grid
(
True
,
linestyle
=
"
:
"
)
ax1
[
1
].
grid
(
True
,
linestyle
=
"
:
"
)
ax1
[
1
].
legend
([
"
Temperature
"
,
"
Humidity
"
,
'
Equilibrium_indicator
'
],
loc
=
6
,
fontsize
=
10
)
all_path_collections
=
[
path_collection11
,
path_collection12
,
path_collection13
]
labels
=
[
pc
.
get_label
()
for
pc
in
all_path_collections
]
ax1
[
0
].
scatter
(
data
.
TIMESTAMP
,
data
.
S11_PHASE
,
c
=
'
red
'
,
marker
=
'
<
'
)
ax1
[
1
].
legend
(
all_path_collections
,
labels
,
loc
=
'
lower right
'
)
twin2_0
.
scatter
(
data
.
TIMESTAMP
,
data
.
S11_MAGNITUDE
,
c
=
'
#3120E0
'
,
marker
=
'
4
'
)
twin3_0
.
spines
[
'
right
'
].
set_position
((
'
outward
'
,
40
))
twin3_0
.
scatter
(
data
.
TIMESTAMP
,
data
.
EQUILIBRIUM_INDICATOR
,
c
=
'
black
'
,
marker
=
"
.
"
)
ax1
[
0
].
set_xlabel
(
"
TIMESTAMP
"
)
ax1
[
0
].
set_ylabel
(
"
PHASE
"
,
color
=
'
red
'
)
twin2_0
.
set_ylabel
(
"
MAGNITUDE
"
,
color
=
'
#3120E0
'
)
twin3_0
.
set_ylabel
(
"
EQUILIBRIUM_INDICATOR
"
,
color
=
'
black
'
)
ax1
[
0
].
grid
(
True
,
linestyle
=
"
:
"
)
ax1
[
0
].
legend
([
"
Phase
"
,
"
Magnitude
"
,
'
Equilibrium_indicator
'
],
loc
=
6
,
fontsize
=
10
)
plt
.
show
()
plt
.
show
()
if
__name__
==
'
__main__
'
:
if
__name__
==
'
__main__
'
:
parser
=
ArgumentParser
()
parser
=
ArgumentParser
()
parser
.
add_argument
(
"
-c
"
,
"
--chamber
"
,
parser
.
add_argument
(
"
-c
"
,
"
--chamber
"
,
...
...
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