Added comparaison and evolution mode
This commit is contained in:
+45
-20
@@ -12,35 +12,22 @@ storage_in = "/home/nbrucy/simus/"
|
||||
storage_out = "/home/nbrucy/visus/"
|
||||
|
||||
parser = argparse.ArgumentParser()
|
||||
|
||||
parser.add_argument("runs", help="name of runs", nargs="*", default=["015_iso"])
|
||||
parser.add_argument("-b", "--begin", help="id of first output", type=int, default=1)
|
||||
parser.add_argument("-e", "--end", help="id of last output", type=int, default=100)
|
||||
parser.add_argument("-s", "--step", help="step between two output", type=int, default=1)
|
||||
parser.add_argument(
|
||||
"-d", "--disk", help="do specific disk radial analysis", action="store_true"
|
||||
)
|
||||
parser.add_argument(
|
||||
"--nb_bin", help="Number of bins for azimuthal averages", type=int, default=50
|
||||
)
|
||||
|
||||
|
||||
parser.add_argument("-m", "--maps", help="do generic maps", action="store_true")
|
||||
|
||||
parser.add_argument("-p", "--project", help="specify project name", default="disk")
|
||||
|
||||
parser.add_argument(
|
||||
"-fr",
|
||||
"--force_redo",
|
||||
help="redo plots even if the files already exist",
|
||||
action="store_true",
|
||||
)
|
||||
|
||||
parser.add_argument(
|
||||
"-w", "--watch", help="wait and watch for missing outputs", action="store_true"
|
||||
)
|
||||
|
||||
parser.add_argument("--skip", help="skip failed loadings", action="store_true")
|
||||
|
||||
parser.add_argument(
|
||||
"-wt",
|
||||
"--waiting_time",
|
||||
@@ -54,9 +41,33 @@ parser.add_argument(
|
||||
help="number of allowed failures when waiting",
|
||||
default=30,
|
||||
)
|
||||
parser.add_argument("-i", "--interactive", help="Interactive mode", action="store_true")
|
||||
|
||||
|
||||
parser.add_argument(
|
||||
"-d", "--disk", help="do specific disk radial analysis", action="store_true"
|
||||
)
|
||||
parser.add_argument("-m", "--maps", help="do generic maps", action="store_true")
|
||||
parser.add_argument(
|
||||
"-c", "--compare", help="compare different runs", action="store_true"
|
||||
)
|
||||
parser.add_argument(
|
||||
"-ev",
|
||||
"--evolution",
|
||||
help="plot evolution of quantities over time",
|
||||
action="store_true",
|
||||
)
|
||||
|
||||
parser.add_argument(
|
||||
"--fft", help="use quick and dirty fft rendering", action="store_true"
|
||||
)
|
||||
parser.add_argument("--level", help="plot levels", action="store_true")
|
||||
parser.add_argument("--cpu", help="plot cpu", action="store_true")
|
||||
|
||||
|
||||
parser.add_argument(
|
||||
"--nb_bin", help="Number of bins for azimuthal averages", type=int, default=50
|
||||
)
|
||||
parser.add_argument(
|
||||
"-x", help="x position of the central point", type=float, default=1.0
|
||||
)
|
||||
@@ -66,10 +77,7 @@ parser.add_argument(
|
||||
parser.add_argument(
|
||||
"-z", help="z position of the central point", type=float, default=1.0
|
||||
)
|
||||
parser.add_argument(
|
||||
"--fft", help="use quick and dirty fft rendering", action="store_true"
|
||||
)
|
||||
parser.add_argument("-i", "--interactive", help="Interactive mode", action="store_true")
|
||||
|
||||
|
||||
parser.add_argument(
|
||||
"--colormap", help="Colormap used", choices=dp.P.colormaps(), default="plasma"
|
||||
@@ -131,7 +139,7 @@ for run in runs:
|
||||
fft=args.fft,
|
||||
interactive=args.interactive,
|
||||
)
|
||||
if args.disk:
|
||||
if args.disk or args.compare or args.evolution:
|
||||
dp.disk_prop(
|
||||
path_in,
|
||||
i,
|
||||
@@ -141,6 +149,7 @@ for run in runs:
|
||||
force=args.force_redo,
|
||||
pos_star=np.array([args.x, args.y, args.z]),
|
||||
)
|
||||
if args.disk:
|
||||
dp.plot_disk_prop(
|
||||
path_out,
|
||||
i,
|
||||
@@ -153,7 +162,9 @@ for run in runs:
|
||||
if args.watch and failures < args.allowed_failures:
|
||||
failures = failures + 1
|
||||
print(
|
||||
"Unable to proceed for run {} output {}. Trying again in {} s ({} tries remaining)".format(
|
||||
"Unable to proceed for run {} \
|
||||
output {}. Trying again in {} s ({} \
|
||||
tries remaining)".format(
|
||||
run, i, args.waiting_time, args.allowed_failures - failures
|
||||
)
|
||||
)
|
||||
@@ -162,3 +173,17 @@ for run in runs:
|
||||
break
|
||||
else:
|
||||
raise
|
||||
if args.evolution:
|
||||
dp.evolution(
|
||||
path_out,
|
||||
range(first, last + 1, step),
|
||||
force=args.force_redo,
|
||||
interactive=args.interactive,
|
||||
)
|
||||
|
||||
if args.compare:
|
||||
path_suffix = project
|
||||
path = storage_out + path_suffix
|
||||
|
||||
for i in range(first, last + 1, step):
|
||||
dp.compare(path, runs, i, force=args.force_redo, interactive=args.interactive)
|
||||
|
||||
Reference in New Issue
Block a user