inverted gain map

This commit is contained in:
froejdh_e 2025-04-22 16:16:27 +02:00
parent b501c31e38
commit c6e8e5f6a1
4 changed files with 9 additions and 3 deletions

View File

@ -1,6 +1,6 @@
package:
name: aare
version: 2025.4.1 #TODO! how to not duplicate this?
version: 2025.4.22 #TODO! how to not duplicate this?

View File

@ -124,7 +124,7 @@ class ClusterFile {
/**
* @brief Set the gain map to use when reading clusters. If set the gain map will be applied
* to the clusters that pass ROI and noise_map selection.
* to the clusters that pass ROI and noise_map selection. The gain map is expected to be in ADU/energy.
*/
void set_gain_map(const NDView<double, 2> gain_map);

View File

@ -4,7 +4,7 @@ build-backend = "scikit_build_core.build"
[project]
name = "aare"
version = "2025.4.2"
version = "2025.4.22"
requires-python = ">=3.11"
dependencies = [
"numpy",

View File

@ -41,6 +41,12 @@ void ClusterFile::set_noise_map(const NDView<int32_t, 2> noise_map){
void ClusterFile::set_gain_map(const NDView<double, 2> gain_map){
m_gain_map = NDArray<double, 2>(gain_map);
// Gain map is passed as ADU/keV to avoid dividing in when applying the gain
// map we invert it here
for (auto &item : m_gain_map->view()) {
item = 1.0 / item;
}
}
ClusterFile::~ClusterFile() { close(); }