Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
e522379
plot p.e. spectrum and get DCR
Nov 21, 2025
742f0dc
style: pre-commit fixes
pre-commit-ci[bot] Nov 24, 2025
d95326e
Merge branch 'main' into final_analysis_scripts
patgo25 Nov 24, 2025
b46e608
style: pre-commit fixes
pre-commit-ci[bot] Nov 24, 2025
ab95326
Merge branch 'main' into final_analysis_scripts
patgo25 Nov 24, 2025
c72c2a2
update paths
Nov 24, 2025
1ce1685
add temp dt from raw
Nov 25, 2025
51977b3
style: pre-commit fixes
pre-commit-ci[bot] Nov 25, 2025
6d0506e
Merge branch 'main' into final_analysis_scripts
patgo25 Nov 25, 2025
7cef207
add gain plot generation
Nov 25, 2025
3768068
split analysis into multiple scripts
Nov 27, 2025
261cf33
Refactor scripts to analyser class
Nov 27, 2025
0727907
Add functionality to convert NNLS units to other units
Nov 28, 2025
947a2d9
Adding more CLI options
Nov 28, 2025
24e5c98
Remove awkward data loading
Nov 28, 2025
c715183
Merge branch 'main' into final_analysis_scripts
patgo25 Nov 28, 2025
fc057db
Add key selection
Nov 28, 2025
ef43d01
adapted to current aux file layout
Dec 3, 2025
1da1544
make a callable cli command
Dec 3, 2025
0a7e385
Analyzer class renamed
Dec 3, 2025
ffbb731
Implement robust unit system with pint
Dec 10, 2025
f171e48
moved helper functions to util file
Dec 10, 2025
d7af52f
First commit on uploader script
Dec 11, 2025
79d2827
Move to Paths relative to aux file
Dec 13, 2025
523e002
Switch pe peak initial guess algorithm, add noise peak info to stats
Dec 13, 2025
0a860df
Split out utility functions
Dec 15, 2025
9df71d4
style: pre-commit fixes
pre-commit-ci[bot] Dec 15, 2025
50be2d5
Create dir if not existing
Dec 15, 2025
4efe039
edited uploader
Dec 15, 2025
b5e0c25
Switch from 1 indexed to 0 indexed aux files
Dec 16, 2025
01a9ce7
save hemisphere info to result file
Dec 16, 2025
174c096
added insert time to document
Dec 17, 2025
6853011
Add DB connection settings to arg parser
Dec 17, 2025
a470796
define version automatically
Dec 17, 2025
158584c
Remove uv dependencies
Dec 17, 2025
3eb3472
Revise README for MINT analysis framework details
patgo25 Dec 17, 2025
41c57cf
Merge branch 'main' into final_analysis_scripts
patgo25 Dec 17, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 12 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,18 @@
# mint-analysis
Collection of scripts for MINT tests
A framework to analysis p-one PMT data.

The MINT analysis package processes data recorded by the Andromeda package (e.g., PMT or acoustic data) and applies advanced analysis routines that lie outside Andromeda’s scope.

## Installation

Clone the repo

To install packages I recommend using uv [https://docs.astral.sh/uv/], which
is a fast modern python package handler that also handles virtual environments.

You'll need to install this first which is shown here [https://docs.astral.sh/uv/getting-started/installation/].
For PMT data, two analysis frameworks are planned:
- Pygama – Modern, Python-based, fast-turnaround DSP toolkit for time-series data.
Status: Implemented.
- IceTray – The classical IceCube framework and future default for P-ONE data.
Status: Not yet implemented.

Once you have it installed go to the cloned repo and inside you should see a pyproject.toml file
this contains all the info on the packages needed.
Detailed unboarding instructions can be found [on confluence](https://p-one.atlassian.net/wiki/spaces/PONE/pages/1797849089/MINT+Analysis+User+Onboarding).

To install the packages simply run `uv sync`and they should all install.

Then to open a jupyter notebook: `uv run --with jupyter jupyter notebook`. (In fact you don't even need the `uv sync` and can
simply do the run, uv will handle the rest). This will run a jupyter notebook instance inside the virtual environment.

Some packages may cause issues such as h5py which may need to be installed separately via brew.
## Installation

All new instances you make are completely independent so can use different package/python versions as
specified in the pyproject.toml file.
Clone the repo
cd into repo
`pip install .`
16 changes: 16 additions & 0 deletions analysis.log
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
[2025-12-15 15:05:54,438] [PESpectrum - main] [INFO] collected measurement results
[2025-12-15 15:05:54,438] [PESpectrum - main] [INFO] collected PMT info
[2025-12-15 15:05:54,439] [PESpectrum - main] [INFO] collected environment info
[2025-12-15 15:05:54,439] [PESpectrum - main] [INFO] collected software info
[2025-12-15 15:05:58,512] [PESpectrum - _connect_tunnel] [INFO] [info] SSH tunnel established: 127.0.0.1:43307 -> 127.0.0.1:27017 via production.pacific-neutrino.org
[2025-12-15 15:05:58,620] [PESpectrum - _connect_client] [INFO] [info] Connected to MongoDB at 127.0.0.1:43307 with user p-one
[2025-12-15 15:05:58,753] [PESpectrum - main] [INFO] Build data object
[2025-12-15 15:05:58,753] [PESpectrum - main] [INFO] The following dict would be uploaded to the DB: {'measurement_type': 'dcr', 'measurement_location': 'MINT', 'devices_used': ['p-1-1-pmt-unit-KM56674_275', 'p-1-1-om-hs-01'], 'result': 26463.90079865678, 'result_unc': 30.15089782382669, 'units': 'Hz', 'pmt_info': {'v10_in_volt': 85.09310150146484, 'di10_in_mA': 2.9245901107788086, 'frac': 0.877996027469635}, 'env_info': {'temperature_in_celsius': 29.11357307688087, 'pressure_in_hpa': 1011.6844068085361, 'humidity_in_percent': 23.183785204174583, 'measurement_duration_in_s': 29.110747814178467}, 'software_info': {'framework': 'mint-xyz', 'pe_reconstruction': 'NNLS', 'sftp_path': '/mint/mint-data/p-1-1-om-hs-01/PMT', 'run_tags': '2025_12_13_03_31_52'}, 'mapping': None}
[2025-12-15 15:05:58,753] [PESpectrum - main] [INFO] collected measurement results
[2025-12-15 15:05:58,754] [PESpectrum - main] [INFO] collected PMT info
[2025-12-15 15:05:58,754] [PESpectrum - main] [INFO] collected environment info
[2025-12-15 15:05:58,754] [PESpectrum - main] [INFO] collected software info
[2025-12-15 15:05:59,167] [PESpectrum - _connect_tunnel] [INFO] [info] SSH tunnel established: 127.0.0.1:38145 -> 127.0.0.1:27017 via production.pacific-neutrino.org
[2025-12-15 15:05:59,242] [PESpectrum - _connect_client] [INFO] [info] Connected to MongoDB at 127.0.0.1:38145 with user p-one
[2025-12-15 15:05:59,379] [PESpectrum - main] [INFO] Build data object
[2025-12-15 15:05:59,380] [PESpectrum - main] [INFO] The following dict would be uploaded to the DB: {'measurement_type': 'dcr', 'measurement_location': 'MINT', 'devices_used': ['p-1-1-pmt-unit-KM54356_23', 'p-1-1-om-hs-01'], 'result': 26326.463667634333, 'result_unc': 30.07250335177778, 'units': 'Hz', 'pmt_info': {'v10_in_volt': 87.58090209960938, 'di10_in_mA': 1.8282999992370605, 'frac': 0.8174149990081787}, 'env_info': {'temperature_in_celsius': 29.11357307688087, 'pressure_in_hpa': 1011.6844068085361, 'humidity_in_percent': 23.183785204174583, 'measurement_duration_in_s': 29.110747814178467}, 'software_info': {'framework': 'mint-xyz', 'pe_reconstruction': 'NNLS', 'sftp_path': '/mint/mint-data/p-1-1-om-hs-01/PMT', 'run_tags': '2025_12_13_03_31_52'}, 'mapping': None}
21 changes: 12 additions & 9 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
[build-system]
requires = [
"setuptools>=61.2",
"setuptools_scm[toml]>=7"
]
requires = ["setuptools>=64", "setuptools_scm>=8"]
build-backend = "setuptools.build_meta"

[tool.setuptools_scm]
write_to = "src/mintanalysis/_version.py"
# 'node-and-date' or 'node-and-timestamp' appends the short hash
local_scheme = "node-and-date"
# 'guess-next-dev' ensures versions like 1.0.1.dev1+gabc123
version_scheme = "guess-next-dev"

[tool.setuptools]
include-package-data = true
zip-safe = false
Expand All @@ -20,9 +24,6 @@ py-modules = []
where = ["src"]


[tool.setuptools_scm]
write_to = "src/mintanalysis/_version.py"

[project.urls]
Homepage = "https://github.com/pone-software/mint-analysis"
Issues = "https://github.com/pone-software/mint-analysis/issues"
Expand Down Expand Up @@ -58,6 +59,7 @@ dependencies = [
"iminuit",
"pymongo",
"PyYAML",
"pint",
"sshtunnel",
"pygama>=2.0.0",
"legend-daq2lh5>=1.2.1",
Expand All @@ -66,6 +68,7 @@ dependencies = [
"numba>0.52",
"pandas",
"matplotlib",
"uncertainties",
"scipy>=1.14",
"jupyter",
"ipython",
Expand All @@ -74,8 +77,6 @@ dependencies = [
"dspeed==2.0.2",
]

#"dspeed @ file:///${PROJECT_ROOT}/dspeed",

[project.optional-dependencies]
test = [
"pytest >=6",
Expand All @@ -93,6 +94,8 @@ docs = [

[project.scripts]
# Format: <cli_command_name> = "<module_path>:<function_name>"
build_ana = "mintanalysis.pmt.ana.peSpectrumAnalyzer:main"
upload_ana = "mintanalysis.pmt.ana.uploadToDB:main"
build_dsp = "mintanalysis.pmt.dsp.build_dsp:build_dsp_cli"
build_nnls_db = "mintanalysis.pmt.dsp.build_nnls_database:build_nnls_database_cli"

Expand Down
8 changes: 8 additions & 0 deletions src/mintanalysis/pmt/ana/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
"""
Routines for the final analysis of PMT data
"""

from . import uploadToDB
from .peSpectrumAnalyzer import PESpectrumAnalyzer

__all__ = ["PESpectrumAnalyzer", "uploadToDB"]
Loading