This commit is contained in:
Noe Brucy
2019-05-24 16:29:27 +02:00
parent aa8ba76162
commit 6b3f127878
2 changed files with 117 additions and 25 deletions
+50 -2
View File
@@ -44,6 +44,40 @@ parser.add_argument(
parser.add_argument("-i", "--interactive", help="Interactive mode", action="store_true")
parser.add_argument(
"-d", "--disk", help="compute specific disk radial analysis", action="store_true"
)
parser.add_argument(
"-pd", "--plot_disk", help="plot 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(
"--pdf", help="plot pdf of fluctuations of column density", 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("--zoom", help="zoom", type=float, default=2.0)
parser.add_argument(
"-ms",
"--mapsize",
help="size of the maps created in he map mode (in pixel)",
type=int,
default=1024,
)
parser.add_argument(
"-d", "--disk", help="do specific disk radial analysis", action="store_true"
)
@@ -108,10 +142,11 @@ parser.add_argument(
parser.add_argument(
"--format",
help="Format of the output",
choices=["png", "jpeg", "pdf", "ps"],
choices=["png", "jpeg", "pdf", "svg", "ps"],
default="jpeg",
)
parser.add_argument("--dpi", help="Resolution of the output", type=int, default=400)
parser.add_argument("--beamer", help="Beamer mode", action="store_true")
args = parser.parse_args()
@@ -123,8 +158,17 @@ first = args.begin
last = args.end
step = args.step
rad = 0.5 / args.zoom
# extension for out files
dp.out_ext = "." + args.format
if format == "pdf":
dp.P.style.use("pdf")
if args.beamer:
dp.P.rcParams["font.family"] = "sans-serif"
dp.P.rcParams["figure.figsize"] = (5, 3.5)
# Plot properties
dp.P.rcParams["image.cmap"] = args.colormap
dp.P.rcParams["savefig.dpi"] = args.dpi
@@ -159,6 +203,7 @@ for run in runs:
maps_disk = dp.make_image_disk(
path_in,
i,
rad=rad,
path_out=path_out,
tag=run,
map_size=args.mapsize,
@@ -168,6 +213,7 @@ for run in runs:
pos_star=np.array([args.x, args.y, args.z]),
fft=args.fft,
interactive=args.interactive,
put_title=(not args.beamer),
)
print("[{}, {}] maps computed".format(run, i))
if args.disk:
@@ -183,7 +229,7 @@ for run in runs:
pos_star=np.array([args.x, args.y, args.z]),
)
print("[{}, {}] disk_props computed".format(run, i))
if args.disk:
if args.plot_disk:
print("[{}, {}] plotting disk props".format(run, i))
dp.plot_disk_prop(
path_out,
@@ -191,6 +237,7 @@ for run in runs:
tag=run,
force=args.force_redo,
interactive=args.interactive,
put_title=(not args.beamer),
)
print("[{}, {}] disk props plotted".format(run, i))
if args.pdf:
@@ -203,6 +250,7 @@ for run in runs:
force=args.force_redo,
tag=run,
interactive=args.interactive,
put_title=(not args.beamer),
)
print("[{}, {}] pdf computed".format(run, i))
# If we are here, success !