summaryrefslogtreecommitdiffstats
path: root/DiskRTZ.py
diff options
context:
space:
mode:
authorVolker Hoffmann <volker@cheleb.net>2013-08-21 15:07:26 +0200
committerVolker Hoffmann <volker@cheleb.net>2013-08-21 15:07:26 +0200
commite0f29d6c30cb1b39b3a3f6276b109c570921d732 (patch)
tree88d7dfe9b596e3a20908351456a6cb8ed4bda9d5 /DiskRTZ.py
parentb381060940d4dfd7387516f8da756d2d765876a8 (diff)
read,save,load and use rho_rz>0 for clim (so the log10 of a potential negative density does not break the plots) -- @todo: some sort of notification if rho<0 [clearly unphysical!]
Diffstat (limited to 'DiskRTZ.py')
-rw-r--r--DiskRTZ.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/DiskRTZ.py b/DiskRTZ.py
index 90bfc09..02f60e3 100644
--- a/DiskRTZ.py
+++ b/DiskRTZ.py
@@ -46,6 +46,7 @@ class DiskBase():
self.total_mass = None
# MinMax Holders
self.rho_rz_min = None; self.rho_rz_max = None
+ self.rho_rz_min_gt0 = None; self.rho_rz_max_gt0 = None
self.mdotr_rz_g0_min = None; self.mdotr_rz_g0_max = None
self.mdotr_rz_l0_min = None; self.mdotr_rz_l0_max = None
self.mdotr_r_g0_min = None; self.mdotr_r_g0_max = None
@@ -118,6 +119,8 @@ class DiskIo(DiskBase):
self.mass_r_min = npz["mass_r_min"]
self.rho_rz_max = npz["rho_rz_max"]
self.rho_rz_min = npz["rho_rz_min"]
+ self.rho_rz_max_gt0 = npz["rho_rz_max_gt0"]
+ self.rho_rz_min_gt0 = npz["rho_rz_min_gt0"]
self.info = npz["info"][()]
def load_npz_minmax(self):
@@ -135,6 +138,8 @@ class DiskIo(DiskBase):
self.mass_r_min = npz["mass_r_min"]
self.rho_rz_max = npz["rho_rz_max"]
self.rho_rz_min = npz["rho_rz_min"]
+ self.rho_rz_max_gt0 = npz["rho_rz_max_gt0"]
+ self.rho_rz_min_gt0 = npz["rho_rz_min_gt0"]
def load_npz_stats(self):
"""Load Statistics."""
@@ -162,6 +167,7 @@ class DiskIo(DiskBase):
mdotr_r_l0_min = self.mdotr_r_l0_min, \
mass_r_max = self.mass_r_max, mass_r_min = self.mass_r_min, \
rho_rz_max = self.rho_rz_max, rho_rz_min = self.rho_rz_min, \
+ rho_rz_max_gt0 = self.rho_rz_max_gt0, rho_rz_min_gt0 = self.rho_rz_min_gt0, \
info = self.info )
class DiskReduceBase(DiskIo):
@@ -234,6 +240,8 @@ class DiskReduce(DiskReduceBase):
idx_lo = idx_hi
self.rho_rz_max = np.nanmax(self.rho_rz)
self.rho_rz_min = np.nanmin(self.rho_rz)
+ self.rho_rz_max_gt0 = np.nanmax(self.rho_rz[self.rho_rz > 0])
+ self.rho_rz_min_gt0 = np.nanmin(self.rho_rz[self.rho_rz > 0])
def integrate_rho_to_r(self):
"""Integrate RZ Density along Z."""