Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
KM3io.jl
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Terraform modules
Monitor
Incidents
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
common
KM3io.jl
Commits
6bebc936
Verified
Commit
6bebc936
authored
5 months ago
by
Tamas Gal
Browse files
Options
Downloads
Patches
Plain Diff
Update docs
parent
82fbe177
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
docs/make.jl
+1
-0
1 addition, 0 deletions
docs/make.jl
docs/src/api.md
+2
-0
2 additions, 0 deletions
docs/src/api.md
docs/src/manual/auxfiles.md
+39
-0
39 additions, 0 deletions
docs/src/manual/auxfiles.md
src/exports.jl
+1
-0
1 addition, 0 deletions
src/exports.jl
src/hardware.jl
+20
-1
20 additions, 1 deletion
src/hardware.jl
with
63 additions
and
1 deletion
docs/make.jl
+
1
−
0
View file @
6bebc936
...
...
@@ -18,6 +18,7 @@ makedocs(;
"manual/rootfiles.md"
,
"manual/detector.md"
,
"manual/calibration.md"
,
"manual/auxfiles.md"
,
"manual/tools.md"
,
],
"Examples"
=>
Any
[
...
...
This diff is collapsed.
Click to expand it.
docs/src/api.md
+
2
−
0
View file @
6bebc936
...
...
@@ -53,6 +53,8 @@ flush
PMT
DetectorModule
Detector
PMTFile
PMTData
modules
getmodule
getpmt
...
...
This diff is collapsed.
Click to expand it.
docs/src/manual/auxfiles.md
0 → 100644
+
39
−
0
View file @
6bebc936
# Auxiliary Files
There are a bunch of auxiliary file formats in KM3NeT which are used in
different stages of processing and calibration procedures.
`KM3io.jl`
supports many of them by defining a container type and extending the
`Base.read`
function so that the general pattern is:
```
f = read("path/to/the.file", FileContainerType)
```
## PMT File
The container type
[
`PMTFile`
](
@ref
)
is used to load PMT files which are produced
by the K40 calibration procedure in Jpp.
Below is an example, using a PMT file from the
[
`KM3NeTTestData.jl`
](
https://git.km3net.de/km3py/km3net-testdata
)
package.
```
@example 1
using KM3io
using KM3NeTTestData
pmtfile = read(datapath("pmt", "calibration_00000117_H_1.0.0_00013757_00013826_1.txt"), PMTFile)
```
Data for individual PMTs can be accessed by indexing using the module ID and the DAQ channel ID of the PMT:
```
@example 1
pmtdata = pmtfile[806451572, 4]
pmtdata.gain
```
The returned type is
[
`PMTData`
](
@ref
)
with following fields:
```
@example 1
fieldnames(typeof(pmtdata))
```
This diff is collapsed.
Click to expand it.
src/exports.jl
+
1
−
0
View file @
6bebc936
...
...
@@ -23,6 +23,7 @@ StringMechanics,
StringMechanicsParameters
,
Tripod
,
PMTFile
,
PMTData
,
center
,
getmodule
,
getpmt
,
...
...
This diff is collapsed.
Click to expand it.
src/hardware.jl
+
20
−
1
View file @
6bebc936
...
...
@@ -758,6 +758,11 @@ struct PMTParameters
end
Base
.
isvalid
(
p
::
PMTParameters
)
=
!
(
p
.
QE
<
0
||
p
.
gain
<
0
||
p
.
gainSpread
<
0
||
p
.
threshold
<
0
||
p
.
thresholdBand
<
0
)
"""
PMT parameters as stored in [`PMTFile`](@ref)s.
"""
struct
PMTData
QE
::
Float64
gain
::
Float64
...
...
@@ -767,6 +772,20 @@ struct PMTData
threshold
::
Float64
end
"""
A container type to hold PMT data which are stored in "
PMT
files
", created by
K40 calibrations. This type can be passe to `Base.read` to load the contents
of such a file.
# Example
```
julia> f = read("
path
/
to
/
pmt
.
txt
", PMTFile)
PMTFile containing parameters of 7254 PMTs
```
"""
struct
PMTFile
QE
::
Float64
# relative quantum efficiency
mu
::
Float64
...
...
@@ -784,7 +803,7 @@ Base.getindex(p::PMTFile, dom_id::Integer, channel_id::Integer) = p.pmt_data[dom
Read PMT parameters from a K40 calibration output file.
"""
function
read
(
filename
::
AbstractString
,
T
::
Type
{
PMTFile
})
function
read
(
filename
::
AbstractString
,
::
Type
{
PMTFile
})
pmt_data
=
Dict
{
Tuple
{
Int
,
Int
},
PMTData
}()
fobj
=
open
(
filename
,
"r"
)
comments
,
content
=
_split_comments
(
readlines
(
fobj
),
"#"
)
...
...
This diff is collapsed.
Click to expand it.
Tamas Gal
@tgal
mentioned in commit
7d58b2d7
·
5 months ago
mentioned in commit
7d58b2d7
mentioned in commit 7d58b2d74202a09b405ff28a867f6c985ab1e99e
Toggle commit list
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