lad_linkscript_uhpy 1.66 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53
#!/bin/csh
#
# copy the raw .000 ladcp data into cruise/data/ladcp/rawdata
# then make links to those files using the filename formats expected by 
# uh/clivar (python) processing
#

set cpre = JC159
set cruise = jc159
set ladloc = /local/users/pstar/mounts/mnt_cruise_data/Specific_Equipment/CTD/LADCP

#sync file
cd /local/users/pstar/cruise/data/ladcp/rawdata
rsync -av ${ladloc}/ ./

#make links

cd /local/users/pstar/cruise/data/ladcp/rawdata/Master/data
foreach i (`ls ${cpre}_???m.000`)
   set num = `awk -v nm="$i" 'BEGIN {print substr(nm,index(nm,".000")-4,3)}'`
   set linkfile = wh{$num}_02.dat #use cast 02 to indicate WHM
   cd /local/users/pstar/cruise/data/ladcp/uhpy/raw
   if (! -e $linkfile) then
      echo Making link $linkfile for raw file $i
      ln -s ../../rawdata/Master/data/$i $linkfile
   endif
   cd /local/users/pstar/cruise/data/ladcp/rawdata/Master/data
end

cd /local/users/pstar/cruise/data/ladcp/rawdata/Slave/data
foreach i (`ls ${cpre}_???s.000`)
   set num = `awk -v nm="$i" 'BEGIN {print substr(nm,index(nm,".000")-4,3)}'`
   set linkfile = wh{$num}_03.dat #cast 03 to indicate WHS
   cd /local/users/pstar/cruise/data/ladcp/uhpy/raw
   if (! -e $linkfile) then
      echo Making link $linkfile for raw file $i
      ln -s ../../rawdata/Slave/data/$i $linkfile
   endif
   cd /local/users/pstar/cruise/data/ladcp/rawdata/Slave/data
end

#and for ctd data
cd /local/users/pstar/cruise/data/ladcp/ctd
foreach i (`ls ctd.???.02.asc`)
   set num = `awk -v nm="$i" 'BEGIN {print substr(nm,index(nm,".02.asc")-3,3)}'`
   set linkfile = ctd.{$num}.03.asc
   if (! -e $linkfile) then
      echo Making link $linkfile
      ln -s $i $linkfile
   endif
end
cd ..