Step 2

Objectives:
  • Integrate the previous example with SCons and Madagascar reproducibility
  • Perform a dot-test on a linear operator

Walkthrough

Usage:
    scons view
    scons dottest
Preamble
from slimproj import *

slimproj is the SLIMpy SCons integration package. Hopefully you are familiar with the Madagascar pacage

from rsfproj import *

Flow( 'sig', None , "sigmoid n1=256 n2=256" )
Flow( 'data', 'sig' , "noise var=0.0002" )

This code does the same as in the previous example and creates the sigmoid synthetic model and data.

@slim_builder_simple
def SwellSeparation( vectors, thr=0.001 ):

Here I define the body of the code in the function SurfaceletDeNoise. SurfaceletDeNoise is a special function because it has the slim_builder_simple decorator above it. This turns the function into a SCons Builder object. The body of the code is defined the same as the previous example.

res = SwellSeparation( 'enoise', data , thr=0.001 )
Here we call the SCons Builder to build the target res.rsf from the soucre data.rsf. The reason that I do it this way - by putting the body of the code inside a builder - instead of just calling the code inline inside of the SConstruct, is becuase at the time scons is evaulating this code nothing has been built yet. This means that we have to give scons somthing to run after this script exits so that scons can track the dependancies and build everything in order.

Dot-Testing functionality
Dot-testing in SLIMpy is very simple. SLIMpy can create random noise realizations from a linear operator's domain and range which are VectorSpace objects. From these the DotTest can compute $ \langle Ay,x \rangle \approx \langle A^{H}x, y \rangle $.

DotTest(A,5,5)

In this case the first parameter A is the cosine transform and the second two parameters are the precision of a pass or fail and the number of noise realizations to test.


Generated on Sun Aug 10 09:11:08 2008 for SLIMpy by  doxygen 1.5.6