2.5.8. prismatique.load.com_momenta
- com_momenta(filename, multi_dim_slice=None, use_two_axes_to_map_probe_position_if_possible=False, skip_validation_and_conversion=False)[source]
From a given STEM simulation output file that stores center of mass (COM) momentum patterns, load a specified subcollection of said COM momentum patterns into a
hyperspysignal.See the documentation for the class
prismatique.stem.output.Paramsfor a discussion on COM momentum patterns.- Parameters:
- filenamestr
The relative or absolute path to the file containing the COM momentum patterns. Any non-temporary file generated by the function
prismatique.stem.sim.run(), with originally the basename"stem_sim_intensity_output.h5"is valid. See the documentation for the classprismatique.stem.output.Paramsfor a discussion on the layout and structuring ofprismatiqueSTEM simulation output files.- multi_dim_slicetuple (int | slice | list (int)) | None, optional
The “multidimensional slice object”, which specifies the subcollection of COM momentum patterns 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, then thenmulti_dim_slice[0]specifies a set of output layer indices, where each output layer index corresponds to a different output layer; andmulti_dim_slice[1]specifies the vector component indices, where the indices0and1would correspond to the \(x\)- and \(y\)-components of the COM momentum respectively. In this case, the current Python function will load the COM momentum patterns generated by electrons exiting from the output layers specified bymulti_dim_slice[0], for the vector components specified bymulti_dim_slice[1]. Note thatprismatique.load.output_layer_depths(filename)[multi_dim_slice[0]]yields the depths of the specified output layers.Otherwise, if
multi_dim_sliceis set to None, then all the COM momentum patterns stored in the file are loaded.- use_two_axes_to_map_probe_position_if_possiblebool, optional
If
use_two_axes_to_map_probe_position_if_possibleis set toTrue, andprismatique.load.scan_pattern_type(filename) == "rectangular grid", then twohyperspyaxes are used rather than one to map the probe position. In this case, the two axes have the same dimensions as the rectangular grid on which the probe positions lie. Otherwise, onehyperspyaxis is used to map the probe positions.- 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:
- com_momentum_signal
hyperspy._signals.signal2d.Signal2D The subcollection of COM momentum patterns, stored in a
hyperspysignal: If two axes are used to map the probe position, then the STEM intensity images are stored in an instance of thehyperspy._signals.signal2d.Signal2Dclass; otherwise they are stored in an instance of thehyperspy._signals.signal1d.Signal1Dclass. See the documentation and/or reference guide for thehyperspypackage for details on how to use instances of thehyperspy._signals.signal1d.Signal1Dandhyperspy._signals.signal2d.Signal2Dclasses.- navigational_to_original_indices_mapdict
A dictionary that maps the navigational indices of the hyperspy signal
com_momentum_signalto the original indices specified bymulti_dim_slice. For example, if the original output layer indices indices map to a set of corresponding navigational indices, thennavigational_to_original_indices_map["output_layer_indices"][i]yields the output layer 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 ofcom_momentum_signal, whereiis a nonnegative integer smaller than the total number of output layers specified insingle_dim_slice.
- com_momentum_signal