|
From: <zk...@us...> - 2010-07-18 18:51:22
|
Revision: 698
http://pyphant.svn.sourceforge.net/pyphant/?rev=698&view=rev
Author: zklaus
Date: 2010-07-18 18:51:16 +0000 (Sun, 18 Jul 2010)
Log Message:
-----------
Merge branch 'master' into svn-trunk
* master:
Fix: Fix typo, remove debug print.
Fix: Add proper handling of maskless fields to PlotFrame; better unit handling.
Enh: Add legend to viewOSC script.
Modified Paths:
--------------
trunk/doc/demo/viewOSC.py
trunk/src/pyphant/pyphant/visualizers/ConfigurablePlot.py
trunk/src/workers/OSC/OSC/EstimateParameterFromValues.py
Modified: trunk/doc/demo/viewOSC.py
===================================================================
--- trunk/doc/demo/viewOSC.py 2010-07-14 10:41:43 UTC (rev 697)
+++ trunk/doc/demo/viewOSC.py 2010-07-18 18:51:16 UTC (rev 698)
@@ -182,7 +182,7 @@
residuum = (simulation.dimensions[0].data-thickness.data[index])**2
absorption = simulation.data[residuum.argmin(),:]
pylab.plot(simulation.dimensions[1].data,
- absorption,label="$%s$"%simulation.shortname)
+ absorption,label="$%s$ functional"%simulation.shortname)
title = "Functional based: " + title_template % (thickness[index].shortname,
thickness.data[index],
thickness.unit.unit.name())
@@ -194,7 +194,7 @@
residuum = (simulation.dimensions[0].data-thickness.data[index])**2
absorption = simulation.data[residuum.argmin(),:]
pylab.plot(simulation.dimensions[1].data,
- absorption,label="$%s$"%simulation.shortname)
+ absorption,label="$%s$ immediate"%simulation.shortname)
title += "\nImmediate: " + title_template % (thickness[index].shortname,
thickness.data[index],
thickness.unit.unit.name())
@@ -223,6 +223,7 @@
label ="$\\Delta%s$"%maximaPos.shortname, linestyle='dashed')
pylab.title(title)
pylab.xlabel(simulation.dimensions[1].label)
+ pylab.legend(loc="lower left")
def noisyAbsorption(recipe, curvNo, noIndicators):
worker = recipe.getWorker("Slicing")
Modified: trunk/src/pyphant/pyphant/visualizers/ConfigurablePlot.py
===================================================================
--- trunk/src/pyphant/pyphant/visualizers/ConfigurablePlot.py 2010-07-14 10:41:43 UTC (rev 697)
+++ trunk/src/pyphant/pyphant/visualizers/ConfigurablePlot.py 2010-07-18 18:51:16 UTC (rev 698)
@@ -49,8 +49,8 @@
from pyphant.core import DataContainer
from pyphant.wxgui2.DataVisReg import DataVisReg
from pyphant.quantities import isQuantity, Quantity
+from pyphant.quantities.ParseQuantities import str2unit
-
class PlotPanel (wx.PyPanel):
"""The PlotPanel has a Figure and a Canvas. OnSize events simply set a
flag, and the actual resizing of the figure is triggered by an Idle event."""
@@ -122,10 +122,15 @@
if not isinstance(aspect, Quantity):
self.ax.set_aspect(aspect)
try:
- mask = numpy.logical_not(self.c.mask)
- x = self.x.data[mask]
- y = self.y.data[mask]
- c = self.c.data[mask]
+ if self.c.mask!=None:
+ mask = numpy.logical_not(self.c.mask)
+ x = self.x.data[mask]
+ y = self.y.data[mask]
+ c = self.c.data[mask]
+ else:
+ x = self.x.data
+ y = self.y.data
+ c = self.c.data
self.scat = self.ax.scatter(x,y,
s=numpy.pi*(self.radius/self.x.unit)**2,
c=c,
@@ -231,9 +236,9 @@
self.vmin_text.Value=str(vmin)
vmax = numpy.nanmax(field.data).round()*field.unit
self.vmax_text.Value=str(vmax)
- self.plot_panel.vmin = Quantity(self.vmin_text.Value)
- self.plot_panel.vmax = Quantity(self.vmax_text.Value)
- self.plot_panel.radius = Quantity(self.radius_text.Value)
+ self.plot_panel.vmin = str2unit(self.vmin_text.Value)
+ self.plot_panel.vmax = str2unit(self.vmax_text.Value)
+ self.plot_panel.radius = str2unit(self.radius_text.Value)
self.plot_panel.draw()
self.GetSizer().Fit(self)
Modified: trunk/src/workers/OSC/OSC/EstimateParameterFromValues.py
===================================================================
--- trunk/src/workers/OSC/OSC/EstimateParameterFromValues.py 2010-07-14 10:41:43 UTC (rev 697)
+++ trunk/src/workers/OSC/OSC/EstimateParameterFromValues.py 2010-07-18 18:51:16 UTC (rev 698)
@@ -75,14 +75,14 @@
minima_model = model[self.paramMinima_model.value]
maxima_model = model[self.paramMaxima_model.value]
minima_experimental = experimental[self.paramMinima_experimental.value]
- minima_experimantal = minima_experimental.inUnitsOf(minima_model)
+ minima_experimental = minima_experimental.inUnitsOf(minima_model)
minima = minima_experimental.data.transpose()
if minima_experimental.error != None:
minima_error = iter(minima_experimental.error.transpose())
else:
minima_error = None
maxima_experimental = experimental[self.paramMaxima_experimental.value]
- maxima_experimantal = maxima_experimental.inUnitsOf(maxima_model)
+ maxima_experimental = maxima_experimental.inUnitsOf(maxima_model)
maxima = maxima_experimental.data.transpose()
if maxima_experimental.error != None:
maxima_error = iter(maxima_experimental.error.transpose())
@@ -119,7 +119,6 @@
grades.append(numpy.nan)
continue
grades.append(grade)
- print grades[-1]
grades = numpy.array(grades)
i = numpy.nanargmin(grades)
if numpy.isnan(i):
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|