88 Commits

Author SHA1 Message Date
Mazzoleni Alice Francesca
885309d97c fix build
Some checks failed
Build the package using cmake then documentation / build (ubuntu-latest, 3.12) (push) Failing after 43s
2025-04-03 17:14:28 +02:00
Mazzoleni Alice Francesca
de9fc16e89 generalize is_selected 2025-04-03 09:28:54 +02:00
Mazzoleni Alice Francesca
50eeba4005 restructured GainMap to have own class and generalized
Some checks failed
Build the package using cmake then documentation / build (ubuntu-latest, 3.12) (push) Failing after 40s
2025-04-02 17:58:26 +02:00
Mazzoleni Alice Francesca
61af1105a1 templated eta and updated test 2025-04-02 14:42:38 +02:00
Mazzoleni Alice Francesca
04728929cb implemented sum_2x2() for general clusters, only one calculate_eta2 function for all clusters
Some checks failed
Build the package using cmake then documentation / build (ubuntu-latest, 3.12) (push) Failing after 37s
2025-04-01 18:29:08 +02:00
Mazzoleni Alice Francesca
3083d51699 merge conflict 2025-04-01 17:50:11 +02:00
Mazzoleni Alice Francesca
4240942cec solved merge conflict 2025-04-01 17:48:48 +02:00
Mazzoleni Alice Francesca
745d09fbe9 changed push_back to take Cluster as input argument 2025-04-01 15:30:10 +02:00
Erik Fröjdh
a42c0d645b
added roi, noise and gain (#143)
- Moved definitions of Cluster_2x2 and Cluster_3x3 to it's own file
- Added optional members for ROI, noise_map and gain_map in ClusterFile

**API:**

After creating the ClusterFile the user can set one or all of: roi,
noise_map, gain_map

```python
f = ClusterFile(fname)
f.set_roi(roi) #aare.ROI
f.set_noise_map(noise_map) #numpy array
f.set_gain_map(gain_map) #numpy array
```

**When reading clusters they are evaluated in the order:**

1. If ROI is enabled check that the cluster is within the ROI
1. If noise_map is enabled check that the cluster meets one of the
conditions
    - Center pixel above noise
    - Highest 2x2 sum above 2x noise
    - 3x3 sum above 3x noise
1. If gain_map is set apply the gain map before returning the clusters
(not used for noise cut)

**Open questions:**
1. Check for out of bounds access in noise and gain map?

closes #139 
closes #135 
closes #90
2025-04-01 14:31:25 +02:00
Mazzoleni Alice Francesca
508adf5016 refactoring of remaining files
Some checks failed
Build the package using cmake then documentation / build (ubuntu-latest, 3.12) (push) Failing after 40s
Build the package using cmake then documentation / deploy (push) Has been skipped
2025-04-01 10:01:23 +02:00
Mazzoleni Alice Francesca
e038bd1646 refactored and put calculate_eta function in seperate file 2025-03-31 17:35:39 +02:00
f8f98b6ec3 Generalized calculate_eta2 function to work with general cluster types 2025-03-28 14:29:20 +01:00
0876b6891a cpp Cluster and ClusterVector and ClusterFile are templated now, they support generic cluster types 2025-03-25 21:42:50 +01:00
Erik Fröjdh
6ad76f63c1
Fixed reading clusters with ROI (#142)
Some checks failed
Build the package using cmake then documentation / build (ubuntu-latest, 3.12) (push) Failing after 9s
Fixed incorrect reading of clusters with ROI


closes #141
2025-03-24 14:28:10 +01:00
6e7e81b36b complete mess but need to install RedHat 9 2025-03-21 16:32:54 +01:00
Erik Fröjdh
11cd2ec654
Interpolate (#137)
- added eta based interpolation
2025-03-18 17:45:38 +01:00
froejdh_e
332bdeb02b modified algo 2025-03-14 11:07:09 +01:00
froejdh_e
3a987319d4 WIP 2025-03-05 21:51:23 +01:00
froejdh_e
5614cb4673 WIP 2025-03-05 17:40:08 +01:00
froejdh_e
8ae6bb76f8 removed warnings added clang-tidy 2025-02-21 11:18:39 +01:00
Erik Fröjdh
fc1c9f35d6
Merge branch 'main' into developer 2025-02-18 21:52:20 +01:00
Erik Fröjdh
6a83988485
Added chi2 to fit results (#131)
- fit_gaus and fit_pol1 now return a dict
- calculate chi2 after fit
- cleaned up code
2025-02-18 21:13:27 +01:00
Erik Fröjdh
dadf5f4869
Added fitting, fixed roi etc (#129)
Co-authored-by: Patrick <patrick.sieberer@psi.ch>
Co-authored-by: JulianHeymes <julian.heymes@psi.ch>
2025-02-12 16:50:31 +01:00
Erik Fröjdh
7309cff47c
Added fitting with lmfit (#128)
- added stand alone fitting using:
https://jugit.fz-juelich.de/mlz/lmfit.git
- fit_gaus, fit_pol1 with and without errors
- multi threaded fitting

---------

Co-authored-by: JulianHeymes <julian.heymes@psi.ch>
2025-02-12 16:35:48 +01:00
Erik Fröjdh
c0c5e07ad8
added decoding of adc_sar_04 (#127) 2025-02-12 16:17:32 +01:00
froejdh_e
2faa317bdf removed debug line 2025-02-12 10:59:18 +01:00
Erik Fröjdh
d86cb533c8
Fix minor warnings (#126)
- Unused variables
- signed vs. unsigned
- added -flto=auto
2025-02-11 11:48:01 +01:00
Erik Fröjdh
4c750cc3be
Fixing ROI read of RawFile (#125)
- Bugfixes
- New abstraction for detector geometry
- Tests for updating geo with ROI
2025-02-11 11:08:22 +01:00
Erik Fröjdh
5a3ca2ae2d
Decoding for ADC SAR 05 64->16bit (#124)
Co-authored-by: Patrick <patrick.sieberer@psi.ch>
2025-02-05 14:40:26 +01:00
froejdh_e
f6d736facd docs for ClusterFile 2025-01-15 09:15:41 +01:00
froejdh_e
d0f435a7ab bounds checking on subfiles 2025-01-10 19:02:50 +01:00
froejdh_e
7ce02006f2 clear pedestal 2025-01-10 17:26:23 +01:00
froejdh_e
7550a2cb97 fixing read bug 2025-01-10 15:33:56 +01:00
froejdh_e
caf7b4ecdb added docs for ClusterFinderMT 2025-01-10 10:22:04 +01:00
froejdh_e
cc95561eda MultiThreaded Cluster finder 2025-01-09 16:53:22 +01:00
Erik Fröjdh
d07da42745 bitdepths 2025-01-07 12:27:01 +01:00
froejdh_e
e6098c02ef bumped version 2024-12-16 14:24:46 +01:00
froejdh_e
a0f481c0ee mod pedestal 2024-12-12 14:34:10 +01:00
froejdh_e
b3a9e9576b WIP 2024-12-11 16:27:36 +01:00
froejdh_e
60534add92 WIP 2024-12-11 09:54:33 +01:00
Erik Fröjdh
6fd52f6b8d
added missing enums (#111)
- Missing enums
- Matching values to slsDetectorPackage
- tests
2024-11-29 15:28:19 +01:00
froejdh_e
0047d15de1 removed print flip 2024-11-29 15:00:18 +01:00
froejdh_e
a1b7fb8fc8 added missing enums 2024-11-29 14:56:39 +01:00
froejdh_e
115dfc0abf bugfix on iteration and returning master file 2024-11-28 21:14:40 +01:00
froejdh_e
0df8e4bb7d added support for old old moench files 2024-11-27 16:27:55 +01:00
froejdh_e
8e3d997bed read_n returns remaining frames 2024-11-26 12:07:17 +01:00
d48482e9da Modified moench05 transform: new firmware (moench05), legacy firmware (moench05_old), 1g readout (moench05_1g) 2024-11-25 16:39:08 +01:00
Erik Fröjdh
f9a2d49244 removed extra print 2024-11-21 10:22:22 +01:00
Erik Fröjdh
9f7cdbcb48 conversion warnings 2024-11-18 18:18:55 +01:00
Erik Fröjdh
62a14dda13
Merge branch 'main' into developer 2024-11-15 16:19:34 +01:00