Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use Mollweide Projection for Shell Slices #372

Merged
merged 4 commits into from
Sep 14, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion post_processing/plot_Equatorial_Slices.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@
fig, ax = plt.subplots(figsize=(8,8))
tsize = 20 # title font size
cbfsize = 10 # colorbar font size
img = ax.pcolormesh(X,Y,field,cmap='jet')
img = ax.pcolormesh(X,Y,field,cmap='jet',shading='auto', rasterized=True)
ax.axis('equal') # Ensure that x & y axis ranges have a 1:1 aspect ratio
ax.axis('off') # Do not plot x & y axes

Expand Down
22 changes: 15 additions & 7 deletions post_processing/plot_Shell_Slices.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
#####################################
# Shell Slice
from rayleigh_diagnostics import Shell_Slices
import numpy
import numpy as np
import matplotlib.pyplot as plt
from matplotlib import ticker, font_manager
# Read the data
Expand All @@ -76,22 +76,30 @@
ntheta = ss.ntheta
nphi = ss.nphi
costheta = ss.costheta
theta = numpy.arccos(costheta)
theta = np.arccos(costheta) - np.pi/2.0
phi = np.arange(nphi)*2.0*np.pi/nphi - np.pi


tindex =1 # All example quantities were output with same cadence. Grab second time-index from all.
rindex = 0 # only output one radius
sizetuple=(8,8)
sizetuple=(12,5)

vr = ss.vals[:,:,rindex,ss.lut[1],tindex]
fig, ax = plt.subplots(figsize=sizetuple)

fig = plt.figure(figsize=sizetuple)
ax = fig.add_subplot(111, projection='mollweide')

img = plt.imshow(numpy.transpose(vr), extent=[0,360,-90,90])
ax.set_xlabel( 'Longitude')
ax.set_ylabel( 'Latitude')
plot1 = ax.pcolormesh(phi, theta, vr.transpose(), shading='auto', cmap='hot', rasterized=True)

ax.set_xticklabels([])
ax.set_yticklabels([])

#ax.set_xlabel( 'Longitude')
#ax.set_ylabel( 'Latitude')
ax.set_title( 'Radial Velocity')

plt.colorbar(plot1, label='cm/s')

plt.tight_layout()
savefile = 'Shell_Slices_LatLon.pdf'
print('Saving figure to: ', savefile)
Expand Down
4 changes: 2 additions & 2 deletions post_processing/rayleigh_diagnostics.py
Original file line number Diff line number Diff line change
Expand Up @@ -2457,9 +2457,9 @@ def plot_azav(fig,ax,field,radius,costheta,sintheta,r_bcz=0.71,mini=-1,maxi=-1,m

#plt.hold(True)
if (len(underlay) == 1):
img = ax.pcolormesh(yr,xr,field,cmap=mycmap)
img = ax.pcolormesh(yr,xr,field,cmap=mycmap,shading='auto')
else:
img = ax.pcolormesh(yr,xr,underlay,cmap=mycmap)
img = ax.pcolormesh(yr,xr,underlay,cmap=mycmap,shading='auto')
#ax.plot(r_bcz*sintheta,r_bcz*costheta,'k--',[0,1],[0,0],'k--')
ax.axis('equal')
ax.axis('off')
Expand Down