aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVolker Hoffmann <volker@cheleb.net>2013-11-19 12:13:01 +0100
committerVolker Hoffmann <volker@cheleb.net>2013-11-19 12:13:01 +0100
commit3aaf28d8b13914066b75298172db0afd23d00db9 (patch)
tree507df1fcdf361b66d680a3370737d42b09cc8b77
parent52f4afd5ab57b9dafc1cda5a0421047d3af52b47 (diff)
scan minmax
-rw-r--r--mkcuts_dvpT.py87
1 files changed, 65 insertions, 22 deletions
diff --git a/mkcuts_dvpT.py b/mkcuts_dvpT.py
index 8affbdc..319b7fa 100644
--- a/mkcuts_dvpT.py
+++ b/mkcuts_dvpT.py
@@ -76,8 +76,6 @@ def main():
preXall = []
TZall = []
TXall = []
- lTZall = []
- lTXall = []
print ""
print "// Loading Snapshots"
@@ -132,22 +130,6 @@ def main():
TZ = (cs2Z * 100.**2. * 1000.**2.) * 2. * C.mH.express(C.kg) / \
gamma / C.kB.express(C.cm**2 * C.kg / C.s**2 / C.K)
- # Log10?
- rhoZ = np.log10(rhoZ)
- rhoX = np.log10(rhoX)
- preZ = np.log10(preZ)
- preX = np.log10(preX)
- lTX = np.log10(TX)
- lTZ = np.log10(TZ)
-
- # Mark Arrays vs. NaN
- rhoZ = np.ma.masked_array(rhoZ, mask=np.isnan(rhoZ))
- rhoX = np.ma.masked_array(rhoX, mask=np.isnan(rhoX))
- velZ = np.ma.masked_array(velZ, mask=np.isnan(velZ))
- velX = np.ma.masked_array(velX, mask=np.isnan(velX))
- preZ = np.ma.masked_array(preZ, mask=np.isnan(preZ))
- preX = np.ma.masked_array(preX, mask=np.isnan(preX))
-
# Append to Master List
rhoZall.append(rhoZ)
rhoXall.append(rhoX)
@@ -157,8 +139,55 @@ def main():
preXall.append(preX)
TZall.append(TZ)
TXall.append(TX)
- lTZall.append(lTZ)
- lTXall.append(lTX)
+
+ print ""
+ print "// Scanning Snapshots"
+ print ""
+
+ # Scan Snapshots for MinMax
+ first = True
+ for ii, iout in enumerate(iouts):
+
+ # Load from Master List
+ rhoZ = rhoZall[ii]
+ rhoX = rhoXall[ii]
+ velZ = velZall[ii]
+ velX = velXall[ii]
+ preZ = preZall[ii]
+ preX = preXall[ii]
+ TZ = TZall[ii]
+ TX = TXall[ii]
+
+ # MinMax
+ if first:
+ rhoZmax = np.nanmax(rhoZ); rhoZmin = np.nanmin(rhoZ)
+ rhoXmax = np.nanmax(rhoX); rhoXmin = np.nanmin(rhoX)
+ velZmax = np.nanmax(velZ); velZmin = np.nanmin(velZ)
+ velXmax = np.nanmax(velX); velXmin = np.nanmin(velX)
+ preZmax = np.nanmax(preZ); preZmin = np.nanmin(preZ)
+ preXmax = np.nanmax(preX); preXmin = np.nanmin(preX)
+ TZmax = np.nanmax(TZ); TZmin = np.nanmin(TZ)
+ TXmax = np.nanmax(TX); TXmin = np.nanmin(TX)
+ first = False
+ else:
+ # Max
+ if np.nanmax(rhoZ) > rhoZmax: rhoZmax = np.nanmax(rhoZ)
+ if np.nanmax(rhoX) > rhoXmax: rhoXmax = np.nanmax(rhoX)
+ if np.nanmax(preZ) > preZmax: preZmax = np.nanmax(preZ)
+ if np.nanmax(preX) > preXmax: preXmax = np.nanmax(preX)
+ if np.nanmax(velZ) > velZmax: velZmax = np.nanmax(velZ)
+ if np.nanmax(velX) > velXmax: velXmax = np.nanmax(velX)
+ if np.nanmax(TZ) > TZmax: TZmax = np.nanmax(TZ)
+ if np.nanmax(TX) > TXmax: TXmax = np.nanmax(TX)
+ # Min
+ if np.nanmin(rhoZ) > rhoZmin: rhoZmin = np.nanmin(rhoZ)
+ if np.nanmin(rhoX) > rhoXmin: rhoXmin = np.nanmin(rhoX)
+ if np.nanmin(preZ) > preZmin: preZmin = np.nanmin(preZ)
+ if np.nanmin(preX) > preXmin: preXmin = np.nanmin(preX)
+ if np.nanmin(velZ) > velZmin: velZmin = np.nanmin(velZ)
+ if np.nanmin(velX) > velXmin: velXmin = np.nanmin(velX)
+ if np.nanmin(TZ) > TZmin: TZmin = np.nanmin(TZ)
+ if np.nanmin(TX) > TXmin: TXmin = np.nanmin(TX)
print ""
print "// Plotting Snapshots"
@@ -176,8 +205,22 @@ def main():
preX = preXall[ii]
TZ = TZall[ii]
TX = TXall[ii]
- lTZ = lTZall[ii]
- lTX = lTXall[ii]
+
+ # Log10?
+ rhoZ = np.log10(rhoZ)
+ rhoX = np.log10(rhoX)
+ preZ = np.log10(preZ)
+ preX = np.log10(preX)
+ lTX = np.log10(TX)
+ lTZ = np.log10(TZ)
+
+ # Mark Arrays vs. NaN
+ rhoZ = np.ma.masked_array(rhoZ, mask=np.isnan(rhoZ))
+ rhoX = np.ma.masked_array(rhoX, mask=np.isnan(rhoX))
+ velZ = np.ma.masked_array(velZ, mask=np.isnan(velZ))
+ velX = np.ma.masked_array(velX, mask=np.isnan(velX))
+ preZ = np.ma.masked_array(preZ, mask=np.isnan(preZ))
+ preX = np.ma.masked_array(preX, mask=np.isnan(preX))
# Set Masked Colormap
# cmap = mpl.cm.hot