up [pdf]
from rsf.proj import *

# get the stack created using seismic unix
Fetch('final_stack.rsf','teapot',server='http://s3.amazonaws.com',top='')

Fetch('npr3_gathers.sgy','teapot',server='http://s3.amazonaws.com',top='')

Flow(['npr3_gathers.rsf','npr3_gathers_hdr.rsf',
      'npr3_gathers.thdr','npr3_gathers.bhdr'],
     'npr3_gathers.sgy',
     '''
     sfsegyread tfile=${TARGETS[1]} 
     hfile=${TARGETS[2]}  bfile=${TARGETS[3]} 
     ''')

Flow('gathersheaderattr.txt',
     'npr3_gathers_hdr.rsf',
     'sfheaderattr > $TARGET && /bin/cat $TARGET',stdout=-1)

# ohh my!  Coordinates all need to be divided by 1000 to be in ft.
# this apply to sx, sy ,cdpx, cdpy


Fetch('npr3_field.sgy','teapot',server='http://s3.amazonaws.com',top='')

Flow(['npr3_field.rsf','npr3_field_hdr.rsf',
      'npr3_field.thdr','npr3_field.bhdr'],
     'npr3_field.sgy',
     '''
     sfsegyread tfile=${TARGETS[1]} 
     hfile=${TARGETS[2]}  bfile=${TARGETS[3]} 
     ''')

Flow('fieldheaderattr.txt',
     'npr3_field_hdr.rsf',
     'sfheaderattr > $TARGET && /bin/cat $TARGET',stdout=-1)

pdfread = WhereIs('acroread') or WhereIs('kpdf') or WhereIs('evince') or \
    WhereIs('xpdf') or WhereIs('gv') or WhereIs('open')
if pdfread:
    # download and view the survey notes:
    Fetch('3dload_Teapot_Dome_3D.pdf','teapot',
          server='http://s3.amazonaws.com',top='')
    Flow('3dload','3dload_Teapot_Dome_3D.pdf',
           pdfread + ' $SOURCE',stdin=0, stdout=-1)
    Fetch('teapot_processing.pdf','teapot',
          server='http://s3.amazonaws.com',top='')
    Flow('processing','teapot_processing.pdf',
           pdfread + ' $SOURCE',stdin=0,stdout=-1)

# download the 3D dmo velocity text file:
Fetch('npr3_dmo.vel','teapot',server='http://s3.amazonaws.com',top='')
Flow('npr3_dmo_vel','npr3_dmo.vel','/bin/cat' + ' $SOURCE',stdin=0,stdout=-1)

End()

sfgrey
sfbyte
sfgrey3
sfsegyread
sfheaderattr
sfwindow
sftahread
sftahnmo
sftahstack
sftahwrite
sfadd
sfcat
sftahmakeskey
sftahsort

http://s3.amazonaws.com/teapot/final_stack.rsf
http://s3.amazonaws.com/teapot/npr3_gathers.sgy
http://s3.amazonaws.com/teapot/npr3_field.sgy
http://s3.amazonaws.com/teapot/3dload_Teapot_Dome_3D.pdf
http://s3.amazonaws.com/teapot/teapot_processing.pdf