77 Commits

Author SHA1 Message Date
froejdh_e
c6e8e5f6a1 inverted gain map 2025-04-22 16:16:27 +02:00
Erik Fröjdh
326941e2b4
Custom base for decoding ADC data (#163)
New function apply_custom_weights (can we find a better name) that takes
a uint16 and a NDView<double,1> of bases for the conversion. For each
supplied weight it is used as base (instead of 2) to convert from bits
to a double.

---------

Co-authored-by: siebsi <sieb.patr@gmail.com>
2025-04-22 15:20:46 +02:00
Erik Fröjdh
a59e9656be
Making RawSubFile usable from Python (#158)
All checks were successful
Build on RHEL8 / build (push) Successful in 1m55s
Build on RHEL9 / build (push) Successful in 1m44s
- Removed a printout left from debugging
- return also header when reading
- added read_n 
- check for error in ifstream
2025-04-11 16:54:21 +02:00
Erik Fröjdh
8b0eee1e66
fixed warnings and removed ambiguous read_frame (#154)
All checks were successful
Build on RHEL9 / buildh (push) Successful in 1m47s
Fixed warnings:
- unused variable in Interpolator
- Narrowing conversions uint64-->int64

Removed an ambiguous function from JungfrauDataFile
- NDarry read_frame(header&=nullptr)
- Frame read_frame()

NDArray and NDView size() is now signed
2025-04-09 17:54:55 +02:00
Erik Fröjdh
f16273a566
Adding support for Jungfrau .dat files (#152)
All checks were successful
Build on RHEL9 / buildh (push) Successful in 1m48s
closes #150 

**Not addressed in this PR:** 

- pixels_per_frame, bytes_per_frame and tell should be made cost in
FileInterface
2025-04-08 15:31:04 +02:00
Erik Fröjdh
9d8e803474
Merge branch 'main' into developer 2025-04-01 14:35:27 +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
Erik Fröjdh
5d8ad27b21
Developer (#138)
All checks were successful
Build the package using cmake then documentation / build (ubuntu-latest, 3.12) (push) Successful in 1m45s
- Fully functioning variable size cluster finder
- Added interpolation
- Bit reordering for ADC SAR 05

---------

Co-authored-by: Patrick <patrick.sieberer@psi.ch>
Co-authored-by: JulianHeymes <julian.heymes@psi.ch>
Co-authored-by: Dhanya Thattil <dhanya.thattil@psi.ch>
Co-authored-by: xiangyu.xie <xiangyu.xie@psi.ch>
2025-03-20 12:52:04 +01:00
Erik Fröjdh
11cd2ec654
Interpolate (#137)
- added eta based interpolation
2025-03-18 17:45:38 +01:00
froejdh_e
8ae6bb76f8 removed warnings added clang-tidy 2025-02-21 11:18:39 +01:00
Xiangyu Xie
1d2c38c1d4
Enable VarClusterFinder (#134)
Co-authored-by: xiangyu.xie <xiangyu.xie@psi.ch>
2025-02-19 16:11:24 +01:00
Erik Fröjdh
b7a47576a1
Multi threaded fitting and returning chi2 (#132)
Co-authored-by: Patrick <patrick.sieberer@psi.ch>
Co-authored-by: JulianHeymes <julian.heymes@psi.ch>
Co-authored-by: Dhanya Thattil <dhanya.thattil@psi.ch>
2025-02-19 07:19:59 +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
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
078e5d81ec docs 2025-01-15 16:40:34 +01:00
froejdh_e
6cde968c60 summing 2x2 2025-01-15 16:12:06 +01:00
froejdh_e
f6d736facd docs for ClusterFile 2025-01-15 09:15:41 +01:00
froejdh_e
7ce02006f2 clear pedestal 2025-01-10 17:26:23 +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
froejdh_e
dc9e10016d WIP 2025-01-08 16:45:24 +01:00
froejdh_e
21ce7a3efa bumped version 2025-01-07 16:33:16 +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
f88b53387f WIP 2024-12-12 17:58:04 +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
froejdh_e
7f2a23d5b1 accumulating clusters in one array 2024-12-10 22:00:12 +01:00
froejdh_e
6a150e8d98 WIP 2024-12-10 17:21:05 +01:00
froejdh_e
a1b7fb8fc8 added missing enums 2024-11-29 14:56:39 +01:00
froejdh_e
0df8e4bb7d added support for old old moench files 2024-11-27 16:27:55 +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
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
Erik Fröjdh
17f8d28019 frame reading for cluster file 2024-11-15 16:13:46 +01:00
Erik Fröjdh
e77b615293
Added expression templates (#98)
- Works with NDArray
- Works with NDView
2024-11-15 15:17:52 +01:00
Erik Fröjdh
5cde7a99b5 WIP 2024-11-14 17:02:48 +01:00
froejdh_e
dcedb4fb13 added missing header 2024-11-14 16:37:24 +01:00
Erik Fröjdh
7ffd732d98
ported reading clusters (#95) 2024-11-14 16:22:38 +01:00
Erik Fröjdh
fbaf9dce89
Developer (#94) 2024-11-14 08:03:18 +01:00
Erik Fröjdh
cb94d079af Merge branch 'developer' of github.com:slsdetectorgroup/aare into developer 2024-11-14 07:42:00 +01:00
Erik Fröjdh
13b2cb40b6 docs and reorder 2024-11-14 07:41:50 +01:00
Erik Fröjdh
17917ac7ea
Merge branch 'main' into developer 2024-11-12 16:44:15 +01:00