up [pdf]
# Author: G. Hennenfent
#         Seismic Laboratory for Imaging and Modeling
#         Department of Earch & Ocean Sciences
#         The University of British Columbia
#         
# Date  : July, 07

from rsfproj import *

n1 = 10**3
mid = n1/2
d1 = 1./(n1-1)

### Define custom plots ###
lsz1 = 12
lsz2 = 14

matplot = '''
sfput d1=1 d2=1 |
sfgrey clip=.3 title=''
label1='Rows' unit1=''
label2='Columns' unit2=''
screenratio=1 labelsz=%(lsz1)g crowd2=.7
'''%vars()

colplot = '''
sfput d1=1
label2='Amplitude' unit2=''
label1='Rows' unit1='' |
sfgraph title='' crowd2=.5 min2=-.5 max2=1 labelsz=%(lsz2)g
'''%vars()

### Generate results
Flow('x',None,
     'sfspike n1=%(n1)i n2=1 k1=12,4,78 mag=20,50,7 nsp=3'%vars() )

targets = '''
mspl musplREG musplIRREG
musplJIT musplJITo
'''

Flow(targets,'x script.py',
     '''
     ./${SOURCES[1]}
     musplREG=${TARGETS[1]} musplIRREG=${TARGETS[2]}
     musplJIT=${TARGETS[3]} musplJITo=${TARGETS[4]}
     ''')

opos = n1/2. + 1
Flow('ospike',None,
     'sfspike n1=%(n1)d nsp=1 k1=%(opos)d mag=1'%vars() )

### Plot results ###

Result('mspl',matplot)
Result('musplREG',matplot)
Result('musplIRREG',matplot)
Result('musplJIT',matplot)
Result('musplJITo',matplot)

Result('colmspl','mspl ospike',
       'sfwindow f2=%(mid)d n2=1 | sfmath x=${SOURCES[1]} output="input-x" |'%vars() + colplot)
Result('colmusplREG','musplREG ospike',
       'sfwindow f2=%(mid)d n2=1 | sfmath x=${SOURCES[1]} output="input-x" |'%vars() + colplot)
Result('colmusplIRREG','musplIRREG ospike',
       'sfwindow f2=%(mid)d n2=1 | sfmath x=${SOURCES[1]} output="input-x" |'%vars() + colplot)
Result('colmusplJIT','musplJIT ospike',
       'sfwindow f2=%(mid)d n2=1 | sfmath x=${SOURCES[1]} output="input-x" |'%vars() + colplot)
Result('colmusplJITo','musplJITo ospike',
       'sfwindow f2=%(mid)d n2=1 | sfmath x=${SOURCES[1]} output="input-x" |'%vars() + colplot)

End()

sfspike
sfput
sfgrey
sfwindow
sfmath
sfgraph