Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
OrcaSong
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
Environments
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
Machine Learning
OrcaSong
Commits
c38ccb91
Commit
c38ccb91
authored
5 years ago
by
Stefan Reck
Browse files
Options
Downloads
Patches
Plain Diff
Added a small doc page for orcasong_plag
parent
27ca8221
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
docs/orcasong_plag.rst
+68
-0
68 additions, 0 deletions
docs/orcasong_plag.rst
with
68 additions
and
0 deletions
docs/orcasong_plag.rst
0 → 100644
+
68
−
0
View file @
c38ccb91
OrcaSong Plag
=============
OrcaSong Plag is an alternative to orcasong, with (hopefully) more
accessible features.
It has a slightly reduced functionality (no plots), but apart from that
does the same job as orcasong.
Basic Use
---------
Import the main class, the FileBinner (see
:py:class:`orcasong_plag.core.FileBinner`),
like this:
.. code-block:: python
from orcasong_plag.core import FileBinner
The FileBinner allows to make nd histograms ("images") from calibrated and
h5-converted root files.
To do this, you can pass a list defining the binning. E.g., the following would
set up the file binner to generate zt data:
.. code-block:: python
bin_edges_list = [
["pos_z", np.linspace(0, 10, 11)],
["time", np.linspace(-50, 550, 101)],
]
fb = FileBinner(bin_edges_list)
Calling the object like this will show you the binning:
.. code-block:: python
fb
>>> <FileBinner: ('pos_z', 'time') (10, 100)>
As you can see, the FileBinner will produce zt data, with 10 and 100 bins,
respectively.
Convert a file like this:
.. code-block:: python
fb.run(infile, outfile)
Or event this for multiple files, which will all be saved in the given folder:
.. code-block:: python
fb.run_multi(infiles, outfolder)
Adding mc_info
--------------
To add info from the mc_tracks (or from wherever), you can define some
function `my_mcinfo_extractor` which takes as an input a km3pipe blob,
and outputs a dict mapping str to float.
This will be saved as a numpy structured array "y" in the output file, with
the str being the dtype names. Set up like follows:
.. code-block:: python
fb = FileBinner(bin_edges_list, mc_info_extr=my_mcinfo_extractor)
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