ferrodispcalc.vis package
Submodules
ferrodispcalc.vis.grid module
ferrodispcalc.vis.line_plot module
ferrodispcalc.vis.plane_plot module
- ferrodispcalc.vis.plane_plot.plane_profile(data: ndarray, save_dir: str | Path = 'plane_plots', relative: bool = True, select: Dict[str, List[int]] | None = None, hot: bool = True, fig_size: str | Tuple[float, float] = 'auto') None[source]
Plot 2D cross-sections of 3D vector data.
Parameters:
- data: np.ndarray
The 4D vector data in (nx, ny, nz, 3) format.
- save_dir: str | Path
The directory to save the plots.
- relative: bool
Whether to plot the vector in the relative scale (default True).
- select: dict, optional
The selected layers to plot. Keys should be ‘x’, ‘y’, ‘z’ (for YZ, XZ, XY planes respectively). e.g., {‘z’: [0, 1], ‘y’: [0]} If None, all layers are plotted.
- hot: bool
Whether to plot the angle in the hot colormap (default True).
- fig_size: str | tuple
The figure size: ‘auto’, ‘default’, or a (width, height) tuple.
- ferrodispcalc.vis.plane_plot.plane_profile_multi(data: ndarray, select: List[str | int | slice | List[int]], save_name: str | Path = 'plane_plots.gif', relative: bool = True, hot: bool = True, fig_size: str | Tuple[float, float] = 'auto', fps: int = 10)[source]
Plot 2D cross-sections of 5D vector data (nframe, nx, ny, nz, 3) and save as a GIF using matplotlib.animation. (使用 matplotlib.animation 绘制 5D 矢量数据的 2D 横截面并另存为 GIF)
Parameters:
- data: np.ndarray
The 5D vector data in (nframe, nx, ny, nz, 3) format.
- select: list
Defines the plot. Format: [plane_name, layer_index, frame_spec] e.g., [‘xz’, 0, slice(0, None, 2)] -> XZ plane, y_index=0, every 2nd frame.
- save_name: str | Path
The output filename (e.g., ‘animation.gif’).
- relative: bool
Whether to plot the vector in the relative scale.
- hot: bool
Whether to plot the angle in the hot colormap.
- fig_size: str | tuple
The figure size: ‘auto’, ‘default’, or a (width, height) tuple.
- fps: int
Frames per second for the output GIF.
ferrodispcalc.vis.space_plot module
Module contents
- ferrodispcalc.vis.grid_data(atoms: Atoms, data: ndarray, element: list[str], target_size: tuple[int, int, int] | None = None, tol: float = 1.0, axis: tuple[tuple, tuple, tuple] = ((1, 0, 0), (0, 1, 0), (0, 0, 1)), return_coord: bool = False) ndarray | tuple[ndarray, ndarray][source]
- ferrodispcalc.vis.line_profile(data: ndarray, ax: Axes = None, along: str = 'x', savepath: str = None, field_prefix: str = None, call_back: callable = None)[source]
- ferrodispcalc.vis.plane_profile(data: ndarray, save_dir: str | Path = 'plane_plots', relative: bool = True, select: Dict[str, List[int]] | None = None, hot: bool = True, fig_size: str | Tuple[float, float] = 'auto') None[source]
Plot 2D cross-sections of 3D vector data.
Parameters:
- data: np.ndarray
The 4D vector data in (nx, ny, nz, 3) format.
- save_dir: str | Path
The directory to save the plots.
- relative: bool
Whether to plot the vector in the relative scale (default True).
- select: dict, optional
The selected layers to plot. Keys should be ‘x’, ‘y’, ‘z’ (for YZ, XZ, XY planes respectively). e.g., {‘z’: [0, 1], ‘y’: [0]} If None, all layers are plotted.
- hot: bool
Whether to plot the angle in the hot colormap (default True).
- fig_size: str | tuple
The figure size: ‘auto’, ‘default’, or a (width, height) tuple.