up [pdf]
from rsf.proj import *
from rsf.recipes.beg import server
from math import *

Fetch('image3d.rsf','cup',server)
Flow('data1','image3d','dd form=native')

#############################
######  One slice 254  ######
#############################
Flow('slice','data1','window n3=1 f3=254')
Result('slice',
       '''
       grey  title=" "  label2=Distance
       clip=1.5
       font=2 label1="\F2 Time/s" label2="\F2 Lateral/km"
       unit1=""  unit2=""
       ''')

##############################
##### Riesz transform dip ####
##############################

Flow('riesz','slice','riesz order=8')

Flow('rx','riesz','window n3=1')
Flow('ry','riesz','window f3=1 | scale dscale=-1')

Plot('rx','grey title=Rx')
Plot('ry','grey title=Ry')
Result('riesz','rx ry','SideBySideIso')

Flow('dipr','ry rx','divn den=${SOURCES[1]} rect1=5 rect2=5')

Result('dipr',
       '''
       grey  scalebar=y color=j
       font=2  label1="\F2 Time/s" label2="\F2 Lateral/km"
       unit1=""  unit2=""  clip=1.5
       title=" "''')

## #############################
## # Dip-oriented filters
## #############################
Flow('elpfr','slice dipr',
     'lpfdenoise2 dip=${SOURCES[1]} nw=11 nfw=7 rect=30 verb=y niter=100')
Result('elpfr',
       '''
       smooth rect1=2 rect2=2 |
       grey 
       font=2   clip=1.5
       label1="\F2 Time/s" label2="\F2 Lateral/km"
       title=""       unit1=""  unit2=""
       ''')

Flow('delpfr','slice elpfr','add scale=1,-1 ${SOURCES[1]}')
Result('delpfr',
       '''
       grey wanttitle=n maxval=6.86156  minval=-7.70448
       font=2  clip=1.5
       label1="\F2 Time/s" label2="\F2 Lateral/km" unit1="" unit2=""
       ''')


End()

sfdd
sfwindow
sfgrey
sfriesz
sfscale
sfdivn
sflpfdenoise2
sfsmooth
sfadd