nabu.misc.histogram_cuda module¶
- class nabu.misc.histogram_cuda.CudaPartialHistogram(method='fixed_bins_number', bin_width='uint16', num_bins=None, min_bins=None, cuda_options=None)[source]¶
Bases:
PartialHistogram
Initialize a PartialHistogram class.
- Parameters:
method (str, optional) –
- Partial histogram computing method. Available are:
fixed_bins_width: all the histograms are computed with the same bin width. The class adapts to the data range and computes the number of bins accordingly.
fixed_bins_number: all the histograms are computed with the same number of bins. The class adapts to the data range and computes the bin width accordingly.
Default is “fixed_bins_width”
bin_width (str or float, optional) –
- Policy for histogram bins when method=”fixed_bins_width”. Available are:
”uint16”: The bin width is computed so that floating-point elements f1 and f2 satisfying |f1 - f2| < bin_width implies f1_converted - f2_converted < 1 once cast to uint16.
A number: all the bins have this fixed width.
Default is “uint16”
num_bins (int, optional) – Number of bins when method = ‘fixed_bins_number’.
min_bins (int, optional) – Minimum number of bins when method = ‘fixed_bins_width’.
backend (str, optional) – Which histogram backend to use for computations. Available are “silx”, “numpy”. Fastest is “silx”.
- class nabu.misc.histogram_cuda.CudaVolumeHistogram(data_url, chunk_size_slices=100, chunk_size_GB=None, nbins=1000000.0, logger=None, cuda_options=None)[source]¶
Bases:
VolumeHistogram
Initialize a VolumeHistogram object.
- Parameters:
fname (DataUrl) – DataUrl to the HDF5 file.
chunk_size_slices (int, optional) – Compute partial histograms of groups of slices. This is the default behavior, where the groups size is 100 slices. This parameter is mutually exclusive with ‘chunk_size_GB’.
chunk_size_GB (float, optional) – Maximum memory (in GB) to use when computing the histogram by group of slices. This parameter is mutually exclusive with ‘chunk_size_slices’.
nbins (int, optional) – Histogram number of bins. Default is 1e6.