[Yt-svn] yt-commit r1083 - trunk/yt/extensions/lightcone
britton at wrangler.dreamhost.com
britton at wrangler.dreamhost.com
Wed Jan 7 14:35:37 PST 2009
Author: britton
Date: Wed Jan 7 14:35:36 2009
New Revision: 1083
URL: http://yt.spacepope.org/changeset/1083
Log:
Added option to continually flatten the light cone stack after each slice with
the keyword, flatten_stack=True, thrown to ProjectLightCone. This should
save ram on light cones with many slices.
Modified:
trunk/yt/extensions/lightcone/LightCone.py
Modified: trunk/yt/extensions/lightcone/LightCone.py
==============================================================================
--- trunk/yt/extensions/lightcone/LightCone.py (original)
+++ trunk/yt/extensions/lightcone/LightCone.py Wed Jan 7 14:35:36 2009
@@ -209,7 +209,7 @@
self.haloMask *= mask
del haloMaskCube
- def ProjectLightCone(self,field,weight_field=None,apply_halo_mask=False,node=None,save_stack=True,save_slice_images=False,**kwargs):
+ def ProjectLightCone(self,field,weight_field=None,apply_halo_mask=False,node=None,save_stack=True,save_slice_images=False,flatten_stack=False,**kwargs):
"Create projections for light cone, then add them together."
# Clear projection stack.
@@ -228,6 +228,7 @@
frb = LightConeProjection(output,field,self.pixels,weight_field=weight_field,
save_image=save_slice_images,
name=name,node=node,**kwargs)
+
if ytcfg.getint("yt","__parallel_rank") == 0:
if (weight_field is not None):
# Data come back normalized by the weight field.
@@ -237,6 +238,12 @@
else:
self.projectionStack.append(frb[field])
+ # Flatten stack to save memory.
+ if flatten_stack and (len(self.projectionStack) > 1):
+ self.projectionStack = [sum(self.projectionStack)]
+ if weight_field is not None:
+ self.projectionWeightFieldStack = [sum(self.projectionWeightFieldStack)]
+
# Unless this is the last slice, delete the dataset object.
# The last one will be saved to make the plot collection.
if (q < len(self.lightConeSolution) - 1):
More information about the yt-svn
mailing list