head	1.24;
access;
symbols
	OctansJune5:1.16
	Ver3-0:1.13
	Ver2-4:1.12
	Ver2-3-2:1.11
	Ver2-3:1.11
	Ver2-2:1.9
	Ver2-1:1.7
	Ver1-11:1.5
	Ver1-10:1.5
	Ver1-9:1.5
	Ver1-8:1.5
	Ver1-7:1.5
	Ver1-6:1.5
	Ver1-5:1.4
	Ver1-4-1:1.3
	Ver1-4:1.3
	Ver1-3:1.3
	Ver1-2:1.3
	Ver1-1:1.3
	Validate1:1.1;
locks; strict;
comment	@# @;


1.24
date	2001.10.25.13.31.22;	author rob;	state Exp;
branches;
next	1.23;

1.23
date	2001.10.23.20.00.29;	author rob;	state Exp;
branches;
next	1.22;

1.22
date	2001.08.31.14.18.14;	author hthomas;	state Exp;
branches;
next	1.21;

1.21
date	2001.08.03.00.23.05;	author henthorn;	state Exp;
branches;
next	1.20;

1.20
date	2001.08.03.00.03.39;	author henthorn;	state Exp;
branches;
next	1.19;

1.19
date	2001.07.19.18.53.57;	author henthorn;	state Exp;
branches;
next	1.18;

1.18
date	2001.07.19.01.37.40;	author hthomas;	state Exp;
branches;
next	1.17;

1.17
date	2001.07.09.18.31.20;	author henthorn;	state Exp;
branches;
next	1.16;

1.16
date	2001.06.05.22.19.10;	author rob;	state Exp;
branches;
next	1.15;

1.15
date	2001.06.05.01.20.47;	author rob;	state Exp;
branches;
next	1.14;

1.14
date	2001.05.02.22.31.19;	author rob;	state Exp;
branches;
next	1.13;

1.13
date	2001.04.09.00.07.42;	author rob;	state Exp;
branches;
next	1.12;

1.12
date	2001.03.15.19.36.26;	author rob;	state Exp;
branches;
next	1.11;

1.11
date	2000.08.20.23.51.52;	author rob;	state Exp;
branches;
next	1.10;

1.10
date	2000.08.20.22.29.37;	author rob;	state Exp;
branches;
next	1.9;

1.9
date	2000.06.21.21.16.53;	author rob;	state Exp;
branches;
next	1.8;

1.8
date	2000.06.14.01.56.15;	author rob;	state Exp;
branches;
next	1.7;

1.7
date	2000.05.21.23.27.58;	author rob;	state Exp;
branches;
next	1.6;

1.6
date	2000.05.19.15.55.08;	author rob;	state Exp;
branches;
next	1.5;

1.5
date	2000.01.19.04.10.34;	author rob;	state Exp;
branches;
next	1.4;

1.4
date	2000.01.18.04.47.56;	author rob;	state Exp;
branches;
next	1.3;

1.3
date	2000.01.14.19.21.05;	author rob;	state Exp;
branches;
next	1.2;

1.2
date	2000.01.12.23.08.20;	author pean;	state Exp;
branches;
next	1.1;

1.1
date	2000.01.10.18.42.57;	author pean;	state Exp;
branches;
next	;


desc
@@


1.24
log
@Added automatic *5 decimation of the kearfott.log because of its unweildy size
and high sampling rate.
@
text
@##############################################################
#
# PURPOSE: Convert binary files generated by the flight code into
#          Matlab-readable ASCII files.  ABBREVIATED VERSION
# AUTHOR:  rsm
# DATE:    99/12/20
# NOTES:   See the companion Matlab script loadData.m
#          00/1/11: The -a option, which supposedly checks file existance
#                   doesn't appear to work.  -f determines regularity.
#
#
##############################################################
#
  if [ -f simulation.log -a -s simulation.log ]
  then
    echo "Converting simulation.log"
    #
    # If an argument exists, skip that many records.
    #
    if [ $1 ]
    then
      logToMatlab -skip $1 simulation.log > dataS.m
    else
      logToMatlab simulation.log > dataS.m
    fi
  fi

  if [ -f navigation.log -a -s navigation.log ]
  then
    echo "Converting navigation.log"
    if [ $1 ]
    then
      logToMatlab -skip $1 navigation.log > dataN.m
    else
      logToMatlab navigation.log > dataN.m
    fi
  fi

  if [ -f dynamicControl.log -a -s dynamicControl.log ]
  then
    echo "Converting dynamicControl.log"
    if [ $1 ]
    then
      logToMatlab -skip $1 dynamicControl.log > dataD.m
    else
      logToMatlab dynamicControl.log > dataD.m
    fi
  fi

  if [ -f ctdlog.log -a -s ctdlog.log ]
  then
    echo "Converting ctdlog.log"
    if [ $1 ]
    then
      logToMatlab -skip $1 ctdlog.log > dataCTD.m
    else
      logToMatlab ctdlog.log > dataCTD.m
    fi
  fi

  if [ -f ctdDriver.log -a -s ctdDriver.log ]
  then
    echo "Converting ctdDriver.log"
    if [ $1 ]
    then
      logToMatlab -skip $1 ctdDriver.log > dataCTD.m
    else
      logToMatlab ctdDriver.log > dataCTD.m
    fi
  fi

  if [ -f seabird.log -a -s seabird.log ]
  then
    echo "Converting seabird.log"
    if [ $1 ]
    then
      logToMatlab -skip $1 seabird.log > dataCTD2.m
    else
      logToMatlab seabird.log > dataCTD2.m
    fi
  fi

  if [ -f seabird1.log -a -s seabird1.log ]
  then
    echo "Converting seabird1.log"
    if [ $1 ]
    then
      logToMatlab -skip $1 seabird1.log > dataCTD1.m
    else
      logToMatlab seabird1.log > dataCTD1.m
    fi
  fi

  if [ -f seabird2.log -a -s seabird2.log ]
  then
    echo "Converting seabird2.log"
    if [ $1 ]
    then
      logToMatlab -skip $1 seabird2.log > dataCTD2.m
    else
      logToMatlab seabird2.log > dataCTD2.m
    fi
  fi

  if [ -f tailCone.log -a -s tailCone.log ]
  then
    echo "Converting tailCone.log"
    if [ $1 ]
    then
      logToMatlab -skip $1 tailCone.log > dataTailCone.m
    else
      logToMatlab tailCone.log > dataTailCone.m
    fi
  fi

  if [ -f metrabytelog.log -a -s metrabytelog.log ]
  then
    echo "Converting metrabytelog.log; file name is dataMBL.m"
    if [ $1 ]
    then
      logToMatlab -skip $1 metrabytelog.log > dataMBL.m
    else
      logToMatlab metrabytelog.log > dataMBL.m
    fi
  fi

  if [ -f PS8000.log -a -s PS8000.log ]
  then
    echo "Converting PS8000.log; file name is dataPS8.m"
    if [ $1 ]
    then
      logToMatlab -skip $1 PS8000.log > dataPS8.m
    else
      logToMatlab PS8000.log > dataPS8.m
    fi
  fi

  if [ -f parosci.log -a -s parosci.log ]
  then
    echo "Converting parosci.log"
    if [ $1 ]
    then
      logToMatlab -skip $1 parosci.log > dataPS.m
    else
      logToMatlab parosci.log > dataPS.m
    fi
  fi

  if [ -f psa916log.log -a -s psa916log.log ]
  then
    echo "Converting psa916log.log"
    if [ $1 ]
    then
      logToMatlab -skip $1 psa916log.log > dataPSA.m
    else
      logToMatlab psa916log.log > dataPSA.m
    fi
  fi

  if [ -f gps.log -a -s gps.log ]
  then
   echo "Converting gps.log"
   logToMatlab gps.log > dataGPS.m
  fi
#
# Again skip for brevity.  The important stuff is passed through
# to Navigation anyway.
#
  if [ ]    ###############
  then

  if [ -f kvhInclinometer.log -a -s kvhInclinometer.log ]
  then
    echo "Converting kvhInclinometer"
    if [ $1 ]
    then
      logToMatlab -skip $1 kvhInclinometer.log > dataINC.m
    else
      logToMatlab kvhInclinometer.log > dataINC.m
    fi
  fi

  if [ -f kvhCompass.log -a -s kvhCompass.log ]
  then
    echo "Converting kvhCompass"
    if [ $1 ]
    then
      logToMatlab -skip $1 kvhCompass.log > dataCOM.m
    else
      logToMatlab kvhCompass.log > dataCOM.m
    fi
  fi

  fi      ############# 

  if [ -f crossbow.log -a -s crossbow.log ]
  then
    echo "Converting Crossbow data"
    if [ $1 ]
    then
      let nlines=$1+5
      logToMatlab -skip $nlines crossbow.log > dataCrossB.m
    else
      logToMatlab -skip 5 crossbow.log > dataCrossB.m
    fi
  fi

  if [ -f dvl.log -a -s dvl.log ]
  then
    echo "Converting DVL Data.  The file name is dataDVL.m"
    if [ $1 ]
    then
      let nlines=$1
      logToMatlab -skip $nlines dvl.log > dataDVL.m
    else
      logToMatlab dvl.log > dataDVL.m
    fi
  fi

  if [ -f fuelcell.log -a -s fuelcell.log ]
  then
    echo "Converting fuel cell Data.  The file name is dataFuelCell.m"
    if [ $1 ]
    then
      let nlines=$1
      logToMatlab -skip $nlines fuelcell.log > dataFuelCell.m
    else
      logToMatlab fuelcell.log > dataFuelCell.m
    fi
  fi

  if [ -f octans.log -a -s octans.log ]
  then
    echo "Converting Octans Data.  The file name is dataOct.m"
    echo "The array name is dataO"
    if [ $1 ]
    then
      let nlines=$1
      logToMatlab -skip $nlines octans.log > dataOct.m
    else
      logToMatlab octans.log > dataOct.m
    fi
  fi

  if [ -f kearfott.log -a -s kearfott.log ]
  then
    echo "Converting Kearfott Data.  The file name is dataKft.m"
    echo "The array name is dataK"
    if [ $1 ]
    then
      let nlines=$1
      let nlines=nlines*5
      logToMatlab -skip $nlines kearfott.log > dataKft.m
    else
      logToMatlab -skip 5 kearfott.log > dataKft.m
    fi
  fi

#
# Convert Ips4 log file
#
  if [ -f ipslog.log -a -s ipslog.log ]
  then
    echo "Converting Ips4 Data.  The file name is dataIps4.m"
    if [ $1 ]
    then
      let nlines=$1
      logToMatlab -skip $nlines ipslog.log > dataIps4.m
    else
      logToMatlab ipslog.log > dataIps4.m
    fi
  fi

#
# Convert Isus log file
#
  if [ -f isuslog.log -a -s isuslog.log ]
  then
    echo "Converting Isus Data.  The file name is dataIsus.m"
    if [ $1 ]
    then
      let nlines=$1
      logToMatlab -skip $nlines isuslog.log > dataIsus.m
    else
      logToMatlab isuslog.log > dataIsus.m
    fi
  fi

#
# Convert PA200LR log file
#
  if [ -f pa200LRlog.log -a -s pa200LRlog.log ]
  then
    echo "Converting PA200LR Data.  The file name is dataPA200LR.m"
    if [ $1 ]
    then
      let nlines=$1
      logToMatlab -skip $nlines pa200LRlog.log > dataPA200LR.m
    else
      logToMatlab pa200LRlog.log > dataPA200LR.m
    fi
  fi

#
# Convert Buoy Launcher log file
#
  if [ -f buoylauncherlog.log -a -s buoylauncherlog.log ]
  then
    echo "Converting Buoy Launcher Data.  The file name is dataBuoy.m"
    if [ $1 ]
    then
      let nlines=$1
      logToMatlab -skip $nlines buoylauncherlog.log > dataBuoy.m
    else
      logToMatlab buoylauncherlog.log > dataBuoy.m
    fi
  fi

#
# If the mission had waypoints, gobble up syslog and extract 
# waypoint information.
#
  if [ -s syslog ]
  then
    grep wplog syslog > temp.txt
  else
    echo "Syslog is empty."
  exit -1
  fi

  if [ -s temp.txt ]
  then
    echo "Extracting waypoints from syslog."
  else
    exit -1
  fi
  #
  # This gnarly sed command inserts a ' at the start and end of each line.
  #
  cat temp.txt | sed 's/^/'\''/' | sed 's/$/'\''/' > temp1.txt

  echo "dataWPstr = [ ... " > waypoint.m
  cat temp1.txt >> waypoint.m
  echo " ];" >>    waypoint.m

  rm temp.txt
  rm temp1.txt
@


1.23
log
@Added the coversion of Kearfott data
@
text
@d248 1
a248 1
    echo "The array name is dataO"
d252 1
d255 1
a255 1
      logToMatlab kearfott.log > dataKft.m
@


1.22
log
@added additional science sensors to cvt script
@
text
@d245 13
@


1.21
log
@Fix residual error.
@
text
@d61 11
d77 1
a77 1
      logToMatlab -skip $1 seabird.log > dataCTD.m
d79 1
a79 1
      logToMatlab seabird.log > dataCTD.m
d149 1
a149 2

  if [ -f psa916.log -a -s psa916.log ]
d151 1
a151 1
    echo "Converting psa916.log"
d154 1
a154 1
      logToMatlab -skip $1 psa916.log > dataPSA.m
d156 1
a156 1
      logToMatlab psa916.log > dataPSA.m
@


1.20
log
@Refrain from skipping the parosci log file.
@
text
@a125 7
#
# Skip these to reduce the time of the RF transfer.
# 
  if [ ]
  then
#      Nothing to skip
  fi # end skip
@


1.19
log
@Don't skip the psa916 log and also process seabird logs.
@
text
@d131 2
a143 2

  fi # end skip
@


1.18
log
@added dual seabird support
@
text
@d61 11
a142 1

a155 1

@


1.17
log
@Convert logs for Ips4, Isus, PA200LR, and BuoyLauncher.
@
text
@d61 22
d133 3
a146 1
  fi # end skip
@


1.16
log
@Moved conversion of Octans data ahead of the last part, so that cvt
doesn't exit before doing it.
@
text
@d210 60
@


1.15
log
@Added Octans coversion.
@
text
@d195 14
a237 13

  if [ -f octans.log -a -s octans.log ]
  then
    echo "Converting Octans Data.  The file name is dataOct.m"
    echo "The array name is dataO"
    if [ $1 ]
    then
      let nlines=$1
      logToMatlab -skip $nlines octans.log > dataOct.m
    else
      logToMatlab octans.log > dataOct.m
    fi
  fi
@


1.14
log
@Fixed error in conversion of fuel cell data that overwrote it with the
dvl data.
@
text
@d224 13
@


1.13
log
@Added fuel cell data conversion.
@
text
@d192 1
a192 1
      logToMatlab dvl.log > dataFuelCell.m
@


1.12
log
@Added DVL data conversion.
@
text
@d183 12
@


1.11
log
@Renamed data file dataPS8 to avoid conflict.
@
text
@d171 12
@


1.10
log
@Added read-in of PS8000 log.
@
text
@d85 1
a85 1
    echo "Converting PS8000.log; file name is dataPS.m"
d88 1
a88 1
      logToMatlab -skip $1 PS8000.log > dataPS.m
d90 1
a90 1
      logToMatlab PS8000.log > dataPS.m
@


1.9
log
@Added code to extract the waypoints from syslog.
@
text
@d82 11
@


1.8
log
@Now processes Winfrog data, and ship data from Winfrog GPS.
@
text
@d82 3
a84 3
  #
  # Skip these to reduce the time of the RF transfer.
  # 
d118 4
a121 4
  #
  # Again skip for brevity.  The important stuff is passed through
  # to Navigation anyway.
  #
d160 11
d172 10
d183 6
@


1.7
log
@Added conversion for tailcone log.
@
text
@d14 1
a14 1
  if [ -f simulation.log ]
d28 1
a28 1
  if [ -f navigation.log ]
d39 1
a39 1
  if [ -f dynamicControl.log ]
d50 1
a50 1
  if [ -f ctdlog.log ]
d61 1
a61 1
  if [ -f tailCone.log ]
d71 11
d88 1
a88 1
  if [ -f parosci.log ]
d100 1
a100 1
  if [ -f psa916.log ]
d113 1
a113 1
  if [ -f gps.log ]
d125 1
a125 1
  if [ -f kvhInclinometer.log ]
d136 1
a136 1
  if [ -f kvhCompass.log ]
d149 1
a149 1
  if [ -f crossbow.log ]
@


1.6
log
@Added conversion for tailCone.log
@
text
@d66 1
a66 1
      logToMatlab -skip $1 tailCone.log > dataTC.m
d68 1
a68 1
      logToMatlab tailCone.log > dataTC.m
@


1.5
log
@Doesn't convert unnecessary data like the KVH stuff, as it is also
logged in dataN.m.  This is to save time over the RF link.  A new
conversion script, "cvta", converts everything.
@
text
@d60 11
@


1.4
log
@Added decimation option.
@
text
@d4 1
a4 1
#          Matlab-readable ASCII files.
d60 5
d89 13
a101 5
#  if [ -f gps.log ]
#  then
#   echo "Converting gps.log"
#   logToMatlab gps.log > dataGPS.m
#  fi
d122 14
@


1.3
log
@Fixed ctd log file name error.
@
text
@d17 9
a25 1
    logToMatlab simulation.log > dataS.m
d31 6
a36 1
    logToMatlab navigation.log > dataN.m
d42 6
a47 1
    logToMatlab dynamicControl.log > dataD.m
d53 6
a58 1
    logToMatlab ctdlog.log > dataCTD.m
d64 6
a69 1
    logToMatlab parosci.log > dataPS.m
d75 7
a81 2
   echo "Converting psa916.log"
   logToMatlab psa916log.log > dataPSA.m
d93 6
a98 1
    logToMatlab kvhInclinometer.log > dataINC.m
d104 6
a109 1
    logToMatlab kvhCompass.log > dataCOM.m
@


1.2
log
@Checked in for Rob.
@
text
@d32 1
a32 1
  if [ -f ctd.log ]
@


1.1
log
@Initial checkin to CVS
@
text
@d8 2
d11 1
d14 5
a18 2
echo "Converting simulation.log"
logToMatlab simulation.log > dataS.m
d20 5
a24 2
echo "Converting navigation.log"
logToMatlab navigation.log > dataN.m
d26 5
a30 2
echo "Converting dynamicControl.log"
logToMatlab dynamicControl.log > dataD.m
d32 36
@
