Skip to content

Commit

Permalink
update script
Browse files Browse the repository at this point in the history
  • Loading branch information
zhichen3 committed Oct 29, 2024
1 parent 7d48637 commit 1d5ff06
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions Exec/science/xrb_spherical/analysis/r_profile.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
rmin = ds.domain_left_edge[0]
rmax = rmin + 5000.0*cm
#rmax = ds.domain_right_edge[0]

print(ds.domain_left_edge[1])
fig, _ax = plt.subplots(2,2)

axes = list(itertools.chain(*_ax))
Expand All @@ -32,13 +32,14 @@
nice_names = [r"$T$ (K)", r"$\rho$ (g/${cm}^3$)", r"$u$ (cm/s)", r"$v$ (cm/s)"]

# 4 rays at different theta values
thetas = [0, 0.125*np.pi, 0.25*np.pi, 0.5*np.pi]
thetas = [0, 0.0155625*np.pi, 0.03125*np.pi]

for i, f in enumerate(fields):

for theta in thetas:
ray = ds.ray((rmin*np.sin(theta), rmin*np.cos(theta), 0*cm),
(rmax*np.sin(theta), rmax*np.cos(theta), 0*cm))
# simply go from (rmin, theta) -> (rmax, theta). Doesn't need to convert to physical R-Z
ray = ds.ray((rmin, theta*cm, 0*cm),
(rmax, theta*cm, 0*cm))
isrt = np.argsort(ray["t"])
axes[i].plot(ray['r'][isrt], ray[f][isrt], label=r"$\theta$ = {:.4f}".format(theta))

Expand Down

0 comments on commit 1d5ff06

Please sign in to comment.