30 Apr
2020
30 Apr
'20
9:19 p.m.
Sure! ---- import matplotlib.pyplot as plt import numpy as np import yt simZcenter = 1.3914e11 ## Load the first file and get the initial pressure ds0 = yt.load('initial file') # Example for a 512 by 512 slice in the xy plane. ds0r = ds0.r[::512j, ::512j, simZcenter] p0 = ds0r['pressure'] # Load the file for which we want to know the perturbation pressure ds = yt.load('final file') dsr = ds.r[::512j, ::512j, simZcenter] p = dsr['pressure'] # Plot the difference fig, ax = plt.subplots() im = ax.imshow(np.array(p - p0), origin = 'lower') plt.savefig('plot.png') plt.close() ----