#! /mbari/local/bin/tcsh # process - C Shell script to remove processed OASIS data # and reprocess it all # Copyright (C) 2001 MBARI # Author: Kent Headley # MBARI provides this documentation and code "as is", with no warranty, # express or implied, of its quality or consistency. It is provided without # support and without obligation on the part of the Monterey Bay Aquarium # Research Institute to assist in its use, correction, modification, or # enhancement. This information should not be published or distributed to # third parties without specific written permission from MBARI. # set oasis = /oasis set cfg = $oasis/cfg set headers = $oasis/cfg/headers set bin = $oasis/bin set tmp = $oasis/tmp set TRUE = 1 set FALSE = 0 set doM1 = $FALSE set doM2 = $FALSE set doM46044 = $FALSE set doOA1 = $FALSE set doOA2 = $FALSE set nonomatch @ i = 1 echo "process checking arguments." while ($i <= $#argv ) if ( ($argv[$i] == "m1") || ($argv[$i] == "M1") ) then set doM1 = $TRUE echo "will do m1" endif if ( ($argv[$i] == "m2") || ($argv[$i] == "M2") ) then set doM2 = $TRUE echo "will do m2" endif if ( ($argv[$i] == "m46044") || ($argv[$i] == "M46044") ) then set doM46044 = $TRUE echo "will do m46044" endif if ( ($argv[$i] == "oa1") || ($argv[$i] == "OA1") ) then set doOA1 = $TRUE echo "will do oa1" endif if ( ($argv[$i] == "oa2") || ($argv[$i] == "OA2") ) then set doOA2 = $TRUE echo "will do oa2" endif @ i++ end if ($doM1 == $TRUE) then echo "do m1..." set mooring = m1 cd $oasis/$mooring foreach name (aanderaaO2 adcp emeter error fluor gps gpsclock hrh hs2 hyperOCR imhs2 isus lwr swr metsys microcat microcat2 microcat3 oasis o3gf pco2 tstring impod02 impod03 impod04 impod05 impod06 impod07 impod08 impod09 impod11 ) rm -f data/$name $tmp/$name.tmp cp $headers/$mooring/$name.hdr data/$name foreach year ( 2012 2013 2014 ) foreach file ($name/$year*) awk -f $bin/concat.awk -v year=$year $file >> $tmp/$name.tmp end sort $tmp/$name.tmp | uniq >> data/$name rm -f $tmp/$name.tmp end end echo "done m1..." endif if ($doM2 == $TRUE) then echo "do m2..." set mooring = m2 cd $oasis/$mooring foreach name (aanderaaO2 adcp emeter error fluor o3gf gps hs2 hyperOCR isus lwr swr metsys microcat microcat2 microcat3 oasis pco2 tstring gpsclock imhs2 impod02 impod03 impod04 impod05 impod06 impod07 impod 08 impod09 impod11 ) rm -f data/$name $tmp/$name.tmp cp $headers/$mooring/$name.hdr data/$name foreach year ( 2010 2011 ) foreach file ($name/$year*) awk -f $bin/concat.awk -v year=$year $file >> $tmp/$name.tmp end sort $tmp/$name.tmp | uniq >> data/$name rm -f $tmp/$name.tmp end end endif if ($doM46044 == $TRUE) then echo "do m46044..." set mooring = m46044 cd $oasis/$mooring foreach name (aanderaaO2 emeter error fluor gps hs2 isus oasis o3gf pco2 gpsclock ) rm -f data/$name $tmp/$name.tmp cp $headers/$mooring/$name.hdr data/$name foreach year ( 2011 2012 ) foreach file ($name/$year*) awk -f $bin/concat.awk -v year=$year $file >> $tmp/$name.tmp end sort $tmp/$name.tmp | uniq >> data/$name rm -f $tmp/$name.tmp end end endif if ($doOA1 == $TRUE) then echo "do oa1..." set mooring = oa1 cd $oasis/$mooring foreach name (aanderaaO2 adcp error extAnalog1 extAnalog2 microcat pb200 pco2 ) rm -f data/$name $tmp/$name.tmp cp $headers/$mooring/$name.hdr data/$name foreach year ( 2011 2012 ) foreach file ($name/$year*) awk -f $bin/concat.awk -v year=$year $file >> $tmp/$name.tmp end sort $tmp/$name.tmp | uniq >> data/$name rm -f $tmp/$name.tmp end end echo "done oa2..." endif if ($doOA2 == $TRUE) then echo "do oa2..." set mooring = oa2 cd $oasis/$mooring foreach name (aanderaaO2 adcp error extAnalog1 extAnalog2 microcat pb200 pco2 ) rm -f data/$name $tmp/$name.tmp cp $headers/$mooring/$name.hdr data/$name foreach year ( 2011 2012 ) foreach file ($name/$year*) awk -f $bin/concat.awk -v year=$year $file >> $tmp/$name.tmp end sort $tmp/$name.tmp | uniq >> data/$name rm -f $tmp/$name.tmp end end echo "done oa2..." endif