#!/bin/sh
# Suflex2d_test2 - for program SUFLEX2D
# Author: Andre Latour, Nov  2022
#
  echo "----------------------------------------------------------------------------"
  echo "---  This test generates some traces in cdp,offset order.                   "
  echo "---  Similar to test1 except there are 2 traces per offset.                 "
  echo "---  And, on input, cdp 4 is missing just 1 of the 2 traces in a bin.       "
  echo "---  Notice that on output cdp 4 gets a duplicate trace                     "
  echo "---  from cdp 3 (offset 103) because it has an igi value of 9 rather than a "
  echo "---  trace from cdp 5 (offset 115) with an igi of 3, or (offset 105) igi 4. "
  echo "---  Remembering here that igi 9 in the next lower cdp number puts the      "
  echo "---  trace nearer the centre of cdp 4 than 3 or 4 from higher cdp number.   "
  echo "----------------------------------------------------------------------------"
#
 sugeomcsv rfile=createcdps02.csv setid=m match=cdp,tracl names=c_su_id,cdp,tracl,ep,offset,igi >fakecdps02.su create=all spikes=4,0.01,200,1000,208,1200,500,-2000,800,1600,1000,0
#
 subfilt <fakecdps02.su >fakecdpsf02.su fpasshi=20
#
 sunmo <fakecdpsf02.su >fakecdpsfn02.su invert=1 cdp=1 tnmo=0,0.190,0.450,0.800 vnmo=800,1500,2000,3000
#
 suxwigb <fakecdpsfn02.su key=cdp x2beg=0 x2end=19 title="before suflex2d" & 
#
 suflex2d <fakecdpsfn02.su >fakecdpsfnf02.su binsize=50 binalign=25 binfold=2 
#
 suxwigb <fakecdpsfnf02.su key=cdp x2beg=0 x2end=19 title="after suflex2d" &  
#
 sugethw <fakecdpsfnf02.su key=cdp,offset,igi
#
