def plotAll2D(filename): dat = rc.readCheckpoint(filename) print("{0:s}: {1:s}".format(filename, rc.summary(*dat))) t = dat[0] x1 = dat[1] x2 = dat[2] prim = dat[3] pars = dat[5] X1, X2 = np.meshgrid(x1, x2, indexing='ij') fig, ax = plt.subplots(2,2,figsize=(12,9)) plot2DSingle(fig, ax[0,0], X1, X2, prim[:,:,0]) plot2DSingle(fig, ax[0,1], X1, X2, prim[:,:,1]) plot2DSingle(fig, ax[1,0], X1, X2, prim[:,:,2]) plot2DSingle(fig, ax[1,1], X1, X2, prim[:,:,3]) fig.suptitle("t = {0:.3f} ({1:s})".format(t, pars["GitHash"])) root = ".".join(filename.split("/")[-1].split(".")[:-1]) plotname = "{0:s}_{1:s}.png".format("plot2d", root) print(' Saving: {0:s}'.format(plotname)) fig.savefig(plotname) plt.close(fig)
def plotAll2D(filename): dat = rc.readCheckpoint(filename) print("{0:s}: {1:s}".format(filename, rc.summary(*dat))) t = dat[0] x1 = dat[1] x2 = dat[2] prim = dat[3] pars = dat[5] geom = pars['Geometry'] if geom == 1 or geom == 3 or geom == 4 or geom == 5: X2, X1 = np.meshgrid(x1, x2, indexing='ij') sub_kw=dict(projection='polar') else: X1, X2 = np.meshgrid(x1, x2, indexing='ij') sub_kw=dict(projection='rectilinear') fig, ax = plt.subplots(2,2,figsize=(20,16), subplot_kw=sub_kw) plot2DSingle(fig, ax[0,0], X1, X2, prim[:,:,0]) plot2DSingle(fig, ax[0,1], X1, X2, prim[:,:,1]) plot2DSingle(fig, ax[1,0], X1, X2, prim[:,:,2]) plot2DSingle(fig, ax[1,1], X1, X2, prim[:,:,3]) fig.suptitle("t = {0:.3f} ({1:s})".format(t, pars["GitHash"])) root = ".".join(filename.split("/")[-1].split(".")[:-1]) plotname = "{0:s}_{1:s}.png".format("plot2d", root) print(' Saving: {0:s}'.format(plotname)) fig.savefig(plotname) plt.close(fig)