Skip to content

Commit

Permalink
add comment about making sliceplots
Browse files Browse the repository at this point in the history
  • Loading branch information
zhichen3 committed Oct 29, 2024
1 parent 1d5ff06 commit 5a13fc5
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Exec/science/xrb_spherical/analysis/slice.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
import matplotlib.pyplot as plt
from yt.frontends.boxlib.api import CastroDataset

from yt.units import cm

"""
Given a plot file and field name, it gives slice plots at the top,
middle, and bottom of the domain (shell).
Expand Down Expand Up @@ -54,8 +56,10 @@ def slice(fname:str, field:str,
"mid":(r_center*np.sin(theta_center), r_center*np.cos(theta_center)),
"bot":(r_center*np.sin(thetar)+0.5*width, r_center*np.cos(thetar))}

sp = yt.SlicePlot(ds, 'phi', field, width=box_widths)
# Note we can also set center during SlicePlot, however then we would enter in [r_center, theta_center, 0]
# rather than the physical R-Z coordinate if we do it via sp.set_center

sp = yt.SlicePlot(ds, 'phi', field, width=box_widths)
sp.set_center(centers[loc])

sp.set_cmap(field, "viridis")
Expand Down

0 comments on commit 5a13fc5

Please sign in to comment.