Commit d70f8533 authored by Yvonne Firing's avatar Yvonne Firing
Browse files

starting exec on gitlab

parents
#!/bin/csh -f
#
#Script by BAK on cruise jc032 to create symbolic links.
#Modified by BGW for cruise di346
#Modified by CPA to import oxygen files from /Drobo
#The assumption is that the raw files are named
#in a way that identifies the instrument, eg
# ctd_jc032_001_ctm.cnv
#
#
# The initial foreach command will need to be modified for each cruise.
#cd data
#cd ctd
# modded bak di368
# bak jc069 for cfc file names like JC069ST72.csv. I wonder what they'll do when they get to station 100 !
cd
cd cruise/data
cd ctd
cd BOTTLE_CFC
# jc069, cfc csv files copid in from mac mini using rsync on mac mini
#####foreach i (`ls discofs/D368*csv`)
#####set copyfile = `echo $i | awk '{print substr($1,9,22)}'`
######echo $copyfile
#####if (! -e $copyfile) then
##### echo Copying file $i
##### cp -p $i .
#####endif
#####
#####end
#foreach i (`ls JC069ST??.csv`)
# 2 digit station numbers
foreach i (`ls JR302_station_??.csv`)
#echo $i
set num = `echo $i | awk '{print substr($1,15,2)}'`
set num = 0$num # 2 digit nums require an extra zero
set cruise = 'jr302'
#echo $num
set linkfile = cfc_${cruise}_${num}_raw.csv
#echo $linkfile
if (! -e $linkfile) then
echo Making link $linkfile for raw file $i
ln -s $i $linkfile
endif
end
# 3 digit station numbers
foreach i (`ls JR302_station_???.csv`)
#echo $i
set num = `echo $i | awk '{print substr($1,15,3)}'`
set num = $num # 2 digit nums require an extra zero
set cruise = 'jr302'
#echo $num
set linkfile = cfc_${cruise}_${num}_raw.csv
#echo $linkfile
if (! -e $linkfile) then
echo Making link $linkfile for raw file $i
ln -s $i $linkfile
endif
end
File added
#/bin/csh -f
#
# bak feb 2009 before jc031 jc032
# quick and dirty inefficient csh script in case nerc system env_clean doesn't exist
set v = "$1"
set v1 = `echo $v | sed 's/ /:/g'`
set v1 = `echo $v | sed 's/:/ /g'`
if (-e /nerc/bin/env_clean) then
set v2 = `echo $v1 | sed 's/ /:/g'`
echo `env_clean $v2`
exit
endif
set fn = ./wk_envclean_$$_$$
echo "$v1" | awk '{for (i = 1;i<=NF;i=i+1) printf("%s\n",$i)}' > $fn
set numv = `wc -l $fn | awk '{print $1}'`
set newv = ''
set fn2 = ./wk2_envclean_$$_$$
touch $fn2
set k = 0
while ($k < $numv)
@ k = $k + 1
set v2 = `head -$k $fn | tail -1`
# if ($v2 == ".") then
# egrep -e "\." $fn2 > /dev/null
# if ($status != 0) then
# echo $v2 >> $fn2
# set newv = ($newv $v2)
# endif
# else
# grep $v2 $fn2 > /dev/null
# if ($status != 0) then
# echo $v2 >> $fn2
# set newv = ($newv $v2)
# endif
set match = 0
set numf2 = `wc -l $fn2 | awk '{print $1}'`
set k2 = 0
while ($k2 < $numf2)
@ k2 = $k2 + 1
set v3 = `head -$k2 $fn2 | tail -1`
if ($v3 == $v2) then
set match = 1
endif
end
if ($match == 0) then
echo $v2 >> $fn2
set newv = ($newv $v2)
endif
# endif
end
set newenv = `echo $newv | sed 's/ /:/g'`
echo $newenv
/bin/rm $fn $fn2
#
setenv TZ GMT
umask 022
set noclobber
limit coredumpsize 0
alias lr 'ls -lrtd'
alias rm 'rm -i'
alias mv 'mv -i'
alias cp 'cp -i'
alias h history
# The next line should work on all of nosea1, nosea2, rapid.
# $dhome is the directory that contains directory 'data' for the cruise.
# The easiest thing is to use a symbolic link frmo 'cruise' to a named cruise directory
# eg cd /local/users/pstar; ln -s di344 cruise
# $shome contains software. It may take the same value as $dhome
set dhome = /local/users/pstar/cruise # BAK 5 Aug 2009 at NOC preparing for di344/345/346 & jr195
set shome = /local/users/pstar/cruise # BAK 5 Aug 2009 at NOC preparing for di344/345/346 & jr195
set path = (. $dhome/data/exec/jcr $path)
set path = (. $dhome/data/exec/commands $path)
set path = (. $dhome/data/exec $path)
if (-e $dhome/data/exec/commands/varclean) then
set path = ` tcsh -f $dhome/data/exec/commands/varclean "$path"`
endif
if (! $?cdpath )set cdpath
set cdpath = (. $dhome/data $dhome $cdpath)
if (-e $dhome/data/exec/commands/varclean) then
set cdpath = ` tcsh -f $dhome/data/exec/commands/varclean "$cdpath"`
endif
alias eta ssh cook3 eta
alias etanext ssh cook3 etanext
#
set myhost = `hostname`
# bak jc069
#setenv PRINTER jc069_53
#setenv PRINTER _192_168_62_53
#setenv PRINTER cook_lab # lpd://192.168.62.52 hp 2605 color laser jc069 with driver HP Color LaserJet Series PCL 6 CUPS
# bak jr281
# setenv PRINTER hp4550 # color printer in JCR data prep lab
# setenv PRINTER data_prep_bw # This is set as default on nosea2 on jr281; firefox: http://127.0.0.1:631/printers
# setenv PRINTER data_prep_colour # alternative on jr281; 10.104.2.242; HP Color LaserJet Series PCL 6 CUPS; 600 dpi
#
setenv TZ GMT
umask 022
set noclobber
limit coredumpsize 0
alias lr 'ls -lrtd'
alias rm 'rm -i'
alias mv 'mv -i'
alias cp 'cp -i'
alias h history
alias eta ssh cook3 eta
alias etanext ssh cook3 etanext
if ($myhost == 'nosea1') then
setup v2007b matlab # current version Aug 2009
endif
if ($myhost == 'nosea2') then
# setup v2007b matlab # current version Aug 2009
setup v2009a matlab # current version Mar 2013
endif
if ($myhost == 'rapid') then
setup v2007a matlab # current version Aug 2009
endif
if ($myhost == 'nomore') then
setup v2007b matlab # current version Oct 2009
endif
if ($myhost == 'oceanus') then
setup v2009a matlab # current version august 2011
endif
#set phome = /noc/users/pstar
#set phome = /data32/cruise/pstar
# The next line should work on all of nosea1, nosea2, rapid.
# $dhome is the directory that contains directory 'data' for the cruise.
# The easiest thing is to use a symbolic link frmo 'cruise' to a named cruise directory
# eg cd /local/users/pstar; ln -s di344 cruise
# $shome contains software. It may take the same value as $dhome
set dhome = /local/users/pstar/cruise # BAK 5 Aug 2009 at NOC preparing for di344/345/346 & jr195
set shome = /local/users/pstar/cruise # BAK 5 Aug 2009 at NOC preparing for di344/345/346 & jr195
set path = (. $dhome/data/exec/jcr $path)
set path = (. $dhome/data/exec/commands $path)
set path = (. $dhome/data/exec $path)
if (-e $dhome/data/exec/commands/varclean) then
set path = ` tcsh -f $dhome/data/exec/commands/varclean "$path"`
endif
set path = (. $shome/sw/ladcp/ix/geomag $path) # path to ix geomag added by bak on jr281 april 2013
set path = (. $shome/sw/uh_adcp/programs/codas3/bin/lnx64 $path)
set path = (. $shome/sw/uh_adcp/programs/pycurrents/adcp $path)
set path = (. $shome/sw/uh_adcp/programs/pycurrents/data/nmea $path)
set path = (. $shome/sw/python $path)
if (-e $dhome/data/exec/commands/varclean) then
set path = ` tcsh -f $dhome/data/exec/commands/varclean "$path"`
endif
if (! $?cdpath )set cdpath
set cdpath = (. $dhome/data $dhome $cdpath)
if (-e $dhome/data/exec/commands/varclean) then
set cdpath = ` tcsh -f $dhome/data/exec/commands/varclean "$cdpath"`
endif
if (! $?PYTHONPATH) setenv PYTHONPATH
setenv PYTHONPATH $shome/sw/uh_adcp/programs:$PYTHONPATH
if (-e $dhome/data/exec/commands/envclean) then
setenv PYTHONPATH ` tcsh -f $dhome/data/exec/commands/envclean "$PYTHONPATH"`
endif
if (! $?MATLABPATH) setenv MATLABPATH
# Original line by bak to use mexec stuff in /noc/users/pstar
# setenv MATLABPATH ~pstar/data/exec/matlab_startup:$MATLABPATH
# Shipboard version has mexec stuff in /data32 so use that instead
if (-e $dhome/data/mexec_processing_scripts) then
setenv MATLABPATH $dhome/data/mexec_processing_scripts:$MATLABPATH
endif
if ( -e $shome/sw/m_map) then
setenv MATLABPATH $shome/sw/m_map:$MATLABPATH
endif
if (-e $dhome/data/exec/commands/envclean) then
setenv MATLABPATH ` tcsh -f $dhome/data/exec/commands/envclean "$MATLABPATH"`
endif
#/bin/csh -f
#
# bak feb 2009 before jc031 jc032
# quick and dirty inefficient csh script in case nerc system env_clean doesn't exist
set v = "$1"
set v1 = `echo $v | sed 's/ /:/g'`
set v1 = `echo $v | sed 's/:/ /g'`
if (-e /nerc/bin/env_clean) then
set v2 = `echo $v1 | sed 's/ /:/g'`
set newv = `env_clean $v2`
set newenv = `echo $newv | sed 's/:/ /g'`
echo $newenv
exit
endif
set fn = ./wk_envclean_$$_$$
echo "$v1" | awk '{for (i = 1;i<=NF;i=i+1) printf("%s\n",$i)}' > $fn
set numv = `wc -l $fn | awk '{print $1}'`
set newv = ''
set fn2 = ./wk2_envclean_$$_$$
touch $fn2
set k = 0
while ($k < $numv)
@ k = $k + 1
set v2 = `head -$k $fn | tail -1`
# if ($v2 == ".") then
# egrep -e "\." $fn2 > /dev/null
# if ($status != 0) then
# echo $v2 >> $fn2
# set newv = ($newv $v2)
# endif
# else
# grep $v2 $fn2 > /dev/null
# if ($status != 0) then
# echo $v2 >> $fn2
# set newv = ($newv $v2)
# endif
set match = 0
set numf2 = `wc -l $fn2 | awk '{print $1}'`
set k2 = 0
while ($k2 < $numf2)
@ k2 = $k2 + 1
set v3 = `head -$k2 $fn2 | tail -1`
if ($v3 == $v2) then
set match = 1
endif
end
if ($match == 0) then
echo $v2 >> $fn2
set newv = ($newv $v2)
endif
# endif
end
echo $newv
/bin/rm $fn $fn2
# copy TPLs and edit oceanlogger
set in = scs_raw
set ot = scs_sed
cd ~
cd cruise
cd data
/bin/cp -p $in/*TPL $ot
cd $ot
cat << ! >! wk
126,oceanlogger-sampletimeyyyy,YYYY
126,oceanlogger-sampletimeddd,DDD
126,oceanlogger-sampletimehhmmss,HH:MM:SS
!
cat oceanlogger.TPL | sed -n '2,$p' >> wk
mv oceanlogger.TPL oceanlogger.TPL_original
mv wk oceanlogger.TPL
#!/bin/csh -f
#
#copy the raw and SBE-processed CTD files from the ship machine
#then make links to the files to be ingested by mexec using the expected name format
cd /local/users/pstar/cruise/data #mexecloc is replaced with $mexecloc by conf_script_cruise
set cpre = JR18002
rsync -av /mnt/data/jcr/current/ctd/jr18002/*.cnv ctd/ASCII_FILES/
rsync -av /mnt/data/jcr/current/ctd/jr18002/*.bl ctd/ASCII_FILES/
rsync -av /mnt/data/jcr/current/ctd/*.ros ctd/ASCII_FILES/
rsync -av /mnt/data/jcr/current/ctd/jr18002/SBE35/ ctd/ASCII_FILES/SBE35/
cd ctd/ASCII_FILES
foreach i (`ls ${cpre}_???_align_ctm.cnv`)
set num = `awk -v nm="$i" 'BEGIN {print substr(nm,index(nm,"_align")-3,3)}'`
set linkfile = ctd_jr18002_${num}_ctm.cnv
if (! -e $linkfile) then
echo Making link $linkfile for raw file $i
ln -s $i $linkfile
endif
end
#below could be commented out if T spikes aren't a problem
foreach i (`ls ${cpre}_???_align.cnv`)
set num = `awk -v nm="$i" 'BEGIN {print substr(nm,index(nm,"_align")-3,3)}'`
set linkfile = ctd_jr18002_${num}_noctm.cnv
if (! -e $linkfile) then
echo Making link $linkfile for raw file
ln -s $i $linkfile
endif
end
#foreach i (`ls ${cpre}_???_align.cnv`)
# gzip -f $i
#end
#foreach i (`ls ${cpre}_???.cnv`)
# gzip -f $i
#end
foreach i (`ls ${cpre}_???.bl`)
set num = `awk -v nm="$i" 'BEGIN {print substr(nm,index(nm,".bl")-3,3)}'`
set linkfile = ctd_jr18002_${num}.bl
if (! -e $linkfile) then
echo Making link $linkfile for raw file $i
ln -s $i $linkfile
endif
end
cd ../RAW_CTD_FILES
rsync -av /mnt/data/jcr/current/ctd/jr18002/*.hdr .
rsync -av /mnt/data/jcr/current/ctd/jr18002/*.hex .
rsync -av /mnt/data/jcr/current/ctd/jr18002/*.XMLCON .
rsync -av /mnt/data/jcr/current/ctd/jr18002/*.btl .
#gzip -f *.hex
cd ../..
anemometer
dopplerlog
ea600
em122
emlog-vhw
emlog-vlw
furuno-gga
furuno-gll
furuno-rmc
furuno-vtg
furuno-zda
gravity-dat
gravity-env
gyro
netmonitor
oceanlogger
seaspy
seatex-gga
seatex-gll
seatex-hdt
seatex-vtg
seatex-zda
tcount
tsshrp
usbl-gga
winch
msvars anemometer
msvars ashtech
msvars dopplerlog
msvars ea600
msvars em120
msvars emlog-vhw
msvars emlog-vlw
msvars furuno-gga
msvars furuno-gll
msvars furuno-rmc
msvars furuno-vtg
msvars furuno-zda
msvars glonass
msvars gyro
msvars netmonitor
msvars oceanlogger
msvars seaspy
msvars seatex-gga
msvars seatex-gll
msvars seatex-hdt
msvars seatex-psxn
msvars seatex-vtg
msvars seatex-zda
msvars tsshrp
msvars winch
anemometer
ashtech
dopplerlog
ea600
em122
emlog-vhw
emlog-vlw
furuno-gga
furuno-gll
furuno-rmc
furuno-vtg
furuno-zda
glonass
gravity-dat
gravity-env
gyro
netmonitor
oceanlogger
seaspy
seatex-gga
seatex-gll
seatex-hdt
seatex-psxn
seatex-vtg
seatex-zda
tsshrp
usbl-gga
winch
anemometer
ashtech
dopplerlog
ea600
em122
emlog-vhw
emlog-vlw
furuno-gga
furuno-gll
furuno-rmc
furuno-vtg
furuno-zda
glonass
gravity-dat
gravity-env
gyro
netmonitor
oceanlogger
seaspy
seatex-gga
seatex-gll
seatex-hdt
seatex-psxn
seatex-vtg
seatex-zda
tsshrp
usbl-gga
winch
anemometer
ashtech
dopplerlog
ea600
em122
emlog-vhw
emlog-vlw
furuno-gga
furuno-gll
furuno-rmc
furuno-vtg
furuno-zda
glonass
gyro
netmonitor
oceanlogger
seaspy
seatex-gga
seatex-gll
seatex-hdt
seatex-psxn
seatex-vtg
seatex-zda
tsshrp
usbl-gga
winch
anemometer
ashtech
dopplerlog
ea600
em122
emlog-vhw
emlog-vlw
furuno-gga
furuno-gll
furuno-rmc
furuno-vtg
furuno-zda
glonass
gyro
netmonitor
oceanlogger
seaspy
seatex-gga
seatex-gll
seatex-hdt
seatex-psxn
seatex-vtg
seatex-zda
tsshrp
usbl-gga
winch
anemometer
ashtech
dopplerlog
ea600
em122
emlog-vhw
emlog-vlw
furuno-gga
furuno-gll
furuno-rmc
furuno-vtg
furuno-zda
glonass
gyro
netmonitor
oceanlogger
seaspy
seatex-gga
seatex-gll
seatex-hdt
seatex-psxn
seatex-vtg
seatex-zda
tsshrp
usbl-gga
winch
anemometer
ashtech
dopplerlog
ea600
em120
emlog-vhw
emlog-vlw
furuno-gga
furuno-gll
furuno-rmc
furuno-vtg
furuno-zda
glonass
gyro
netmonitor
oceanlogger
seaspy
seatex-gga
seatex-gll
seatex-hdt
seatex-psxn
seatex-vtg
seatex-zda
tsshrp
winch
% bak on jr302
% make_list_for_sedexec_startall
mcsetd('M_SCSRAW','q');
rawdir = MEXEC_G.MEXEC_CWD;
cmd = ['ls -1 ' rawdir ' | grep ACO | sed ''s/.ACO//'' >! ' MEXEC.mstar_root '/data/exec/jcr/list_' MEXEC_G.MSCRIPT_CRUISE_STRING]; [stat res] = unix(cmd);
cmd = ['cd ' MEXEC.mstar_root '/data/exec/jcr']; eval(cmd)
cmd = ['/bin/rm list']; unix(cmd);
cmd = ['ln -s list_' MEXEC_G.MSCRIPT_CRUISE_STRING ' list']; unix(cmd);
fprintf(1,'%s\n%s\n','Made list of scs streams for sedexec',['List is in ' MEXEC.mstar_root '/data/exec/jcr/list']);
\ No newline at end of file
#/bin/tcsh -f
#
# run a version of scp
set fn = $1
scp -p ${fn} bak@ssh.noc.soton.ac.uk:/noc/ooc/drake/JR239/transit_files
#/bin/tcsh -f
#
# run a version of scp
set fn = $1
scp -p bak@ssh.noc.soton.ac.uk:/noc/ooc/drake/JR239/transit_files/${fn} .
#/bin/csh -f
set stream = $1
set infile = "../scs_raw/${stream}.ACO"
set otfile = "./${stream}.ACO"
echo infile $infile
echo otfile $otfile
echo $MACHTYPE
if ($MACHTYPE == 'x86_64-suse-linux') then
set sedcom = "sed -u"
else if ($MACHTYPE == 'x86_64') then
set sedcom = "sed -u"
else if ($MACHTYPE == 'i386') then
set sedcom = "sed -l"
else
set sedcom = "sed"
endif
echo $sedcom
pushd scs_sed
ps -ef | grep tail | grep ${stream} | sed 's/ /Q/' | sed 's/^.*Q//' | sed 's/^ *//' | sed 's/ .*$//' >! wk$$
foreach i (`cat wk$$`)
kill -9 ${i}
end
/bin/rm wk$$
if (-e ${otfile}) then
/bin/rm ${otfile}
endif
#tail -c 10000000000 -f ${infile} | ${sedcom} 's/, *,/,NaN,/g' | ${sedcom} 's/, *,/,NaN,/g' | ${sedcom} 's/://g' | ${sedcom} 's/,/ /g' >! ${otfile} &
# empty fields after the final comma will be lost, unless we add an extra comma at end of line.
# structure seems to be a c/r immediately before the newline recognised by sed as end of line. Repalce the cr by 'comma'
# take care of status variables with value 'A'
# take care of checksum on seatex-gll, value 'A*..'
# take care of glonass version CJ00
#tail -c 10000000000 -f ${infile} | ${sedcom} 's/\x0D//g' | ${sedcom} 's/$/,/' | ${sedcom} 's/,A,/,NaN,/g' | ${sedcom} 's/,A...,/,NaN,/g' | ${sedcom} 's/GJ00,$/NaN,/' | ${sedcom} 's/, *,/,NaN,/g' | ${sedcom} 's/, *,/,NaN,/g' | ${sedcom} 's/://g' | ${sedcom} 's/,/ /g' >! ${otfile} &
tail -c 10000000000 -f ${infile} | ${sedcom} -f /local/users/pstar/cruise/data/exec/jcr/sedscript >! ${otfile} &
popd
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment