>>> from SLIMpy import *
>>> options = parse_args( )
parse_args tells SLIMpy that it is working as a command line program and to enable the SLIMpy command line arguments.
parse_args initializes SLIMpy. This produces the following output
SLIMpy: Building AST ...
>>> sig = vector( '../sig.rsf' ) >>> noise = vector( '../swellnoise.rsf' ) >>> data = sig + noise
Here we tell SLIMpy to look at the files `sig.rsf' and 'swellnoise.rsf' as vectors. vector is acutaly a forctory function that creates a Vector Class instance.
>>> A = Cosine( sig.space )
>>> tmp1 = A * data >>> tmp2 = tmp1.thr( 0.0001 ) >>> res = A.H * tmp2
These line represents the body of the code. this is where slimpy makes it easy for the user to create a flow.
>>> data.setName('data') >>> res.setName( "res" )
The command setName tells SLIMpy that the vector res is a target to be built and kept.
>>> Execute( )
Execute is where the work is done, it produces the following lines of output:
SLIMpy: Done building AST SLIMpy: Executing commands ... true | sfmath type="float" n2="256" n1="256" output="0" | sfput label1="Time" label2="Lateral" var="0.0002" unit2="km" unit1="s" d1="0.004" d2="0.032" o2="0" o1="0" | DATAPATH=./ sfnoise mean="0" > ./slim.18526.env1.exampl.creat.00001.rsf < ./sig.rsf DATAPATH=./ sfmath output="vec+input" vec="./slim.18526.env1.exampl.creat.00001.rsf" > ./data.rsf < ./data.rsf sfsurf adj="n" Pyr_Level="2" | sfthr mode="soft" thr="0.0001" | DATAPATH=./ sfsurf adj="y" Pyr_Level="2" > ./res.rsf sync sfrm ./slim.18526.env1.exampl.creat.00001.rsf SLIMpy: Done executing commands