[Yt-svn] yt-commit r1121 - trunk/yt/extensions/lightcone
britton at wrangler.dreamhost.com
britton at wrangler.dreamhost.com
Fri Jan 16 10:02:40 PST 2009
Author: britton
Date: Fri Jan 16 10:02:39 2009
New Revision: 1121
URL: http://yt.spacepope.org/changeset/1121
Log:
Use of the node keyword, thrown to ProjectLightCone, now extends to the names
of the image files and to the name of the hdf5 output file.
Modified:
trunk/yt/extensions/lightcone/LightCone.py
trunk/yt/extensions/lightcone/LightConeProjection.py
Modified: trunk/yt/extensions/lightcone/LightCone.py
==============================================================================
--- trunk/yt/extensions/lightcone/LightCone.py (original)
+++ trunk/yt/extensions/lightcone/LightCone.py Fri Jan 16 10:02:39 2009
@@ -223,8 +223,12 @@
self.lightConeParameters['OutputDir'] += "/"
for q,output in enumerate(self.lightConeSolution):
- name = "%s%s_%04d_%04d" % (self.lightConeParameters['OutputDir'],self.lightConeParameters['OutputPrefix'],
- q,len(self.lightConeSolution))
+ if node is None:
+ name = "%s%s_%04d_%04d" % (self.lightConeParameters['OutputDir'],self.lightConeParameters['OutputPrefix'],
+ q,len(self.lightConeSolution))
+ else:
+ name = "%s%s_%s_%04d_%04d" % (self.lightConeParameters['OutputDir'],self.lightConeParameters['OutputPrefix'],
+ node,q,len(self.lightConeSolution))
output['object'] = lagos.EnzoStaticOutput(output['filename'])
frb = LightConeProjection(output,field,self.pixels,weight_field=weight_field,
save_image=save_slice_images,
@@ -264,7 +268,10 @@
else:
lightConeProjection = sum(self.projectionStack) / sum(self.projectionWeightFieldStack)
- filename = "%s%s" % (self.lightConeParameters['OutputDir'],self.lightConeParameters['OutputPrefix'])
+ if node is None:
+ filename = "%s%s" % (self.lightConeParameters['OutputDir'],self.lightConeParameters['OutputPrefix'])
+ else:
+ filename = "%s%s_%s" % (self.lightConeParameters['OutputDir'],self.lightConeParameters['OutputPrefix'],node)
# Save the last fixed resolution buffer for the plot collection,
# but replace the data with the full light cone projection data.
@@ -292,8 +299,6 @@
# Return the plot collection so the user can remake the plot if they want.
return pc
- else:
- mylog.info("I'm not the root process so I'm just going to chill.")
def RerandomizeLightConeSolution(self,newSeed,recycle=True):
"""
Modified: trunk/yt/extensions/lightcone/LightConeProjection.py
==============================================================================
--- trunk/yt/extensions/lightcone/LightConeProjection.py (original)
+++ trunk/yt/extensions/lightcone/LightConeProjection.py Fri Jan 16 10:02:39 2009
@@ -56,16 +56,13 @@
mylog.info("Making projection at z = %f from %s." % (lightConeSlice['redshift'],lightConeSlice['filename']))
- # Make an Enzo data object.
- dataset_object = lightConeSlice['object']
-
- region_center = [0.5 * (dataset_object.parameters['DomainRightEdge'][q] +
- dataset_object.parameters['DomainLeftEdge'][q]) \
- for q in range(dataset_object.parameters['TopGridRank'])]
+ region_center = [0.5 * (lightConeSlice['object'].parameters['DomainRightEdge'][q] +
+ lightConeSlice['object'].parameters['DomainLeftEdge'][q]) \
+ for q in range(lightConeSlice['object'].parameters['TopGridRank'])]
# Make the plot collection and put it in the slice so we can delete it cleanly in the same scope
# as where the frb will be deleted.
- lightConeSlice['pc'] = raven.PlotCollection(dataset_object,center=region_center)
+ lightConeSlice['pc'] = raven.PlotCollection(lightConeSlice['object'],center=region_center)
# 1. The Depth Problem
# Use coordinate field cut in line of sight to cut projection to proper depth.
@@ -90,8 +87,8 @@
these_field_cuts.append(cut_mask)
# Make projection.
- lightConeSlice['pc'].add_projection(field,lightConeSlice['ProjectionAxis'],weight_field=weight_field,field_cuts=these_field_cuts,use_colorbar=True,
- node_name=node_name,**kwargs)
+ lightConeSlice['pc'].add_projection(field,lightConeSlice['ProjectionAxis'],weight_field=weight_field,field_cuts=these_field_cuts,
+ node_name=node_name,**kwargs)
# If parallel: all the processes have the whole projection object, but we only need to do the tiling, shifting, and cutting once.
if ytcfg.getint("yt","__parallel_rank") == 0:
More information about the yt-svn
mailing list