A minimal Python package for creating plots of slices through DAGMC geometry
Project description
A minimal Python package that produces slice plots through h5m DAGMC geometry files
Installation
pip install dagmc_geometry_slice_plotter
Python API Usage
These examples assume you have a h5m file called dagmc.h5m
in the same
folder that the Python script is being run from.
Create a plot of a slice through the geometry perpendicular to the Z axis and default settings elsewhere. This will slice through the the center of the geometry as plane_origin has not been specified.
from dagmc_geometry_slice_plotter import plot_slice_of_dagmc_geometry
plot = plot_slice_of_dagmc_geometry(
dagmc_file_or_trimesh_object='dagmc.h5m',
plane_normal=[0, 0, 1],
)
plot.show()
Create a plot of a slice through the geometry perpendicular to the Z axis, offset by 200cm and with default settings elsewhere.
from dagmc_geometry_slice_plotter import plot_slice_of_dagmc_geometry
plot = plot_slice_of_dagmc_geometry(
dagmc_file_or_trimesh_object='dagmc.h5m',
plane_origin=[0, 0, 200],
plane_normal=[0, 0, 1],
)
plot.show()
Create a plot of a slice through the geometry perpendicular to the Y axis, with a rotation of 45 degrees and with default settings elsewhere. Also saves the plot with a high resolution (DPI)
from dagmc_geometry_slice_plotter import plot_slice_of_dagmc_geometry
plot = plot_slice_of_dagmc_geometry(
dagmc_file_or_trimesh_object='dagmc.h5m',
plane_normal=[0, 1, 0],
rotate_plot=45,
)
plot.savefig('example_3_slice.png', dpi=600)
Saves a png image of a plot of a slice through the geometry perpendicular to the X axis and with default settings elsewhere.
from dagmc_geometry_slice_plotter import plot_slice_of_dagmc_geometry
plot = plot_slice_of_dagmc_geometry(
dagmc_file_or_trimesh_object='dagmc.h5m',
plane_normal = [1, 0, 0],
rotate_plot=270,
)
plot.savefig('example_4_slice.png')
Related packages
This package is used by the regular_mesh_plotter Python package to combine slice plots with regular mesh tally results and produce images like below.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for dagmc_geometry_slice_plotter-0.1.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | dbe0d17e534d5d0dcfc068eaed56a3fb63f3d4d44e418f8047cfbc60058d55ab |
|
MD5 | e7fcd1e0ea51a49f0ffc8ef5d7b8c6cd |
|
BLAKE2b-256 | 4f29585bbf2b823c3b8ab6a4ed772802e424cc64051a06c0084ea7cd9b72701d |
Hashes for dagmc_geometry_slice_plotter-0.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 75c0d11220fbb5839380f655e40d44b07e932f13390a1b4f4ea8de2847d78423 |
|
MD5 | eeb03c2b3801de5e85ba9f0f7ccb5e60 |
|
BLAKE2b-256 | 1309102e6cf86a9c864f0c178afc7bd224fccceda4d96f1cc1f6b28c9fc3132c |