pylbo.utilities.datfiles.file_loader

Module Contents

Functions

_validate_file(file)

Checks the file validity of a given logfile or datfile.

load(datfile)

Loads a single Legolas datfile.

load_series(datfiles)

Loads multiple Legolas datfiles.

load_logfile(logfile[, sort])

Reads a Legolas log file.

select_files()

Opens an interactive window to select files to open.

pylbo.utilities.datfiles.file_loader._validate_file(file)[source]

Checks the file validity of a given logfile or datfile.

Parameters:

file (str, PathLike) – The path to the datfile, either as a str or PathLike object.

Raises:
pylbo.utilities.datfiles.file_loader.load(datfile)[source]

Loads a single Legolas datfile.

Parameters:

datfile (str, PathLike) – Path to the datfile.

Raises:

ValueError – If datfile is not a single file.

Returns:

ds – A dataset instance for the given datfile.

Return type:

LegolasDataSet

pylbo.utilities.datfiles.file_loader.load_series(datfiles)[source]

Loads multiple Legolas datfiles.

Parameters:

datfiles (list, numpy.ndarray) – Paths to the datfiles that should be loaded, in list/array form. Every element should be a string or a ~os.PathLike object.

Raises:

ValueError – If an empty list or array is supplied.

Returns:

series – A dataseries instance for the given datfiles.

Return type:

LegolasDataSeries

pylbo.utilities.datfiles.file_loader.load_logfile(logfile, sort=False)[source]

Reads a Legolas log file.

Parameters:
  • logfile (str, PathLike) – The path to the logfile.

  • sort (bool) – If True, sorts the eigenvalues in the logfile. Sorting is done first on the real part, then on the imaginary part.

Returns:

eigenvalues – Array containing the eigenvalues from the logfile.

Return type:

numpy.ndarray

pylbo.utilities.datfiles.file_loader.select_files()[source]

Opens an interactive window to select files to open. Requires a visual interface.

Returns:

files – A list containing the paths to the files selected.

Return type:

list