HDF5_BLS.load_data

Functions

load_dat_file(filepath[, creator, ...])

Loads DAT files.

load_general(filepath[, creator, ...])

Loads files based on their extensions

load_image_file(filepath[, parameters, ...])

Loads image files using Pillow

load_npy_file(filepath[, brillouin_type])

Loads npy files

load_sif_file(filepath[, parameters, ...])

Loads npy files

HDF5_BLS.load_data.load_dat_file(filepath, creator=None, parameters=None, brillouin_type=None)[source]

Loads DAT files. The DAT files that can be read are obtained from the following configurations: - GHOST software (fixed brillouin type: PSD) - Time Domain measures (fixed brillouin type: Raw_data)

Parameters:
  • filepath (str) – The filepath to the GHOST file

  • creator (str, optional) – The way this dat file has to be loaded. If None, an error is raised. Possible values are: - “GHOST”: the file is assumed to be a GHOST file - “TimeDomain”: the file is assumed to be a TimeDomain file

  • brillouin_type (str, optional) – The brillouin type of the file (not relevant for .dat files)

Returns:

The dictionary with the data and the attributes of the file stored respectively in the keys “Data” and “Attributes”. For time domain files, the dictionary also contains the time vector in the key “Abscissa_dt”.

Return type:

dict

HDF5_BLS.load_data.load_general(filepath, creator=None, parameters=None, brillouin_type=None)[source]

Loads files based on their extensions

Parameters:
  • filepath (str) – The filepath to the file

  • creator (str) – An argument to specify how the data was created, useful when the extension of the file is not enough to determine the type of data.

  • parameters (dict) – A dictionary containing the parameters to be used to interpret the data, for example when multiple files need to be combined to obtain the dataset to add.

  • brillouin_type (str) – The brillouin type of the dataset to load. Please refer to the documentation of the Brillouin software for the possible values.

Returns:

The dictionary created with the given filepath and eventually parameters.

Return type:

dict

HDF5_BLS.load_data.load_image_file(filepath, parameters=None, brillouin_type=None)[source]

Loads image files using Pillow

Parameters:
  • filepath (str) – The filepath to the image

  • parameters (dict, optional) – A dictionary with the parameters to load the data, by default None. Please refer to the Note section of this docstring for more information.

  • brillouin_type (str, optional) – The brillouin type of the file.

Returns:

The dictionary with the data and the attributes of the file stored respectively in the keys “Data” and “Attributes”

Return type:

dict

Note

Possible parameters are: grayscale: bool, optional

If True, the image is converted to grayscale, by default False

HDF5_BLS.load_data.load_npy_file(filepath, brillouin_type=None)[source]

Loads npy files

Parameters:
  • filepath (str) – The filepath to the npy file

  • brillouin_type (str, optional) – The brillouin type of the file.

Returns:

The dictionary with the data and the attributes of the file stored respectively in the keys “Data” and “Attributes”

Return type:

dict

HDF5_BLS.load_data.load_sif_file(filepath, parameters=None, brillouin_type=None)[source]

Loads npy files

Parameters:
  • filepath (str) – The filepath to the npy file

  • brillouin_type (str, optional) – The brillouin type of the file. Not relevant for sif files

Returns:

The dictionary with the data and the attributes of the file stored respectively in the keys “Data” and “Attributes”

Return type:

dict