mlreflect.utils package
Submodules
mlreflect.utils.check_gpu module
mlreflect.utils.h5_tools module
- mlreflect.utils.h5_tools.create_dataset_with_override(file: h5py._hl.files.File, name: Any, data: Any)[source]
Create dataset and delete already existing one with the same name.
- mlreflect.utils.h5_tools.load_data(file_name: str) dict [source]
Reads all data in h5 file
file_name
and returns them as a dict.
- mlreflect.utils.h5_tools.save_background(file_name: str, bg_array: numpy.ndarray, bg_levels: numpy.ndarray)[source]
- mlreflect.utils.h5_tools.save_data_as_h5(file_name: str, q_values: numpy.ndarray, reflectivity: numpy.ndarray, labels: pandas.core.frame.DataFrame, number_of_layers: int)[source]
Saves
q_values
,reflectivity
andlabels
in the .5h filefile_name
. Labels are saved as pandas DataFrame.- Parameters
file_name – Name or path of the .h5 file
q_values – ndarray of q values in units 1/A
reflectivity – n-by-m ndarray of reflectivity curves where n is the number of curves and m the number
q-values (of) –
labels – pandas DataFrame of labels
number_of_layers – Number of thin film layers that were simulated (excluding ambient layer)