#! /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 bin = $oasis/bin set tmp = $oasis/tmp set TRUE = 1 set FALSE = 0 set doM1 = $FALSE set doM2 = $FALSE set nonomatch @ i = 1 while ($i <= $#argv ) if ( ($argv[$i] == "m1") || ($argv[$i] == "M1") ) then set doM1 = $TRUE endif if ( ($argv[$i] == "m2") || ($argv[$i] == "M2") ) then set doM2 = $TRUE endif @ i++ end if ($doM1 == $TRUE) then set mooring = m1 cd $oasis/$mooring foreach name (aanderaaO2 adcp emeter error fluor o3gf gps hr1 hs2 hyperOCR isus lwr swr metsys microcat microcat2 microcat3 oasis pco2 tstring gpsclock ) rm -f data/$name $tmp/$name.tmp cp $cfg/$mooring/$name.hdr data/$name foreach year ( 2008 2009 ) 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 # cd $oasis/$mooring/data # awk -f $bin/ctdmean.awk ctd > ctd.mean endif # Take everything but the comments and append it to the header #foreach name (nitrate) #rm -f data/$name #cp $cfg/$mooring/$name.hdr data/$name #foreach file ($name/2000* $name/2001*) #grep -v \# $file >> data/$name #end #end if ($doM2 == $TRUE) then set mooring = m2 cd $oasis/$mooring foreach name (aanderaaO2 adcp emeter error fluor gps hs2 isus metsys microcat oasis o3gf pco2 tstring ) rm -f data/$name $tmp/$name.tmp cp $cfg/$mooring/$name.hdr data/$name foreach year ( 2008 2009 ) 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 # cd $oasis/$mooring/data # awk -f $bin/ctdmean.awk ctd > ctd.mean endif #foreach mooring (m1 m2) # cd $oasis/$mooring/data # awk -f $bin/ctdmean.awk ctd > ctd.mean #end