This commit is contained in:
Noe Brucy
2019-05-08 13:15:00 +02:00
committed by Noe Brucy
parent 3974b35488
commit 02d987ee97
2 changed files with 17 additions and 65 deletions
+15 -61
View File
@@ -132,8 +132,15 @@ def make_image_aux(
G = 1.0 # Gravitational constant G = 1.0 # Gravitational constant
# Plotting parameters
ntick = 6 ntick = 6
title_ax = {"x": "x (code)", "y": "y (code)", "z": "z (code)"} title_ax = {"x": "x (code)", "y": "y (code)", "z": "z (code)"}
im_extent = [
(-radius + center[0]) * lbox_units,
(radius + center[0]) * lbox_units,
(-radius + center[1]) * lbox_units,
(radius + center[1]) * lbox_units,
]
time = ro.info["time"] # time in codeunits time = ro.info["time"] # time in codeunits
title = "t=" + str(time)[0:5] + " (code)" title = "t=" + str(time)[0:5] + " (code)"
@@ -161,8 +168,6 @@ def make_image_aux(
ax_nb = {"x": 0, "y": 1, "z": 2} ax_nb = {"x": 0, "y": 1, "z": 2}
image_names = ["coldens", "rho", "T"]
for i, ax_los in enumerate(axes_los): for i, ax_los in enumerate(axes_los):
ax_h = axes_h[i] ax_h = axes_h[i]
ax_v = axes_v[i] ax_v = axes_v[i]
@@ -200,12 +205,7 @@ def make_image_aux(
cont = P.contour( cont = P.contour(
map_level, map_level,
extent=[ extent=im_extent,
(-radius + center[0]) * lbox_units,
(radius + center[0]) * lbox_units,
(-radius + center[1]) * lbox_units,
(radius + center[1]) * lbox_units,
],
origin="lower", origin="lower",
colors="k", colors="k",
linewidths=lw, linewidths=lw,
@@ -226,16 +226,7 @@ def make_image_aux(
dmap_col = datamap.map.T * lbox dmap_col = datamap.map.T * lbox
map_col = np.log10(dmap_col) map_col = np.log10(dmap_col)
im = P.imshow( im = P.imshow(map_col, extent=im_extent, origin="lower")
map_col,
extent=[
(-radius + center[0]) * lbox_units,
(radius + center[0]) * lbox_units,
(-radius + center[1]) * lbox_units,
(radius + center[1]) * lbox_units,
],
origin="lower",
)
P.locator_params(axis=ax_h, nbins=ntick) P.locator_params(axis=ax_h, nbins=ntick)
P.locator_params(axis=ax_v, nbins=ntick) P.locator_params(axis=ax_v, nbins=ntick)
@@ -279,16 +270,7 @@ def make_image_aux(
map_vv_red = dmap_vv.map[::vel_red, ::vel_red] map_vv_red = dmap_vv.map[::vel_red, ::vel_red]
map_vv_red = map_vv_red.T map_vv_red = map_vv_red.T
im = P.imshow( im = P.imshow(map_rho, extent=im_extent, origin="lower")
map_rho,
extent=[
(-radius + center[0]) * lbox_units,
(radius + center[0]) * lbox_units,
(-radius + center[1]) * lbox_units,
(radius + center[1]) * lbox_units,
],
origin="lower",
)
P.locator_params(axis=ax_h, nbins=ntick) P.locator_params(axis=ax_h, nbins=ntick)
P.locator_params(axis=ax_v, nbins=ntick) P.locator_params(axis=ax_v, nbins=ntick)
nh = map_vh_red.shape[0] nh = map_vh_red.shape[0]
@@ -333,16 +315,7 @@ def make_image_aux(
dmap_T = dmap_P.map.T / dmap_rho.map.T dmap_T = dmap_P.map.T / dmap_rho.map.T
map_T = np.log10(dmap_T) map_T = np.log10(dmap_T)
im = P.imshow( im = P.imshow(map_T, extent=im_extent, origin="lower")
map_T,
extent=[
(-radius + center[0]) * lbox_units,
(radius + center[0]) * lbox_units,
(-radius + center[1]) * lbox_units,
(radius + center[1]) * lbox_units,
],
origin="lower",
)
P.locator_params(axis="x", nbins=ntick) P.locator_params(axis="x", nbins=ntick)
P.locator_params(axis="y", nbins=ntick) P.locator_params(axis="y", nbins=ntick)
@@ -403,15 +376,7 @@ def make_image_aux(
map_Q = dmap_Q map_Q = dmap_Q
im = P.imshow( im = P.imshow(
map_Q, map_Q, extent=im_extent, origin="lower", norm=mpl.colors.LogNorm()
extent=[
(-radius + center[0]) * lbox_units,
(radius + center[0]) * lbox_units,
(-radius + center[1]) * lbox_units,
(radius + center[1]) * lbox_units,
],
origin="lower",
norm=mpl.colors.LogNorm(),
) )
P.locator_params(axis="x", nbins=ntick) P.locator_params(axis="x", nbins=ntick)
@@ -441,16 +406,7 @@ def make_image_aux(
datamap = rt_cpu.process(cam, surf_qty=True) datamap = rt_cpu.process(cam, surf_qty=True)
map_cpu = datamap.map.T map_cpu = datamap.map.T
im = P.imshow( im = P.imshow(map_cpu, extent=im_extent, origin="lower")
map_cpu,
extent=[
(-radius + center[0]) * lbox_units,
(radius + center[0]) * lbox_units,
(-radius + center[1]) * lbox_units,
(radius + center[1]) * lbox_units,
],
origin="lower",
)
P.locator_params(axis="x", nbins=ntick) P.locator_params(axis="x", nbins=ntick)
P.locator_params(axis="y", nbins=ntick) P.locator_params(axis="y", nbins=ntick)
@@ -670,9 +626,7 @@ def disk_prop(
# Histogramm : density fluctuaction distribution function # Histogramm : density fluctuaction distribution function
drho = np.log(rho_disk[mask_bin] / rho_rad[i]) drho = np.log(rho_disk[mask_bin] / rho_rad[i])
hist, hist_edges = P.histogram( hist, hist_edges = P.histogram(
drho, drho, bins=nb_bin_hist, weights=dvol_disk[mask_bin]
bins=nb_bin_hist,
weights=dvol_disk[mask_bin] * 2.0 ** (3 * ro.info["levelmax"]),
) )
hist_drho = hist_drho + hist hist_drho = hist_drho + hist
@@ -874,7 +828,7 @@ def plot_disk_prop(path, num, force=False, tag="", interactive=False):
# Density fluctuation histogram # Density fluctuation histogram
P.grid() P.grid()
P.xlabel(r"$\log(\frac{\rho}{\bar{\rho}})$") P.xlabel(r"$\log(\frac{\rho}{\bar{\rho}})$")
P.ylabel(r"# of cells") P.ylabel(r"fraction of total volume")
P.title(title) P.title(title)
hist = prop_disk["hist_drho"] hist = prop_disk["hist_drho"]
egdes = prop_disk["hist_edges"] egdes = prop_disk["hist_edges"]
+2 -4
View File
@@ -1,11 +1,10 @@
# coding: utf-8 # coding: utf-8
import sys
import numpy as np
import pymses
import os import os
from shutil import copy from shutil import copy
import argparse import argparse
import time import time
import numpy as np
import disk_postprocess as dp import disk_postprocess as dp
@@ -99,7 +98,6 @@ dp.out_ext = "." + args.format
dp.P.rcParams["image.cmap"] = args.colormap dp.P.rcParams["image.cmap"] = args.colormap
dp.P.rcParams["savefig.dpi"] = args.dpi dp.P.rcParams["savefig.dpi"] = args.dpi
for run in runs: for run in runs:
path_suffix = project + "/" + run path_suffix = project + "/" + run
path_in = storage_in + path_suffix path_in = storage_in + path_suffix