BGlib.be.translators.be_odf.BEodfTranslator

class BGlib.be.translators.be_odf.BEodfTranslator(*args, **kwargs)[source]

Bases: Translator

Translates either the Band Excitation (BE) scan or Band Excitation Polarization Switching (BEPS) data format from the old data format(s) to .h5

Return type:

Translator object

Methods

is_valid_file

Checks whether the provided file can be read by this translator

translate

Translates .dat data file(s) to a single .h5 file

static is_valid_file(data_path)[source]

Checks whether the provided file can be read by this translator

Parameters:

data_path (str) – Path to raw data file

Returns:

obj – Path to file that will be accepted by the translate() function if this translator is indeed capable of translating the provided file. Otherwise, None will be returned

Return type:

str

translate(file_path, show_plots=True, save_plots=True, do_histogram=False, verbose=False)[source]

Translates .dat data file(s) to a single .h5 file

Parameters:
  • file_path (String / Unicode) – Absolute file path for one of the data files. It is assumed that this file is of the OLD data format.

  • show_plots ((optional) Boolean) – Whether or not to show intermediate plots

  • save_plots ((optional) Boolean) – Whether or not to save plots to disk

  • do_histogram ((optional) Boolean) – Whether or not to construct histograms to visualize data quality. Note - this takes a fair amount of time

  • verbose ((optional) Boolean) – Whether or not to print statements

Returns:

h5_path – Absolute path of the resultant .h5 file

Return type:

String / Unicode