[Yt-svn] commit/yt: 2 new changesets
Bitbucket
commits-noreply at bitbucket.org
Fri Jun 3 14:11:33 PDT 2011
2 new changesets in yt:
http://bitbucket.org/yt_analysis/yt/changeset/438ebf6ac4a4/
changeset: 438ebf6ac4a4
branches:
user: samskillman
date: 2011-06-03 23:10:55
summary: This is a better way to determine domain dimensions, and will
hopefully work for FLASH 2, 2.5, and 3.0.
affected #: 1 file (397 bytes)
--- a/yt/frontends/flash/data_structures.py Fri Jun 03 15:49:52 2011 -0400
+++ b/yt/frontends/flash/data_structures.py Fri Jun 03 17:10:55 2011 -0400
@@ -296,13 +296,18 @@
[self._find_parameter("real", "%smax" % ax) for ax in 'xyz'])
# Determine domain dimensions
- if self._flash_version == 7:
- self.domain_dimensions = \
- (self.domain_right_edge - self.domain_left_edge).astype('int64')
- else:
- raise RuntimeError("Can't determine FLASH domain_dimensions "+
- "for FLASH file version %i." %
- self._flash_version)
+ try:
+ nxb = self._find_parameter("integer", "nxb", handle = self._handle)
+ nyb = self._find_parameter("integer", "nyb", handle = self._handle)
+ nzb = self._find_parameter("integer", "nzb", handle = self._handle)
+ except KeyError:
+ nxb, nyb, nzb = [int(self._handle["/simulation parameters"]['n%sb' % ax])
+ for ax in 'xyz']
+ nblockx = self._find_parameter("integer", "nblockx", handle = self._handle)
+ nblocky = self._find_parameter("integer", "nblockx", handle = self._handle)
+ nblockz = self._find_parameter("integer", "nblockx", handle = self._handle)
+ self.domain_dimensions = \
+ na.array([nblockx*nxb,nblocky*nyb,nblockz*nzb])
if self._flash_version == 7:
self.current_time = float(
http://bitbucket.org/yt_analysis/yt/changeset/7d58d26f0b0b/
changeset: 7d58d26f0b0b
branches:
user: samskillman
date: 2011-06-03 23:11:18
summary: merge
affected #: 1 file (159 bytes)
--- a/yt/visualization/profile_plotter.py Fri Jun 03 17:10:55 2011 -0400
+++ b/yt/visualization/profile_plotter.py Fri Jun 03 17:11:18 2011 -0400
@@ -37,7 +37,7 @@
BinnedProfile1D, \
BinnedProfile2D
from .plot_types import ProfilePlot, PhasePlot
-from .tick_locators import LogLocator
+from .tick_locators import LogLocator, LinearLocator
from yt.utilities.logger import ytLogger as mylog
def invalidate_plot(f):
@@ -57,6 +57,8 @@
def calculate_ticks(self):
if self.scale == 'log':
locator = LogLocator()
+ elif self.scale == 'linear':
+ locator = LinearLocator()
else:
raise NotImplementedError
self.ticks = locator(*self.bounds)
@@ -86,10 +88,12 @@
if self.x_spec.scale == 'log' and \
self.y_spec.scale == 'log':
func = axes.loglog
- elif self.x_spec == 'log':
+ elif self.x_spec.scale == 'log':
func = axes.semilogx
- elif self.y_spec == 'log':
+ elif self.y_spec.scale == 'log':
func = axes.semilogy
+ else:
+ func = axes.plot
if self.plot_spec is None:
kwargs = {}
else:
@@ -277,7 +281,7 @@
self._current_field = field_z
self.profile = profile
self.scale = {True:'log', False:'linear'}.get(
- data_source.pf.field_info[field_z], "log")
+ data_source.pf.field_info[field_z].take_log, "log")
self._setup_plot()
def _setup_plot(self):
@@ -404,7 +408,7 @@
self._current_field = field_y
self.profile = profile
self.scale = {True:'log', False:'linear'}.get(
- data_source.pf.field_info[field_y], "log")
+ data_source.pf.field_info[field_y].take_log, "log")
self._setup_plot()
def _setup_plot(self):
@@ -421,7 +425,7 @@
ny = (self.profile[self._current_field] > 0)
mi = self.profile[self._current_field][ny].min()
else:
- mi = self.profile[self._current_field][ny].min()
+ mi = self.profile[self._current_field].min()
ma = self.profile[self._current_field].max()
yax.bounds = (mi, ma)
yax.scale = self.scale
Repository URL: https://bitbucket.org/yt_analysis/yt/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
More information about the yt-svn
mailing list