From b876b47dc9dd9ed8c940668db0dd387a24594280 Mon Sep 17 00:00:00 2001 From: Dave Grote Date: Wed, 18 Sep 2019 13:33:12 -0700 Subject: Various clean up in plot_parallel.py --- Tools/plot_parallel.py | 61 ++++++++++++++++++++++++++------------------------ 1 file changed, 32 insertions(+), 29 deletions(-) (limited to 'Tools/plot_parallel.py') diff --git a/Tools/plot_parallel.py b/Tools/plot_parallel.py index 56b243aca..d9efaa93a 100644 --- a/Tools/plot_parallel.py +++ b/Tools/plot_parallel.py @@ -1,8 +1,12 @@ -import os, glob, matplotlib, sys, argparse -import yt ; yt.funcs.mylog.setLevel(50) +import os +import glob +import matplotlib +import sys +import argparse +import yt +yt.funcs.mylog.setLevel(50) import numpy as np import matplotlib.pyplot as plt -import scipy.constants as scc ''' This script loops over all WarpX plotfiles in a directory and, for each @@ -28,22 +32,20 @@ To get help, run # Parse command line for options. parser = argparse.ArgumentParser() -parser.add_argument('--path', dest='path', default='.', +parser.add_argument('--path', default='diags/plotfiles', help='path to plotfiles. Plotfiles names must be plt?????') -parser.add_argument('--plotlib', dest='plotlib', default='yt', +parser.add_argument('--plotlib', default='yt', choices=['yt','matplotlib'], help='Plotting library to use') -parser.add_argument('--field', dest='field', default='Ez', +parser.add_argument('--field', default='Ez', help='Which field to plot, e.g., Ez, By, jx or rho. The central slice in y is plotted') -parser.add_argument('--pjump', dest='pjump', default=20, +parser.add_argument('--pjump', default=20, help='When plotlib=matplotlib, we plot every pjump particle') -parser.add_argument('--use_vmax', dest='use_vmax', default=False, - help='Whether to put bounds to field colormap') -parser.add_argument('--vmax', dest='vmax', default=1.e12, - help='If use_vmax=True, the colormab will have bounds [-vamx, vmax]') -parser.add_argument('--slicewidth', dest='slicewidth', default=10.e-6, +parser.add_argument('--vmax', type=float, default=None, + help='If specified, the colormap will have bounds [-vmax, vmax]') +parser.add_argument('--slicewidth', default=10.e-6, help='Only particles with -slicewidth/2