openmc.lib.slice_data
- openmc.lib.slice_data(origin, width=None, basis='xy', u_span=None, v_span=None, pixels=None, show_overlaps=False, level=None, filter=None, include_properties=True)[source]
Generate a 2D raster of geometry and property data for plotting.
Added in version 0.16.0.
- Parameters:
origin (sequence of float) – Center position of the plot [x, y, z]
width (sequence of float) – Width of the plot [horizontal, vertical]. Mutually exclusive with u_span/v_span.
basis ({'xy', 'xz', 'yz'} or int) – Plot basis. Ignored if u_span/v_span are provided.
u_span (sequence of float, optional) – Full-width span vector for the horizontal axis (3 values). Mutually exclusive with width.
v_span (sequence of float, optional) – Full-height span vector for the vertical axis (3 values). Mutually exclusive with width.
pixels (sequence of int) – Number of pixels [horizontal, vertical]
show_overlaps (bool, optional) – Whether to detect overlapping cells
level (int, optional) – Universe level (None for deepest)
filter (openmc.lib.Filter, optional) – Filter for bin index lookup
include_properties (bool, optional) – Whether to compute temperature/density
- Returns:
geom_data (numpy.ndarray) – Array of shape (v_res, h_res, 3) or (v_res, h_res, 4) with int32 dtype. Contains [cell_id, cell_instance, material_id] when no filter is provided, or [cell_id, cell_instance, material_id, filter_bin] when a filter is provided.
property_data (numpy.ndarray or None) – Array of shape (v_res, h_res, 2) with float64 dtype containing [temperature, density], or None if include_properties=False