Skip to content

Commit

Permalink
add Note and example
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisjonesBSU committed Mar 5, 2024
1 parent bc539bd commit 1dd0e65
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions cmeutils/structure.py
Original file line number Diff line number Diff line change
Expand Up @@ -755,6 +755,30 @@ def concentration_profile(snap, A_indices, B_indices, n_bins=70, box_axis=0):
Particle count for species B in each bin.
total_count : numpy array
Total particle count in each bin.
Notes
-----
Use this to create a concentration profile plot of "left" species
and "right" species in the simulations volume.
Example::
# Plot the concentration profile for a snapshot with 200 particles
# "left" species are particles 0-99 and "right" species are 100-199
from cmeutils.structure import concentration_profile
import matplotlib.pyplot as plt
x_range, left, right, total = concentration_profile(
snap=snapshot,
A_indices=range(0, 100),
B_indices=range(100, 200),
n_bins=50,
box_axis=0
)
plt.plot(x_range, left/total)
plt.plot(x_range, right/total)
"""

L = snap.configuration.box[box_axis]
Expand Down

0 comments on commit 1dd0e65

Please sign in to comment.