67 lines
1.7 KiB
Python
67 lines
1.7 KiB
Python
# coding: utf-8
|
|
import sys
|
|
import numpy as np
|
|
import module_extract as me
|
|
import extract_disk as d
|
|
import pymses
|
|
import os
|
|
import argparse
|
|
import disk_postprocess as dp
|
|
|
|
|
|
storage_in = "/drf/projets/alfven-data/"
|
|
storage_out = "/dsm/anais/storageA/"
|
|
|
|
parser = argparse.ArgumentParser()
|
|
parser.add_argument("runs", help="name of runs", nargs="*", default=["015_iso"])
|
|
parser.add_argument(
|
|
"-f", "--first_output", help="id of first output", type=int, default=1
|
|
)
|
|
parser.add_argument(
|
|
"-l", "--last_output", 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"
|
|
)
|
|
|
|
args = parser.parse_args()
|
|
|
|
|
|
user = "nbrucy"
|
|
folder = "simus"
|
|
project = "disk"
|
|
runs = args.runs
|
|
|
|
first = args.first_output
|
|
last = args.last_output
|
|
step = args.step
|
|
|
|
for run in runs:
|
|
path_suffix = user + "/" + folder + "/" + project + "/" + run
|
|
path_in = storage_in + path_suffix
|
|
path_out = storage_out + path_suffix
|
|
|
|
if not os.path.exists(path_out):
|
|
os.makedirs(path_out)
|
|
|
|
for i in range(first, last + 1, step):
|
|
me.make_image_zoom(
|
|
path_in,
|
|
i,
|
|
[0.5],
|
|
sinks=False,
|
|
force=False,
|
|
path_out=path_out,
|
|
tag=run + "_",
|
|
cpuamr=False,
|
|
mag_im=False,
|
|
AU_units=False,
|
|
)
|
|
# me.look(path_in, i)
|
|
if args.disk:
|
|
dp.disk_prop(
|
|
path_in, i, path_out=path_out, rad_ext=1, nb_bin=50, force=True
|
|
)
|
|
dp.plot_disk_prop(path_out, i, tag=run + "_")
|