def visualize(files): output = [] for fn in parallel_objects(files, njobs=-1): pf = load(fn) for field in FIELDS: slc = SlicePlot(pf, 'z', field) output.append(slc.save(fn.replace('.h5', '_%s.png' % field))[0]) return output
def visualize(files): output = [] for fn in parallel_objects(files, njobs=-1): pf = load(fn) for field in FIELDS: slc = SlicePlot(pf, 'z', field) if field == 'curz': slc.set_cmap(field, 'bwr') maxabs = abs(slc._frb[field]).max() slc.set_log(field, False) slc.set_zlim(field, -maxabs, maxabs) output.append(slc.save(fn.replace('.h5', '_%s.png' % field))[0]) return output
xc = map(np.float64,args.x) zc = map(np.float64,args.z) my_cmap = matplotlib.colors.LinearSegmentedColormap('my_colormap', ct.p05) h = 0.146484375 phi = 0.5 c1 = np.array([xc[0], phi, zc[0]]) c2 = np.array([xc[1], phi, zc[1]]) patch1 = [c1[0] - h, c1[0] + h, c1[2]-h, c1[2]+h] patch2 = [c2[0] - h, c2[0] + h, c2[2]-h, c2[2]+h] vmin = 0.0 vmax = 0.1 * 0.2 first_pass = True for fn in parallel_objects(args.files, njobs=-1): pf = load(fn) field = "dend" le = pf.domain_left_edge * pf['au'] re = pf.domain_right_edge * pf['au'] s = pf.h.slice(1, phi, fields=["dend"]) # = pf.h.proj(1, 'dend') #fac = pf['au'] / (2.0 * pf['dend'] * np.pi) fac = 1./pf['dend'] if first_pass: c1 /= pf.units['au'] c2 /= pf.units['au'] ext = [ le[0], re[0], le[2], re[2] ] fig = plt.figure(0, figsize=(14,10)) fig.clf()