This PR is a fix/improvement to a problem that Jonathan had. (#156) The
original implementation opened all subfiles at once witch works for
normal sized datasets but fails at a certain point (thousands of files).
- This solution uses RawSubFile to manage the different file indicies
and only opens the file we need
- Added logger.h from slsDetectorPackage for debug printing (in
production no messages should be visible)
- added scurve fitting with two different signs (scurve, scurve2)
- at the moment no option to set initial parameters
---------
Co-authored-by: JulianHeymes <julian.heymes@psi.ch>
Changes to be able to run the example notebooks:
- Invert gain map on setting (multiplication is faster but user supplies
ADU/energy)
- Cast after applying gain map not to loose precision (Important for
int32 clusters)
- "factor" for ClusterFileSink
- Cluster size available to be able to create the right file sink
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>
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
- 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