#!/bin/sh
# Sugeomcsp_statics_and_delim - for program SUGEOMCSV
# Author: Andre Latour, July 2021
#
  echo "----------------------------------------------------------------------------"
  echo "---  This tests the action= options and the delim= option.                  "
  echo "----------------------------------------------------------------------------"
#
# Create some traces and test statics add/subract and different delimiter:
#
  sugeomcsv rfile=l2xall.txt setid=x match=sps2 names=sps2 >fakex.su create=100 spikes=4,0.01,200,1000,208,1200,500,-2000,800,1600,1000,0
#
  echo " --- that was first run of sugeomcsv ---"
#
  sugeomcsv rfile=l2sall.txt setid=s match=sps2 names=sps2 <fakex.su >fakexs.su
#
  echo " --- that was second run of sugeomcsv ---"
#
  sugeomcsv rfile=l2rall.txt setid=r match=sps2 names=sps2 <fakexs.su >fakexsr.su
#
  echo " --- that was third run of sugeomcsv ---"
#
  subfilt <fakexsr.su >fakexsrf.su fpasshi=20
#
  sunmo <fakexsrf.su >fakexsrfn.su invert=1 tnmo=0,0.190,0.450,0.800 vnmo=1800,3500,4000,5000
#
#--------
#
# Replace statics for some receivers:
#
  sugeomcsv rfile=l2rSTATICS.csv missing=pass <fakexsrfn.su >fakexsrfns.su
#
  echo " --- that was fourth run of sugeomcsv ---"
#
  sugethw <fakexsrfns.su key=gstat,grnors,gaps
#
#--------
#
# Add those statics again:
#
  sugeomcsv rfile=l2rSTATICS.csv missing=pass action=add <fakexsrfns.su >fakexsrfns2.su
#
  echo " --- that was fifth run of sugeomcsv ---"
#
  sugethw <fakexsrfns2.su key=gstat,grnors,gaps
#
#--------
#
# Subtract statics for some receivers, using semi-colon delimiter:
#
  sugeomcsv rfile=l2rSTATICSsemi.csv rdelim=";" missing=pass action=subtract <fakexsrfns.su >fakexsrfnss.su
#
  echo " --- that was sixth run of sugeomcsv ---"
#
  sugethw <fakexsrfnss.su key=gstat,grnors,gaps
#
# *** Note that you must double-quote rdelim because semi-colon makes trouble on the command line.
#
  echo "                                                                            "
  echo "                                                                            "
  echo "----------------------------------------------------------------------------"
  echo "---  This tests the action= options and the delim= option.                  "
  echo "----------------------------------------------------------------------------"
