up [pdf]
from rsf.proj import *

Flow('data',None,'spike n1=250 n2=100 k1=100 p2=1')

Plot('data','grey title=Before pclip=100')

# Make additional header keys 
Flow('offset','data',
     'window n1=1 | math output="1000*x1" | dd type=int')

# Generate SEGY trace headers
Flow('tdata','data offset','segyheader offset=${SOURCES[1]}')

# Convert RSF to SEGY
Flow('data.sgy','data tdata','segywrite tfile=${SOURCES[1]}')

# Convert SEGY back to RSF
Flow('data2 tdata2 data2.bin data2.asc','data.sgy',
     '''
     segyread tfile=${TARGETS[1]} bfile=${TARGETS[2]} hfile=${TARGETS[3]}  
     ''')

Plot('data2','grey title=After pclip=100')

Result('data','data data2','SideBySideAniso')

End()

sfspike
sfgrey
sfwindow
sfmath
sfdd
sfsegyheader
sfsegywrite
sfsegyread