[Yt-svn] yt-commit r1716 - in trunk/yt: . extensions/image_panner lagos raven
mturk at wrangler.dreamhost.com
mturk at wrangler.dreamhost.com
Thu May 6 16:51:20 PDT 2010
Author: mturk
Date: Thu May 6 16:51:19 2010
New Revision: 1716
URL: http://yt.enzotools.org/changeset/1716
Log:
Backport from hg:
* Changing fortran kD-tree warning back to being mostly silent unless called upon.
* Adding some chaco colormaps.
* Import some structure function stuff into mods.
Modified:
trunk/yt/extensions/image_panner/pan_and_scan_widget.py
trunk/yt/extensions/image_panner/vm_panner.py
trunk/yt/lagos/EnzoFields.py
trunk/yt/lagos/StructureFunctionGenerator.py
trunk/yt/lagos/setup.py
trunk/yt/mods.py
trunk/yt/raven/__init__.py
Modified: trunk/yt/extensions/image_panner/pan_and_scan_widget.py
==============================================================================
--- trunk/yt/extensions/image_panner/pan_and_scan_widget.py (original)
+++ trunk/yt/extensions/image_panner/pan_and_scan_widget.py Thu May 6 16:51:19 2010
@@ -52,6 +52,34 @@
print
raise RuntimeError
+# We like the algae colormap; for now we re-implement it here.
+
+from enthought.chaco.api import \
+ ColorMapper, \
+ color_map_functions, color_map_dict, color_map_name_dict
+
+def algae(range, **traits):
+ _data = {'red': ((0.0, 80/256., 80/256.),
+ (0.2, 0.0, 0.0),
+ (0.4, 0.0, 0.0),
+ (0.6, 256/256., 256/256.),
+ (0.95, 256/256., 256/256.),
+ (1.0, 150/256., 150/256.)),
+ 'green': ((0.0, 0/256., 0/256.),
+ (0.2, 0/256., 0/256.),
+ (0.4, 130/256., 130/256.),
+ (0.6, 256/256., 256/256.),
+ (1.0, 0.0, 0.0)),
+ 'blue': ((0.0, 80/256., 80/256.),
+ (0.2, 220/256., 220/256.),
+ (0.4, 0.0, 0.0),
+ (0.6, 20/256., 20/256.),
+ (1.0, 0.0, 0.0))}
+ return ColorMapper.from_segment_map(_data, range=range, **traits)
+color_map_functions.append(algae)
+color_map_dict[algae] = "algae"
+color_map_name_dict["algae"] = algae
+
class FunctionImageData(ImageData):
# The function to call with the low and high values of the range.
# It should return an array of values.
@@ -144,7 +172,7 @@
pd.set_data("imagedata", self.fid)
- img_plot = plot.img_plot("imagedata", colormap=jet,
+ img_plot = plot.img_plot("imagedata", colormap=algae,
interpolation='nearest',
xbounds=(0.0, 1.0),
ybounds=(0.0, 1.0))[0]
Modified: trunk/yt/extensions/image_panner/vm_panner.py
==============================================================================
--- trunk/yt/extensions/image_panner/vm_panner.py (original)
+++ trunk/yt/extensions/image_panner/vm_panner.py Thu May 6 16:51:19 2010
@@ -392,9 +392,11 @@
def _regenerate_buffer(self):
args = (self.xlim, self.ylim)
- self.mec.push({'_tmp_%s' % id(self) : args})
- self.mec.execute("%s.set_limits(*_tmp_%s)" % (self._var_name, id(self)))
- self.mec.execute("_tmp_%s = %s.buffer" % (id(self), self._var_name))
+ self.mec.push({'_tmp_%s' % id(self) : args}, block=False)
+ self.mec.execute("%s.set_limits(*_tmp_%s)" % (self._var_name, id(self)),
+ block=False)
+ self.mec.execute("_tmp_%s = %s.buffer" % (id(self), self._var_name),
+ block=False)
self._prfb[self.field] = self.mec.pull("_tmp_%s" % (id(self)))[0]
self._prfb.bounds = self.xlim + self.ylim
self._buffer = self._prfb
Modified: trunk/yt/lagos/EnzoFields.py
==============================================================================
--- trunk/yt/lagos/EnzoFields.py (original)
+++ trunk/yt/lagos/EnzoFields.py Thu May 6 16:51:19 2010
@@ -86,7 +86,7 @@
projection_conversion="1")
def _Metallicity3(field, data):
- return data["SN_Colour"]
+ return data["SN_Colour"]/data["Density"]
add_field("Metallicity3", units=r"Z_{\rm{\odot}}",
function=_Metallicity3,
convert_function=_ConvertMetallicity,
Modified: trunk/yt/lagos/StructureFunctionGenerator.py
==============================================================================
--- trunk/yt/lagos/StructureFunctionGenerator.py (original)
+++ trunk/yt/lagos/StructureFunctionGenerator.py Thu May 6 16:51:19 2010
@@ -29,7 +29,7 @@
try:
from yt.extensions.kdtree import *
except ImportError:
- mylog.info("The Fortran kD-Tree did not import correctly. The structure function generator will not work correctly.")
+ mylog.debug("The Fortran kD-Tree did not import correctly. The structure function generator will not work correctly.")
import math, sys, itertools, inspect, types, time
from collections import defaultdict
@@ -63,6 +63,10 @@
number of ruler lengths, ruler min/max, number of structure functions,
number of point pairs per ruler length). Default: 0.
"""
+ try:
+ fKD
+ except NameError:
+ raise ImportError("You need to install the Forthon kD-Tree")
self._fsets = []
self.fields = fields
# MPI stuff.
Modified: trunk/yt/lagos/setup.py
==============================================================================
--- trunk/yt/lagos/setup.py (original)
+++ trunk/yt/lagos/setup.py Thu May 6 16:51:19 2010
@@ -1,8 +1,6 @@
#!/usr/bin/env python
import setuptools
-import os, sys, os.path
-
-import os.path
+import os, sys
def check_for_hdf5():
# First up: HDF5_DIR in environment
Modified: trunk/yt/mods.py
==============================================================================
--- trunk/yt/mods.py (original)
+++ trunk/yt/mods.py Thu May 6 16:51:19 2010
@@ -46,7 +46,7 @@
GadgetFieldInfo, TigerFieldInfo, \
Clump, write_clump_hierarchy, find_clumps, write_clumps, \
OrionStaticOutput, HaloFinder, HOPHaloFinder, FOFHaloFinder, parallelHF, \
- axis_names, x_dict, y_dict
+ axis_names, x_dict, y_dict, StructFcnGen, StructSet
# This is a temporary solution -- in the future, we will allow the user to
# select this via ytcfg.
Modified: trunk/yt/raven/__init__.py
==============================================================================
--- trunk/yt/raven/__init__.py (original)
+++ trunk/yt/raven/__init__.py Thu May 6 16:51:19 2010
@@ -68,7 +68,7 @@
color_maps = matplotlib.cm._cmapnames + raven_colormaps.keys()
default_cmap = ytcfg.get("raven", "colormap")
if default_cmap != "jet":
- mylog.info("Setting default colormap to %s", default_cmap)
+ mylog.debug("Setting default colormap to %s", default_cmap)
matplotlib.rc('image', cmap=default_cmap)
from PlotCollection import *
More information about the yt-svn
mailing list