BGlib.be.translators.df_utils.be_utils.BEHistogram

class BGlib.be.translators.df_utils.be_utils.BEHistogram[source]

Bases: object

Class just functions as a container so we can have shared objects Chris Smith – csmith55@utk.edu

Methods

addBEHist

This function adds Histgrams from the Main Data to the Plot Groups for an existing hdf5 BEPS datafile.

buildBEHist

Creates Histograms from dataset

buildPlotGroupHist

Creates Histograms for a given plot group

addBEHist(h5_path, max_mem_mb=1024, show_plot=True, save_plot=True)[source]

This function adds Histgrams from the Main Data to the Plot Groups for an existing hdf5 BEPS datafile.

Parameters:
  • h5_path (string) – the path to the hdf5 datafile

  • max_mem_mb (unsigned integer) – the maximum amount of memory to use during the binning

  • show_plot (Boolean) – Should plot of the histograms be drawn after they are created

  • save_plot (Boolean) – Should plots of the histograms be saved

Return type:

None

buildBEHist(h5_main, max_response=[], min_response=[], max_mem_mb=1024, max_bins=256, debug=False)[source]

Creates Histograms from dataset

Parameters:
  • h5_main (hdf5.Dataset) –

  • max_response (list) –

  • min_response (list) –

  • max_mem_mb (int) –

  • max_bins (int) –

  • debug (bool) –

buildPlotGroupHist(h5_main, active_spec_steps, max_response=[], min_response=[], max_mem_mb=1024, max_bins=256, std_mult=3, debug=False)[source]

Creates Histograms for a given plot group

Parameters:
  • h5_main (HDF5 Dataset object) – Dataset to be historammed

  • active_spec_steps (numpy array) – active spectral steps in the current plot group

  • max_response (numpy array) – maximum amplitude at each pixel

  • min_response (numpy array) – minimum amplitude at each pixel

  • max_mem_mb (Unsigned integer) – maximum number of Mb allowed for use. Used to calculate the number of pixels to load in a chunk

  • max_bins (integer) – maximum number of spectroscopic bins

  • std_mult (integer) – number of standard deviations from the mean of max_response and min_response to include in binning

  • debug (boolean) – Turns on debug printing statements if true. Default False.

Returns:

  • hist_mat (2d numpy array) – 4 histograms as 1d arrays

  • hist_labels (list of strings) – names for the 4 rows in hist_mat

  • hist_indices (2d numpy array) – the frequency and spectroscopic bins of each column in hist_mat

  • hist_index_labels (list of strings) – labels for the hist_indices array