|
From: <zk...@us...> - 2010-07-14 10:41:51
|
Revision: 697
http://pyphant.svn.sourceforge.net/pyphant/?rev=697&view=rev
Author: zklaus
Date: 2010-07-14 10:41:43 +0000 (Wed, 14 Jul 2010)
Log Message:
-----------
Merge branch 'master' into svn-trunk
* master:
Enh: Now the viewOSC script also displays result from the alternative method.
Modified Paths:
--------------
trunk/doc/demo/viewOSC.py
Modified: trunk/doc/demo/viewOSC.py
===================================================================
--- trunk/doc/demo/viewOSC.py 2010-07-12 21:47:51 UTC (rev 696)
+++ trunk/doc/demo/viewOSC.py 2010-07-14 10:41:43 UTC (rev 697)
@@ -166,30 +166,48 @@
pylab.show()
def compareAbsorption(recipe, curvNo, noIndicators):
- worker = recipe.getWorker("Slicing")
- noisyAbsorption = worker.plugExtract.getResult()
- worker = recipe.getWorker("ThicknessModeller")
- simulation = worker.plugCalcAbsorption.getResult()
- worker = recipe.getWorker("MRA Exp")
- minimaPos = worker.plugMra.getResult()[r'\lambda_{min}'].inUnitsOf(simulation.dimensions[1])
- maximaPos = worker.plugMra.getResult()[r'\lambda_{max}'].inUnitsOf(simulation.dimensions[1])
worker = recipe.getWorker("AddColumn")
- table = worker.plugCompute.getResult(subscriber=TextSubscriber("Add Column"))
+ table = worker.plugCompute.getResult(subscriber=TextSubscriber("Result Functional"))
xPos = table[u"x-position"]
yPos = table[u"y-position"]
- thickness = table[u"thickness"]
index = curvNo2Index(table[u"pixel"], curvNo)
- result = "$%s_{%s}$(%s %s,%s %s)=%s %s" % (thickness[index].shortname,curvNo,
+ title_template = "$%%s_{%s}$(%s %s,%s %s)=%%s %%s" % (curvNo,
xPos.data[index],xPos.unit.unit.name(),
- yPos.data[index],yPos.unit.unit.name(),
- thickness.data[index],
- thickness.unit.unit.name())
+ yPos.data[index],yPos.unit.unit.name())
+
+ worker = recipe.getWorker("ThicknessModeller")
+ simulation = worker.plugCalcAbsorption.getResult()
+
+ thickness = table[u"thickness"]
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)
+ title = "Functional based: " + title_template % (thickness[index].shortname,
+ thickness.data[index],
+ thickness.unit.unit.name())
+
+ try:
+ worker = recipe.getWorker("Res Direct")
+ table = worker.plugCompute.getResult(subscriber=TextSubscriber("Result without Functional"))
+ thickness = table[u"thickness"]
+ 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)
+ title += "\nImmediate: " + title_template % (thickness[index].shortname,
+ thickness.data[index],
+ thickness.unit.unit.name())
+ except:
+ pass
+
+ worker = recipe.getWorker("Slicing")
+ noisyAbsorption = worker.plugExtract.getResult()
+ worker = recipe.getWorker("MRA Exp")
+ minimaPos = worker.plugMra.getResult()[r'\lambda_{min}'].inUnitsOf(simulation.dimensions[1])
+ maximaPos = worker.plugMra.getResult()[r'\lambda_{max}'].inUnitsOf(simulation.dimensions[1])
pylab.plot(noisyAbsorption.dimensions[1].inUnitsOf(simulation.dimensions[1]).data,
noisyAbsorption.data[index,:],label="$%s$"%noisyAbsorption.shortname)
- pylab.plot(simulation.dimensions[1].data,
- absorption,label="$%s$"%simulation.shortname)
if not noIndicators:
pylab.vlines(minimaPos.data[:,index],0.1,1.0,
label ="$%s$"%minimaPos.shortname)
@@ -203,7 +221,7 @@
label ="$\\Delta%s$"%maximaPos.shortname, linestyle='dashed')
pylab.vlines(maximaPos.data[:,index]-maximaPos.error[:,index],0.1,1.0,
label ="$\\Delta%s$"%maximaPos.shortname, linestyle='dashed')
- pylab.title(result)
+ pylab.title(title)
pylab.xlabel(simulation.dimensions[1].label)
def noisyAbsorption(recipe, curvNo, noIndicators):
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|