Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
DetectorWriteSim
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Container registry
Model registry
Analyze
Value stream analytics
Contributor 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
EWMSCP
DetectorWriteSim
Commits
2d990982
Commit
2d990982
authored
1 year ago
by
Michael Reuscher
Browse files
Options
Downloads
Patches
Plain Diff
add arparser to visualizer and remove give methode from simrunner
parent
166d879f
Branches
Branches containing commit
No related tags found
2 merge requests
!4
Python driver and data analysis part
,
!2
Threading fix
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
simrunner/simrunner.py
+6
-8
6 additions, 8 deletions
simrunner/simrunner.py
visualizer/visualizer/main.py
+12
-9
12 additions, 9 deletions
visualizer/visualizer/main.py
with
18 additions
and
17 deletions
simrunner/simrunner.py
+
6
−
8
View file @
2d990982
...
...
@@ -34,7 +34,7 @@ def set_arguments(data_config):
def
run_sim
(
e_list
,
d_path
,
s_path
):
for
event
in
e_list
:
folder_name
=
event
[
-
1
]
relativ_path
=
os
.
path
.
join
(
d_path
,
"
output1
"
,
folder_name
)
relativ_path
=
os
.
path
.
join
(
d_path
,
folder_name
)
os
.
makedirs
(
relativ_path
,
mode
=
0o777
,
exist_ok
=
True
)
event
[
-
1
]
=
relativ_path
arguments
=
event
...
...
@@ -42,18 +42,16 @@ def run_sim(e_list, d_path, s_path):
print
(
output
)
def
give_controller
(
d_path
):
json_path
=
os
.
path
.
join
(
main_folder
,
'
visualizer
'
,
'
data_folder_path.json
'
)
with
open
(
json_path
,
"
w
"
)
as
file
:
json
.
dump
(
d_path
,
file
)
# --- MAIN ---
# Setup all paths an folders
main_folder
=
os
.
path
.
dirname
(
os
.
path
.
dirname
(
os
.
path
.
abspath
(
__file__
)))
data_path
=
os
.
path
.
join
(
main_folder
,
"
output1
"
)
protokoll_path
=
os
.
path
.
join
(
main_folder
,
"
protokoll
"
)
os
.
makedirs
(
protokoll_path
,
mode
=
0o777
,
exist_ok
=
True
)
sim_path
=
os
.
path
.
join
(
os
.
path
.
dirname
(
__file__
),
"
../build/src/detsim
"
)
give_controller
(
data_path
)
# Setup arguments for Sim
event_list
=
set_arguments
(
read_config
())
# Run detectorSimulation
run_sim
(
event_list
,
data_path
,
sim_path
)
This diff is collapsed.
Click to expand it.
visualizer/visualizer/main.py
+
12
−
9
View file @
2d990982
import
os
import
json
import
argparse
import
matplotlib
import
pandas
as
pd
import
seaborn
as
sns
from
.DataFrameCreator
import
DataFrameCreator
from
.SeabornPlotter
import
SeabornPlotter
matplotlib
.
use
(
'
TkAgg
'
)
...
...
@@ -10,15 +7,21 @@ matplotlib.use('TkAgg')
# --------------Main------------
def
main
():
json_path
=
"
data_folder_path.json
"
with
open
(
json_path
,
"
r
"
)
as
file
:
data_folder
=
json
.
load
(
file
)
creator
=
DataFrameCreator
(
data_folder
)
# Parse Arguments
parser
=
argparse
.
ArgumentParser
()
parser
.
add_argument
(
"
-d
"
,
"
--data_path
"
,
required
=
True
,
help
=
"
path to Data from Sim
"
)
args
=
parser
.
parse_args
()
data_path
=
args
.
data_path
# Import Data
creator
=
DataFrameCreator
(
data_path
)
dataframes
=
creator
.
create_dataframes
()
# Setup Plotter
plotter
=
SeabornPlotter
(
dataframes
[
'
write
'
])
# Plot
er
stelle
n
# Plot
t
er
ru
n
plotter
.
plot
()
...
...
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