#!/bin/sh
# SuSunomstreamers_test4 - for program SUNOMSTREAMERS
# Author: Andre Latour, Dec  2022
#
  echo "----------------------------------------------------------------------------"
  echo "--- This is a test of a reasonably normal towed-streamer situation, except: "
  echo "---  - shots are further apart than normal (plots are easier to understand)."
  echo "---  - only 7 streamers of 10 channels each (real layouts are much bigger). "
  echo "---  - using create= option to make output traces with no input traces.     "
  echo "--- This actual test is same as test1 except:                               "
  echo "---  - use reversed channel numbering on streamers                          "
  echo "---                                                                         "
  echo "--- The result should be the same except for the reversed channel numbers.  "
  echo "--- But these created traces are always output in increasing channels       "
  echo "--- within their streamers. So, sort to shots,steamers,reversed channels.   "
  echo "--- That puts the trace order the same as test1.                            "
  echo "---                                                                         "
  echo "---                                                                         "
  echo "--- Note: last shot (5) is given a different colour.                        "
  echo "---                                                                         "
  echo "--- Note: DO NOT EXPECT FULL ACCURACY IN THE XGRAPHs.                       "
  echo "---       The mid XYs are put in sdel,gdel keys (which are integers).       "
  echo "---                                                                         "
  echo "--- Note: Also display the actual fake seismic to show spikes= is working.  "
  echo "---       (will not always show this on subsequent tests).                  "
  echo "---                                                                         "
  echo "----------------------------------------------------------------------------"
#
 sunomstreamers >fake41.su \
 shotkey=fldr shotspacing=200 \
 gunkey=fldr gunmod=2 gunid=0,1 guncross=-25,25 guninline=-40,-40 \
 streamercross=-300,-200,-100,0,100,200,300 \
 streamerinline=-100,-100,-100,-100,-100,-100,-100 \
 channelstart=10,20,30,40,50,60,70 \
 channelend=1,11,21,31,41,51,61 \
 channelspacing=10,10,10,10,10,10,10 \
 cdpspacing=5 offpi=2 linelocs=1 scalco=10 verbose=0 \
 create=5 firstshot=1 spikes=4,0.01,200,1000,208,1200,500,-2000,800,1600,1000,0
#
# To get easy comparison, sort by shots, streamers, and reverse channel order within streamers
#
  susort <fake41.su >fake41s.su fldr grnors -tracf
#
# Compute midpoint X,Y for xgraph.   
#
 suchw <fake41s.su >fake42.su key1=sdel,gdel key2=sx,sy key3=gx,gy b=1,1 c=1,1 d=20,20
#
 sugethw <fake42.su output=binary key=sdel,gdel >fake42.bin
#
 xgraph <fake42.bin n=280,70 linecolor=3,4 mark=7,8 marksize=5,5 linewidth=0,0 \
        style=normal width=1200 height=600 x1beg=99500 x1end=101500 x2beg=9500 x2end=10500 &
#
 subfilt <fake42.su >fake42f.su fpasshi=20
#
 sunmo <fake42f.su >fake42fn.su invert=1 tnmo=0,0.190,0.450,0.800 vnmo=1800,3500,4000,5000
#
# The filter and inverse NMO give some nice "horizons", which you can see:
#
 suxwigb <fake42fn.su &
#
 echo "--- diff between test1 and test4 seismic samples follows (should be 0  0)"
 suop2 fake42fn.su fake12fn.su op=diff >fake43fno.su
#
 sumax <fake43fno.su
#
 echo "--- diff between test1 and test4 header keys except tracf follows (should be nothing)"
 sugethw <fake11.su key=fldr,sx,sy,gx,gy,scalco,counit,offset,cdp,grnofr,grnors,grnlof,gaps >fake11.txt
 sugethw <fake41s.su key=fldr,sx,sy,gx,gy,scalco,counit,offset,cdp,grnofr,grnors,grnlof,gaps >fake41s.txt
 diff fake11.txt fake41s.txt
 echo "--- after diff  "         
