Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
f17b574
Draft.
augustocattafesta May 6, 2026
6756c64
Draft.
augustocattafesta May 6, 2026
f9218f1
Draft.
augustocattafesta May 6, 2026
440dcc7
Draft.
augustocattafesta May 7, 2026
4814bde
New module pdf (with tests) to interpolate spectra.
augustocattafesta May 7, 2026
5f26af1
New calibspec command added.
augustocattafesta May 7, 2026
aef6a7e
New calibspec command added.
augustocattafesta May 7, 2026
d2eb736
Minor.
augustocattafesta May 7, 2026
e1d0fc9
Minor.
augustocattafesta May 7, 2026
dc8b164
Added plot method.
augustocattafesta May 8, 2026
c70248e
Minor.
augustocattafesta May 8, 2026
9816272
Parallelization implemented for gain calibration.
augustocattafesta May 8, 2026
6b1eabf
Updating dependencies.
augustocattafesta May 8, 2026
8e9ec8f
Linting.
augustocattafesta May 8, 2026
ad5909b
Minor.
augustocattafesta May 8, 2026
018175a
Minor.
augustocattafesta May 8, 2026
3417ebf
Refactoring gain matrix to equalization matrix.
augustocattafesta May 10, 2026
1b14008
Added new EQUALIZATION calibration type.
augustocattafesta May 10, 2026
57efdc3
Added ADC counts column in Recon files.
augustocattafesta May 10, 2026
0a002da
Added adc method.
augustocattafesta May 10, 2026
b9c0443
Refactoring with equaliaztion calibration matrix.
augustocattafesta May 11, 2026
091ba3f
Linting.
augustocattafesta May 11, 2026
cae43b3
Release notes.
augustocattafesta May 11, 2026
9a909fd
Release notes.
augustocattafesta May 11, 2026
ce5e529
Reviewing.
augustocattafesta May 12, 2026
a4e7b12
Merge remote-tracking branch 'origin' into issue_129
augustocattafesta May 12, 2026
e52deb5
Review.
augustocattafesta May 12, 2026
527c883
Linting.
augustocattafesta May 12, 2026
3e04211
Added uniform equalization file in CalDB.
augustocattafesta May 12, 2026
70e94fc
Minor.
augustocattafesta May 12, 2026
156594d
Import error solved.
augustocattafesta May 12, 2026
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
Binary file not shown.
28 changes: 28 additions & 0 deletions docs/release_notes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,34 @@ Release notes
=============


* Package dependencies updated: `joblib` and `iminuit` added.
* New calibration matrix type `equalization` added in `caldb.py` to store the pixel equalization
factors.
* New `CalibrateEqualization` class to calibrate the pixel equalization factors. This is
performed with a likelihood fit using the source spectrum probability density function (PDF)
and the observed energy of the events. Corresponding CLI command `calibgen equalization` added
to generate equalization calibration files from event files.
* The `CalibrateGain` class has been refactored. Now it produces a gain calibration matrix from
an equalization calibration matrix, by using the ADC to eV conversion and the chip sensor
material. The gain matrix is expressed in ADC counts per electron. Corresponding CLI command
`calibgen gain` refactored to reflect this change.
* Some CLI commands refactored to use the equalization calibration file instead of the gain
calibration file (`reconstruct`, `display`, `calibgen eta`).
* New `pdf.py` module containing facilities to calculate the PDF of the source spectrum and store
it in a `.npz` file.
* Added `calibspec` CLI command to create a source spectrum PDF file from a reconstructed event
file. The PDF is saved as a `.npz` file.
* New `adc` method to calculate the total ADC counts of the event added to `ReconEvent`. Now a
reconstructed file contains both the ADC counts and the energy in eV of the events (if the
conversion factor from ADC to eV is available in the equalization calibration file).
* New `energy` method to calculate the total energy of the event added to `Cluster`. The
conversion factor from ADC to eV is passed by `ClusteringNN`.
* Pull requests merged and issues closed:

- https://github.com/lucabaldini/hexsample/pull/132
- https://github.com/lucabaldini/hexsample/issues/129


Version 0.16.1 (2026-05-12)
~~~~~~~~~~~~~~~~~~~~~~~~~~~

Expand Down
2 changes: 2 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ dependencies = [
"xraydb",
"aptapy>=0.18.0",
"scikit-image",
"iminuit",
"joblib",
]

[project.optional-dependencies]
Expand Down
4 changes: 4 additions & 0 deletions scripts/populate_caldb.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,14 @@
"""

import numpy as np
from xraydb import ionization_potential

from hexsample.caldb import CalDB, CalibrationType
from hexsample.tasks import SynthesizeCalibrationDefaults, synthesize_calibration_file

DEFAULT_IONIZATION_POTENTIAL = ionization_potential("Si")
DEFAULT_GAIN = 1.
DEFAULT_ADC_TO_EV = DEFAULT_IONIZATION_POTENTIAL / DEFAULT_GAIN
RMS_VALS = (0, 10)
ENC_VALS = np.array((20., 30., 40., 50., 75., 100.))
PEDESTAL_VALS = (0, 1000)
Expand Down Expand Up @@ -62,6 +65,7 @@ def populate_caldb() -> None:
generate_files(CalibrationType.ENC, ENC_VALS, RMS_VALS)
generate_files(CalibrationType.NOISE, ENC_VALS * DEFAULT_GAIN, RMS_VALS)
generate_files(CalibrationType.GAIN, [DEFAULT_GAIN], RMS_VALS)
generate_files(CalibrationType.EQUALIZATION, [DEFAULT_ADC_TO_EV], [0.])
generate_files(CalibrationType.PEDESTAL, PEDESTAL_VALS, RMS_VALS)


Expand Down
6 changes: 6 additions & 0 deletions src/hexsample/caldb.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,3 +64,9 @@ def open_gain(cls, designator: str) -> CalibrationMatrix:
"""Open the gain calibration file for the given designation.
"""
return cls._open(CalibrationType.GAIN, designator)

@classmethod
def open_equalization(cls, designator: str) -> CalibrationMatrix:
"""Open the equalization calibration file for the given designation.
"""
return cls._open(CalibrationType.EQUALIZATION, designator)
Loading