lad_linkscript_uh 1.77 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11
#!/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/woce (perl) processing
#
# j001_01.000
# j001_02.000
# j001_03.000
#

12 13
set cpre = JC191
set cruise = jc191
14 15
set ladloc = /local/users/pstar/mounts/mnt_cruise_data/Specific_Equipment/CTD/LADCP
set cl = j
16
set uhldir = jc2001
17 18 19 20 21 22 23 24

#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
25
foreach i (`ls ${cpre}_???M.000`)
26 27 28 29 30 31 32 33 34 35 36
   set num = `awk -v nm="$i" 'BEGIN {print substr(nm,index(nm,".000")-4,3)}'`
   set linkfile = {$cl}{$num}_02.000 #use cast 02 to indicate WHM
   cd /local/users/pstar/cruise/data/ladcp/uh/raw/$uhldir/ladcp
   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
37
foreach i (`ls ${cpre}_???S.000`)
38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59
   set num = `awk -v nm="$i" 'BEGIN {print substr(nm,index(nm,".000")-4,3)}'`
   set linkfile = {$cl}{$num}_03.000 #cast 03 to indicate WHS
   cd /local/users/pstar/cruise/data/ladcp/uh/raw/$uhldir/ladcp
   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 ..