Skip to main content

Detector Calibration Package for NPAC

Project description

NPAC Detector Calibration

CI/CD License: MIT Python Version PyPI version PyPI downloads

A suite of tools for the calibration of particle detectors using simulation data. This project is designed to process raw data, identify particle interaction peaks, perform Gaussian fits, and determine calibration constants.

Features

  • Read and process particle detector simulation data.
  • Identify particle interaction peaks in detector layers.
  • Perform Gaussian fits on identified peaks.
  • Determine calibration constants for energy calibration.
  • Command-line interface for running calibration on all layers.

Installation

This project is managed with PDM.

Option 1: Install from PyPI

pip install npac_calibration
# or using PDM
pdm add npac_calibration

Option 2: Install from GitLab repository (development version)

pdm add git+https://gitlab.in2p3.fr/informatique-des-deux-infinis/npac/2026/silver-wolf/calibration.git

Optional: Add NPAC Validator

To use the validator, install the npac_validator package in your PDM environment, then edit the pyproject.toml file and add:

[[tool.pdm.source]]
name = "npac_gitlab"
url = "https://gitlab.in2p3.fr/api/v4/projects/26344/packages/pypi/simple"

Usage

After installation, you can use the package like this:

from npac_calibration.main.detector_calibration import DetectorCalibration
import pandas as pd

# Path to event files
event_path = "data/electron_1GeV_Shower/event000000047-hits_digitised.csv"

# Read events into a DataFrame
df = pd.read_csv(event_path)

# Initialize the detector calibration
calib = DetectorCalibration()

# Run calibration for all layers
all_results = calib.run_all_layers(df, save_csv=True)

# Get peak information for a specific layer
layer0_peaks = calib.get_peaks_info(layer=0)
print("Peaks found in layer 0:", layer0_peaks["x_peak"])

You can also run the calibration for all layers from the command line:

pdm run calibrate

Contributing

Contributions are welcome! Feel free to open an issue or submit a merge request.


License

This project is licensed under the MIT License — see the LICENSE file for details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

npac_calibration-0.2.1.tar.gz (17.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

npac_calibration-0.2.1-py3-none-any.whl (18.6 kB view details)

Uploaded Python 3

File details

Details for the file npac_calibration-0.2.1.tar.gz.

File metadata

  • Download URL: npac_calibration-0.2.1.tar.gz
  • Upload date:
  • Size: 17.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: pdm/2.26.2 CPython/3.12.12 Linux/5.14.0-503.15.1.el9_5.x86_64

File hashes

Hashes for npac_calibration-0.2.1.tar.gz
Algorithm Hash digest
SHA256 9ac1f83f90d8b642edb55d9cf22df2d8a17721d5d265be9ab0eb333631f6d28f
MD5 507e9993b82f28ba5a4a34b1558e6407
BLAKE2b-256 372a5aa2ca668c4431ccfe57609ea6639ce7a52b5bc6f742eb57cf98cbea8bba

See more details on using hashes here.

File details

Details for the file npac_calibration-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: npac_calibration-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 18.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: pdm/2.26.2 CPython/3.12.12 Linux/5.14.0-503.15.1.el9_5.x86_64

File hashes

Hashes for npac_calibration-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 aa3b57d82e910bbae09dae2f3ac9999eff90b6ba4389eb251765b306cd1ef173
MD5 472c88bae975f145e8d6cb91ccb42cf6
BLAKE2b-256 00b17d8d5ec85ed14a3bcf901ac5be0a516ee0c37fb6b307e1d71c4e27f67a6c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page