Skip to content

Conversation

@austin-hoover
Copy link
Contributor

This PR adds the BunchHistogram class to the orbit.diagnostics module. The class uses the grid objects from orbit.core.spacecharge (Grid1D, Grid2D, Grid3D) to compute 1D, 2D, or 3D histograms (3D not working yet #47). It will work with MPI. This extends the current orbit.diagnostics.profiles function, which computes 1D histograms.

The data is optionally saved using xarray format. The user can load the data and retreive the grid, values, grid coordinates, and dimension names.

Tests

Note that the histogram is smoothed since the grid classes using cloud-in-cell weighting.

1D Test (https://github.com/austin-hoover/PyORBIT3/blob/hist/examples/Diagnostics/Histogram/test_hist_1d.py):

fig_hist

2D Test (https://github.com/austin-hoover/PyORBIT3/blob/hist/examples/Diagnostics/Histogram/test_hist_2d.py):

fig_hist

@austin-hoover austin-hoover added the enhancement New feature or request label Sep 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant