summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--DiskRTZ.py8
-rw-r--r--plot_rho_rz.py6
2 files changed, 11 insertions, 3 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."""
diff --git a/plot_rho_rz.py b/plot_rho_rz.py
index 046c544..38b9629 100644
--- a/plot_rho_rz.py
+++ b/plot_rho_rz.py
@@ -27,11 +27,11 @@ for iout in iouts:
disk = Disk(iout)
disk.load_npz_minmax()
if first:
- rho_rz_lo = disk.rho_rz_min; rho_rz_hi = disk.rho_rz_max
+ rho_rz_lo = disk.rho_rz_min_gt0; rho_rz_hi = disk.rho_rz_max_gt0
first = False
else:
- if disk.rho_rz_min < rho_rz_lo: rho_rz_lo = disk.rho_rz_min
- if disk.rho_rz_max > rho_rz_hi: rho_rz_hi = disk.rho_rz_max
+ if disk.rho_rz_min_gt0 < rho_rz_lo: rho_rz_lo = disk.rho_rz_min_gt0
+ if disk.rho_rz_max_gt0 > rho_rz_hi: rho_rz_hi = disk.rho_rz_max_gt0
rho_rz_lim = [np.log10(rho_rz_lo), np.log10(rho_rz_hi)]