searchep.data#
- class searchep.data.Data(filename: str, directory: str, output_name: int = 2, evs_ep: bool = True, input_parameters: dict | str | None = None, distance: float = 3e-06)#
Data class containing all relevant Data
Save and update all relevant values during the training process.
- __init__(filename: str, directory: str, output_name: int = 2, evs_ep: bool = True, input_parameters: dict | str | None = None, distance: float = 3e-06)#
Constructor of the Data class
- Parameters:
filename (str) – Name of file which contains the relevant data
directory (str) – Absolute path to working directory
output_name (int, optional) – For new calculations a new file is created and this parameter controls the number of this new input file
evs_ep (bool, optional) – If the given file contains only the eigenvalues of the EP and the corresponding kappa and phi values this parameter should be True and if not it should be False
input_parameters (Union[dict, str], optional) – The parameters of the input file. Default are listed in User Guide. A filename of the input file which contains the parameters or a dictionary which contains the relevant parameters which are different from the default ones
distance (float, optional) – Distance between first and last eigenvalue after one circulation. Needed for function initial_dataset
- searchep.data.get_permutations(vec: ndarray, vec_normalized: ndarray | None = None, distance: float = 3e-06)#
Get permutations
Returns all eigenvalues which perform a permutation by calculating the difference between the first and last entry. Utilizes the stepwise grouping algorithm.
- Parameters:
vec (np.ndarray) – Array, which should be grouped. Two- or three-dimensional array, depending on the number of variables for which the pairwise distance is calculated.
vec_normalized (np.ndarray, optional) – Array with normalized entries or even more variable than vec, which is used to group vec. If not specified, vec is used for grouping.
distance (float, optional) – Distance between start and end of a loop, by default 3.e-6.
- Returns:
Usually 2D array containing the all eigenvalues performing a permutation
- Return type:
np.ndarray
- searchep.data.getting_new_ev_of_ep(data: Data, gpflow_model: GPFlowModel, new_calculations: bool = True, eval_plots: bool = True, plot_name: str = '') ndarray #
Getting new eigenvalues belonging to the EP
Selecting the two eigenvalues of a new point belonging to the EP by comparing it to a GPR model prediction and its variance.
- Parameters:
data (data.Data) – Class which contains all scale-, kappa- and eigenvalues
gpflow_model (GPFlow_model_class.GPFlowModel) – Class which contains both 2D GPR models
new_calculations (bool, optional) – Controls if it is a new calculation and if not the kappa value needs to be read as well and no extra calculation of the eigenvalues has to be started, by default True
eval_plots (bool, optional) – Controls if compatibility and selected eigenvalues should be plotted or not, by default True
plot_name (str, optional) – Specifies special name for plot files, by default “”
- Returns:
2D array containing all old and the new eigenvalues belonging to the EP
- Return type:
np.ndarray
- searchep.data.initial_dataset_old(vec: ndarray, vec_normalized: ndarray, distance: float = 3e-06) ndarray #
Get initial dataset
Selecting the eigenvalues belonging to the EP by ordering all eigenvalues and comparing the first end last point. If it is greater than 0 the eigenvalues exchange their positions and belong to the EP.
- Parameters:
vec –
vec_normalized –
ev (np.ndarray) – All exact complex eigenvalues
distance (float, optional) – Distance between start and end of a loop, by default 3.e-6
- Returns:
Usually 2D array containing the two eigenvalues belonging to the EP
- Return type:
np.ndarray
- searchep.data.load_dat_file(filename: str) Tuple[ndarray, ndarray, ndarray, ndarray, ndarray] #
Load dat file (output of external program)
Data file containing all kappa values, angles and respective eigenvalues.
- Parameters:
filename (str) – Absolute path to dat file
- Returns:
First return is the kappa array which contains every kappa value only once. Second return is an array containing all eigenvalues where each row belongs to one kappa value. Third return is the phi array similar to the kappa array.
- Return type:
(np.ndarray, np.ndarray, np.ndarray)
- searchep.data.read_new_ev(data: Data, new_calculations=True) ndarray #
Reads the eigenvalues of a new diagonalization
- Parameters:
data (Data) – Class which contains all scale-, kappa- and eigenvalues
new_calculations (bool, optional) – Controls if it is a new calculation and if not the kappa value needs to be read as well, by default True
- Returns:
All eigenvalues of the new diagonalization
- Return type:
np.ndarray
- searchep.data.start_exact_calculation(data: Data)#
Star new exact calculation of the eigenvalues
- Parameters:
data (Data) – Class which contains all scale-, kappa- and eigenvalues
- searchep.data.stepwise_grouping(vec: ndarray, vec_normalized: ndarray | None = None) ndarray #
Stepwise grouping algorithm
Stepwise grouping of array with respect to the shortest distance between each step and avoiding multiple selection. For more details see master thesis of Patrick Egenlauf, 2023.
- Parameters:
vec (np.ndarray) – Array, which should be grouped. Two- or three-dimensional array, depending on the number of variables for which the pairwise distance is calculated.
vec_normalized (np.ndarray, optional) – Array with normalized entries or even more variable than vec, which is used to group vec. If not specified, vec is used for grouping.
- Returns:
Grouped array vec
- Return type:
np.ndarray