removed unneccessary dependancies
Build the documentation and deploy it to Gitea Pages / build-and-deploy (push) Failing after 38s
Build the documentation and deploy it to Gitea Pages / build-and-deploy (push) Failing after 38s
This commit is contained in:
1 parent
7f598f8962
commit
cd1985f851
4 files changed
+18
-16
No files matched your search
@@ -2,7 +2,6 @@ import math
|
||||
import os
|
||||
from concurrent.futures import ThreadPoolExecutor
|
||||
from pathlib import Path
|
||||
from pyexpat import model
|
||||
import time
|
||||
from aare import JungfrauDataFile, File, random_pixel, Pol1, Minimizer
|
||||
from aare.experimental import MultiThreadedFileReader
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
from .helpers import *
|
||||
|
||||
from .JungfrauCalibration import *
|
||||
|
||||
from .JungfrauFitParameters import *
|
||||
|
||||
+8
-8
@@ -151,35 +151,35 @@ def plot_parameter_histogram(fitted_parameter: np.ndarray, parameter_name : str,
|
||||
case Parameters.ELASTIC_SCATTERING_INTERCEPT.value:
|
||||
data = fitted_parameter[:, :, 0].flatten()
|
||||
histogram = create_histogram_from_data(data, bin_range = bin_range, bin_width = bin_width)
|
||||
ax = plot_histogram(histogram, histogram.axes[0].centers[:], xlabel=r"Elastic scattering intercept", label = f"Mean: {np.mean(data):.3f}\nStd: {np.std(data):.3f}", axis=axis)
|
||||
ax = plot_histogram(histogram.values(), histogram.bin_centers(), xlabel=r"Elastic scattering intercept", label = f"Mean: {np.mean(data):.3f}\nStd: {np.std(data):.3f}", axis=axis)
|
||||
case Parameters.ELASTIC_SCATTERING_SLOPE.value:
|
||||
data = fitted_parameter[:, :, 1].flatten()
|
||||
histogram = create_histogram_from_data(data, bin_range = bin_range, bin_width = bin_width)
|
||||
ax = plot_histogram(histogram, histogram.axes[0].centers[:], xlabel=r"Elastic scattering slope", label = f"Mean: {np.mean(data):.3f}\nStd: {np.std(data):.3f}", axis=axis)
|
||||
ax = plot_histogram(histogram.values(), histogram.bin_centers(), xlabel=r"Elastic scattering slope", label = f"Mean: {np.mean(data):.3f}\nStd: {np.std(data):.3f}", axis=axis)
|
||||
case Parameters.K_ALPHA_MEAN.value:
|
||||
data = fitted_parameter[:, :, 2].flatten()
|
||||
histogram = create_histogram_from_data(data, bin_range = bin_range, bin_width = bin_width)
|
||||
ax = plot_histogram(histogram, histogram.axes[0].centers[:], xlabel=r"$k_\alpha$ mean", label = f"Mean: {np.mean(data):.3f}\nStd: {np.std(data):.3f}", axis=axis)
|
||||
ax = plot_histogram(histogram.values(), histogram.bin_centers(), xlabel=r"$k_\alpha$ mean", label = f"Mean: {np.mean(data):.3f}\nStd: {np.std(data):.3f}", axis=axis)
|
||||
case Parameters.SIGMA.value:
|
||||
data = fitted_parameter[:, :, 3].flatten()
|
||||
histogram = create_histogram_from_data(data, bin_range = bin_range, bin_width = bin_width)
|
||||
ax = plot_histogram(histogram, histogram.axes[0].centers[:], xlabel=r"$\sigma$", label = f"Mean: {np.mean(data):.3f}\nStd: {np.std(data):.3f}", axis=axis)
|
||||
ax = plot_histogram(histogram.values(), histogram.bin_centers(), xlabel=r"$\sigma$", label = f"Mean: {np.mean(data):.3f}\nStd: {np.std(data):.3f}", axis=axis)
|
||||
case Parameters.K_ALPHA_AMPLITUDE.value:
|
||||
data = fitted_parameter[:, :, 4].flatten()
|
||||
histogram = create_histogram_from_data(data, bin_range = bin_range, bin_width = bin_width)
|
||||
ax = plot_histogram(histogram, histogram.axes[0].centers[:], xlabel=r"$k_\alpha$ amplitude", label = f"Mean: {np.mean(data):.3f}\nStd: {np.std(data):.3f}", axis=axis)
|
||||
ax = plot_histogram(histogram.values(), histogram.bin_centers(), xlabel=r"$k_\alpha$ amplitude", label = f"Mean: {np.mean(data):.3f}\nStd: {np.std(data):.3f}", axis=axis)
|
||||
case Parameters.RATIO_AMPLITUDE_CHARGE_SHARING.value:
|
||||
data = fitted_parameter[:, :, 5].flatten()
|
||||
histogram = create_histogram_from_data(data, bin_range = bin_range, bin_width = bin_width)
|
||||
ax = plot_histogram(histogram, histogram.axes[0].centers[:], xlabel=r"Ratio amplitude charge sharing", label = f"Mean: {np.mean(data):.3f}\nStd: {np.std(data):.3f}", axis=axis)
|
||||
ax = plot_histogram(histogram.values(), histogram.bin_centers(), xlabel=r"Ratio amplitude charge sharing", label = f"Mean: {np.mean(data):.3f}\nStd: {np.std(data):.3f}", axis=axis)
|
||||
case Parameters.RATIO_MEAN_K_BETA.value:
|
||||
data = fitted_parameter[:, :, 6].flatten()
|
||||
histogram = create_histogram_from_data(data, bin_range = bin_range, bin_width = bin_width)
|
||||
ax = plot_histogram(histogram, histogram.axes[0].centers[:], xlabel=r"Ratio $k_\beta$ mean", label = f"Mean: {np.mean(data):.3f}\nStd: {np.std(data):.3f}", axis=axis)
|
||||
ax = plot_histogram(histogram.values(), histogram.bin_centers(), xlabel=r"Ratio $k_\beta$ mean", label = f"Mean: {np.mean(data):.3f}\nStd: {np.std(data):.3f}", axis=axis)
|
||||
case Parameters.RATIO_AMPLITUDE_K_BETA.value:
|
||||
data = fitted_parameter[:, :, 7].flatten()
|
||||
histogram = create_histogram_from_data(data, bin_range = bin_range, bin_width = bin_width)
|
||||
ax = plot_histogram(histogram, histogram.axes[0].centers[:], xlabel=r"Ratio $k_\beta$ amplitude", label = f"Mean: {np.mean(data):.3f}\nStd: {np.std(data):.3f}", axis=axis)
|
||||
ax = plot_histogram(histogram.values(), histogram.bin_centers(), xlabel=r"Ratio $k_\beta$ amplitude", label = f"Mean: {np.mean(data):.3f}\nStd: {np.std(data):.3f}", axis=axis)
|
||||
case _:
|
||||
raise ValueError(f"Unknown parameter name: {parameter_name}. Valid options are: {[param.value for param in Parameters]}")
|
||||
|
||||
|
||||
+10
-5
@@ -1,7 +1,6 @@
|
||||
import glob
|
||||
from pathlib import Path
|
||||
|
||||
import boost_histogram as bh
|
||||
from aare import PixelHistogram
|
||||
import numpy as np
|
||||
|
||||
from .DataClasses import HistogramResult, LinearFitResult, JungfrauCalibrationResult
|
||||
@@ -197,7 +196,7 @@ def create_histogram_from_data(data : np.ndarray, bin_range : tuple[float, float
|
||||
Parameters
|
||||
----------
|
||||
data : np.ndarray
|
||||
The data to create the histogram from.
|
||||
The 2d data to create the histogram from.
|
||||
bin_range : tuple[float, float], optional
|
||||
The range of the bins. Default is None, which means the range is determined from the data.
|
||||
bin_width : float, optional
|
||||
@@ -219,8 +218,14 @@ def create_histogram_from_data(data : np.ndarray, bin_range : tuple[float, float
|
||||
print("bin width: ", (bin_range[1] - bin_range[0]) / bins)
|
||||
else:
|
||||
bins = int((bin_range[1] - bin_range[0]) / bin_width)
|
||||
|
||||
if data.ndim == 2:
|
||||
rows, cols = data.shape
|
||||
else:
|
||||
raise ValueError(f"Data must be 2D or 3D, but got {data.ndim}D.")
|
||||
|
||||
hist = PixelHistogram(rows = rows, cols = cols, n_bins = bins, xmin = bin_range[0], xmax = bin_range[1], n_threads = 8)
|
||||
|
||||
hist.fill_async(data)
|
||||
|
||||
hist = bh.Histogram(bh.axis.Regular(bins, bin_range[0], bin_range[1]))
|
||||
hist.fill(data)
|
||||
return hist
|
||||
Reference in new issue
Block a user