BGlib.gmode.translators.general_dynamic_mode.GDMTranslator

class BGlib.gmode.translators.general_dynamic_mode.GDMTranslator(*args, **kwargs)[source]

Bases: Translator

Translates G-mode w^2 datasets from .mat files to .h5

Return type:

Translator object

Methods

is_valid_file

Checks whether the provided file can be read by this translator.

translate

Basic method that translates .mat data files to a single .h5 file

static is_valid_file(file_path, *args, **kwargs)

Checks whether the provided file can be read by this translator.

This basic function compares the file extension against the “extension” keyword argument. If the extension matches, this function returns True

Parameters:

file_path (str) – Path to raw data file

Returns:

file_path – Path to the file that needs to be provided to translate() if the provided file was indeed a valid file Else, None

Return type:

str

translate(parm_path)[source]

Basic method that translates .mat data files to a single .h5 file

Parameters:

parm_path (string / unicode) – Absolute file path of the parameters .mat file.

Returns:

h5_path – Absolute path of the translated h5 file

Return type:

string / unicode