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
f9c5de83
Commit
f9c5de83
authored
2 years ago
by
Martin Killenberg
Browse files
Options
Downloads
Patches
Plain Diff
make plotting option a command line argument
parent
d0dd7ead
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
+8
-9
8 additions, 9 deletions
Python_script/prototype.py
with
8 additions
and
9 deletions
Python_script/prototype.py
+
8
−
9
View file @
f9c5de83
...
...
@@ -268,7 +268,7 @@ class Measurements:
return
equilibrium_indicator
def
plot_output
(
self
,
output_file
):
def
plot_output
(
self
,
output_file
,
show_plot_window
):
csv_data
=
pd
.
read_csv
(
output_file
)
fig
,
ax1
=
plt
.
subplots
(
2
,
figsize
=
(
12
,
10
))
fig
.
suptitle
(
"
Graphical representation of chamber output
"
,
color
=
"
red
"
)
...
...
@@ -310,7 +310,9 @@ class Measurements:
ax1
[
1
].
legend
(
all_path_collections
,
labels
,
loc
=
'
lower right
'
)
fig
.
savefig
(
time
.
strftime
(
"
%Y_%m_%d-%H_%M_%S
"
)
+
'
graph.pdf
'
)
plt
.
show
()
if
show_plot_window
:
plt
.
show
()
def
calculate_temperature_stability
(
self
,
target_temp
,
readback_temp
):
return
(
target_temp
-
self
.
max_delta_temp
<=
float
(
readback_temp
))
and
\
...
...
@@ -337,6 +339,9 @@ if __name__ == '__main__':
parser
.
add_argument
(
"
-s
"
,
"
--standby
"
,
action
=
"
store_true
"
,
default
=
False
,
help
=
"
Change Chamber mode to standby at the end
"
)
parser
.
add_argument
(
"
-p
"
,
"
--plot
"
,
action
=
"
store_true
"
,
default
=
False
,
help
=
"
Show plot window at the end
"
)
# parser.add_argument("-q", "--quiet",
# action="store_false", dest="verbose", default=True,
...
...
@@ -354,17 +359,11 @@ if __name__ == '__main__':
with
open
(
'
test_stand_parameter.json
'
,
'
r
'
)
as
f
:
config_data
=
json
.
load
(
f
)
# Move this to inside the chamber. But just putting it into perform_measurements is not good at the moment.
# That function needs refactoring first.
mes
=
Measurements
(
args
.
chamber
,
args
.
vna
,
args
.
file
,
output
,
args
.
standby
,
config_data
)
try
:
mes
.
perform_measurements
()
plot_graph
=
input
(
'
want to plot a graph? ans[Yes/no]?
'
).
lower
()
if
plot_graph
==
"
yes
"
:
mes
.
plot_output
(
output
)
else
:
print
(
"
graph is stored with output file
"
)
mes
.
plot_output
(
output
,
args
.
plot
)
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