up [pdf]
from rsf.proj import *

Fetch('seismic.segy','viking')

# Convert to RSF
Flow('seismic tseismic','seismic.segy',
     'segyread tfile=${TARGETS[1]}')

# Select common-offset sections
for offset in (-262,-1012,-3237):
    mask = 'mask%d' % offset
    coff = 'coff%d' % offset

    Flow(mask,'tseismic',
         'window n1=1 f1=11 | mask min=%d max=%d' % (offset,offset))
    Flow(coff,['seismic',mask],'headerwindow mask=${SOURCES[1]}')
    Result(coff,
           'tpow tpow=2 | grey title="Common Offset (%d m)" ' % offset)

End()

sfsegyread
sfwindow
sfmask
sfheaderwindow
sftpow
sfgrey