Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
CTA-LAPP
RTA
HiPeRTA_Stream
Commits
4cdba28d
Commit
4cdba28d
authored
Mar 16, 2021
by
Pierre Aubert
Browse files
Add plotter for R0 gain and pedestal info
parent
13ef6338
Pipeline
#109649
canceled with stage
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
71 additions
and
1 deletion
+71
-1
hiperta_stream/stream_plot_dl1.py
hiperta_stream/stream_plot_dl1.py
+1
-0
hiperta_stream/stream_plot_r0_calib.py
hiperta_stream/stream_plot_r0_calib.py
+68
-0
setup.py
setup.py
+2
-1
No files found.
hiperta_stream/stream_plot_dl1.py
View file @
4cdba28d
...
...
@@ -27,6 +27,7 @@ def plotCalibEvent(pdf, tabImage, varName, nbbin):
plt
.
ylabel
(
"nb"
)
plt
.
yscale
(
"log"
)
plt
.
grid
()
plt
.
text
(
0.05
,
0.95
,
strValue
,
transform
=
fig
.
transFigure
,
size
=
14
)
pdf
.
savefig
()
# saves the current figure into a pdf page
plt
.
close
()
except
KeyError
:
...
...
hiperta_stream/stream_plot_r0_calib.py
0 → 100644
View file @
4cdba28d
"""
Author : Pierre Aubert
Mail : aubertp7@gmail.com
Licence : CeCILL-C
"""
import
os
import
tables
import
argparse
import
matplotlib.pyplot
as
plt
from
matplotlib.backends.backend_pdf
import
PdfPages
def
plotTable
(
pdf
,
tabValue
,
varName
,
nbbin
):
fig
=
plt
.
figure
(
figsize
=
(
16
,
10
))
strValue
=
varName
+
", size = "
+
str
(
tabValue
.
size
)
+
", Min : "
+
str
(
tabValue
.
min
())
+
", max : "
+
str
(
tabValue
.
max
())
+
", mean : "
+
str
(
tabValue
.
mean
())
+
", std : "
+
str
(
tabValue
.
std
())
print
(
strValue
)
plt
.
hist
(
tabValue
,
bins
=
nbbin
,
alpha
=
1.0
)
plt
.
xlabel
(
varName
)
plt
.
title
(
"Signal "
+
varName
)
plt
.
ylabel
(
"nb"
)
plt
.
yscale
(
"log"
)
plt
.
grid
()
plt
.
text
(
0.05
,
0.95
,
strValue
,
transform
=
fig
.
transFigure
,
size
=
14
)
pdf
.
savefig
()
# saves the current figure into a pdf page
plt
.
close
()
def
processAllFile
(
outputPlotFile
,
inputFile
,
nbBin
):
'''
List of the input files
Parameters:
outputPlotFile : name of the output plot
inputFile : input file
nbBin : number of bins of the plot
'''
hfile
=
tables
.
open_file
(
inputFile
,
mode
=
"r"
)
tabGain
=
hfile
.
root
.
r0
.
monitoring
.
telescope
.
gain
.
tel_001
.
read
()
tabPed
=
hfile
.
root
.
r0
.
monitoring
.
telescope
.
pedestal
.
tel_001
.
col
(
"pedestal"
)[
0
]
with
PdfPages
(
outputPlotFile
)
as
pdf
:
plotTable
(
pdf
,
tabGain
[
0
],
"high gain"
,
nbBin
)
plotTable
(
pdf
,
tabGain
[
1
],
"low gain"
,
nbBin
)
plotTable
(
pdf
,
tabPed
[
0
],
"high pedestal"
,
nbBin
)
plotTable
(
pdf
,
tabPed
[
1
],
"low pedestal"
,
nbBin
)
def
main
():
parser
=
argparse
.
ArgumentParser
()
parser
.
add_argument
(
'-i'
,
'--input'
,
type
=
str
,
dest
=
'input_file'
,
help
=
"input HDF5 DL1 file"
,
required
=
True
)
parser
.
add_argument
(
'-o'
,
'--output'
,
type
=
str
,
dest
=
'output'
,
help
=
"output DL1 plot"
,
default
=
'output_dl1_plot.pdf'
)
parser
.
add_argument
(
'-b'
,
'--nbbin'
,
type
=
int
,
dest
=
'nb_bin'
,
help
=
"number of bins of the plot"
,
default
=
100
)
args
=
parser
.
parse_args
()
processAllFile
(
args
.
output
,
args
.
input_file
,
args
.
nb_bin
)
if
__name__
==
'__main__'
:
main
()
setup.py
View file @
4cdba28d
...
...
@@ -9,7 +9,8 @@ entry_points = {
'stream_get_zfits_pix_order = hiperta_stream.get_zfits_pixel_order:main'
,
'stream_create_base_config = hiperta_stream.create_base_hdf5_config_structure_for_hiperta_stream:main'
,
'stream_log_summary = hiperta_stream.create_log_summary:main'
,
'stream_plot_dl1 = hiperta_stream.stream_plot_dl1:main'
'stream_plot_dl1 = hiperta_stream.stream_plot_dl1:main'
,
'stream_plot_r0_calib = hiperta_stream.stream_plot_r0_calib:main'
]}
setup
(
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment