spectre.Visualization.PlotSlice

Functions

plot_slice(h5_files, subfile_name, obs_id, ...)

Plot variables on a slice through volume data

points_on_slice(slice_origin, slice_extent, ...)

Returns points on a rectangular slice in 3D.

spectre.Visualization.PlotSlice.plot_slice(h5_files, subfile_name, obs_id, obs_time, var_name, slice_origin, slice_extent, slice_normal, slice_up, extrapolate_into_excisions=False, num_samples=[200, 200], num_threads=None, title=None, data_bounds=None, animate=False, interval=100)

Plot variables on a slice through volume data

Interpolates the volume data in the H5_FILES to a slice and plots the selected variables. You choose the slice by specifying its center, extents, normal, and up direction.

Either select a specific observation in the volume data with ‘–step’ or ‘–time’, or specify ‘–animate’ to produce an animation over all observations.

spectre.Visualization.PlotSlice.points_on_slice(slice_origin: Sequence[float], slice_extent: Sequence[float], slice_normal: Sequence[float], slice_up: Sequence[float], num_points: Sequence[int])

Returns points on a rectangular slice in 3D.

Parameters:
  • slice_origin – Coordinates of the center of the slice.

  • slice_extent – Coordinate extent in both directions of the slice (two numbers).

  • slice_normal – Direction of the normal of the slice.

  • slice_up – Up-direction of the slice.

  • num_points – Number of points to return in each dimension (two numbers).

Returns: An array of shape (3, num_points[0], num_points[1]) with uniformly

spaced points on the slice.