2.5.21. prismatique.load.potential_slices
- potential_slices(filename, multi_dim_slice=None, num_superslices=0, average_thermally=False, average_laterally_in_space=False, skip_validation_and_conversion=False)[source]
From a given
prismatiqueoutput file that stores potential slices of a sample, load a specified subcollection of said potential slices into ahyperspysignal.See also the documentation for the class
prismatique.discretization.Paramsfor a discussion on potential slices.- Parameters:
- filenamestr
The relative or absolute path to the file containing the potential slices of interest. Any non-temporary file generated by the function
prismatique.sample.generate_potential_slices(),prismatique.stem.sim.run(), orprismatique.hrtem.sim.run(), with originally a basename of the form"potential_slices_of_subset_"+str(i)+".h5"is valid, whereiis a nonnegative integer.- multi_dim_slicetuple (int | slice | list (int)) | None, optional
The “multidimensional slice object”, which specifies the subcollection of potential slices to load from file. We define a multi-dimensional slice object as a tuple of items which contains at most one item being a list of integers, and the remaining items being slice and/or int objects.
If
multi_dim_sliceis a tuple of length 2, thenmulti_dim_slice[0]specifies a set of atomic configuration indices, where each atomic configuration index corresponds to a frozen phonon configuration; andmulti_dim_slice[1]specifies a set of sample slice indices, where each sample slice index corresponds to a different sample slice at a different \(z\)-coordinate. In this case, the current Python function will load the potential slices of the frozen phonon configurations specified bymulti_dim_slice[0], at the \(z\)-coordinates specified bymulti_dim_slice[1]. Note that a sample slice index \(n\) corresponds to a sample slice at the \(z\)-coordinate \(z_{n}\), where \(z_{n}\) is given by Eq. (2.3.1.5).Otherwise, if
multi_dim_sliceis set to None, then all the potential slices stored in the file are loaded.- num_superslicesint, optional
The number of potential superslices to form from the potential slices to be loaded from file, per frozen phonon configuration. We define a potential superslice as the sum of a group of potential slices. Let
Nbe the total number of potential slices stored in the file per frozen phonon configuration,Mbe the number of slices to be loaded per frozen phonon configuration,n=int(np.ceil(M / max(num_superslices, 1))), andsingle_dim_slice=multi_dim_slice[1] if multi_dim_slice is not None else slice(None). Ifnum_superslicesis a positive int, then for each integerisatisfying0<=i<num_superslices-1, theith superslice is calculated by summing the potential slices with the corresponding indicesnp.arange(N)[single_dim_slice][i*n:(i+1)*n], and fori==num_superslices-1, theith superslice is calculated by summing the potential slices with the corresponding indicesnp.arange(N)[single_dim_slice][i*n:M]. Otherwise, ifnum_superslices==0, then no potential superslices are formed.- average_thermallybool, optional
If
average_thermallyis set toTrue, then the potential slices and superslices are averaged over the selected frozen phonon configurations. Otherwise, the potential slices are not averaged over the selected frozen phonon configurations.- average_laterally_in_spacebool, optional
If
average_laterally_in_spaceis set toTrue, then the potential slices and superslices are averaged laterally in space. Otherwise, the potential slices are not averaged laterally in space.- skip_validation_and_conversionbool, optional
If
skip_validation_and_conversionis set toFalse, then validations and conversions are performed on the above parameters.Otherwise, if
skip_validation_and_conversionis set toTrue, no validations and conversions are performed on the above parameters. This option is desired primarily when the user wants to avoid potentially expensive validation and/or conversion operations.
- Returns:
- potential_slice_signal
hyperspy.signal.BaseSignal|hyperspy._signals.signal2d.Signal2D The subcollection of potential slices, stored in an instance of the
hyperspy._signals.signal2d.Signal2Dclass ifaverage_laterally_in_spaceis set toFalse, otherwise it is stored in an instance of thehyperspy.signal.BaseSignal. See the documentation and/or reference guide for thehyperspypackage for details on how to use instances of thehyperspy._signals.signal2d.Signal2Dandhyperspy.signal.BaseSignalclasses.- navigational_to_original_indices_mapdict
A dictionary that maps the navigational indices of the hyperspy signal
potential_slice_signalto the original indices specified bymulti_dim_slice. For example, if the original atomic configuration indices map to a set of corresponding navigational indices, thennavigational_to_original_indices_map["atomic_config_indices"][i]yields the atomic configuration index specified in the expressionsingle_dim_slice=multi_dim_slice[0] if multi_dim_slice is not None else slice(None)that corresponds to theith atomic configuration index in the nagivation index space ofpotential_slice_signal, whereiis a nonnegative integer smaller than the total number of atomic configuration indices specified insingle_dim_slice.
- potential_slice_signal