Recent Changes - Search:

radlab home

radlab support

generic HFDR

principles
hardware
software
production
documents
pictures

know-how

projects

CNMI-Guam
CWA
IFREMER
IHMT
ISMER
NAMR
PACIOOS
TORI
UABC
UHHilo
UP-MSI
WHOI

old projects

MEC
OGS
UAF

.

DoProcessDtaOld

  #!/bin/csh
  # converts dtacq file into wera raw file then calls wera16_raw_sort and launch standard SORT processing
  # do_process_DTA.sh  20123661630_acq164_091.dta

  # stupid GKS hack
  unsetenv DISPLAY

  date

  set sitename='kok'

  # Make the output filenames

  set infile=$1
  set timetag=`echo $infile | sed -e s/_acq164_....dta//`
  set dtaname=`echo $infile | sed -e s/201........_acq/acq/ -e s/.dta//`
  set hdrfile=`echo $infile | sed -e s/.dta/.hdr/`
  set filename="$timetag"_$sitename
  set outfile=$filename.DAT
  set rawfile=$filename.RAW
  set sortfile=$filename.SORT

  cd /home/wera/data/$sitename

  (echo filein="'$infile'"; echo fileout="'$outfile'";cat /home/wera/wera_import/dtacq2wera.m) | /usr/local/bin/matlab -nodisplay
  #/bin/gzip $infile &
  /bin/rm $infile

  # prepend the standard header
  (echo -n '2048 SAMPLES   ';cat $hdrfile /home/wera/wera_import/$sitename.hdr $outfile) > $rawfile
  /bin/rm $outfile
  echo $rawfile made...

  # make the SORT file
  /home/wera/Fortran/wera16_raw_sort /home/wera/data/$sitename/$rawfile /home/wera/data/$sitename/$sortfile
  #/bin/rm $rawfile
  gzip $rawfile
  echo $sortfile made...

  # make the radial currents

  /home/wera/Fortran/wera16_beam /home/wera/data/$sitename/$filename.SORT /home/wera/data/$sitename/$filename.RAD_Beam
  echo $filename.RAD_Beam made...

  # this is stupid filenaming convention

  set beamname="$filename:s/_/00-2048_/"
  echo $beamname $filename
  mv $beamname.RAD_Beam $filename.RAD_Beam

  # make radial plots

  echo G | /home/wera/Fortran/Plott_UV -d=4 -f=/home/wera/data/$sitename/$filename.RAD_Beam
  echo $filename.RAD_Beam.gif made...

  # make radial movie

  gifsicle --delay 35 $filename.RAD_Beam.gif `ls *.RAD_Beam.gif | tail -12` --loop  >  $filename.RAD_Beam_anim.gif
  echo $filename.RAD_Beam_anim.gif made...

  # convert binary radial currents to ascii

  /home/wera/Fortran/List_Radial /home/wera/data/$sitename/$filename.RAD_Beam
  /bin/rm $filename.RAD_Beam

  # make matlab file

  (echo filein="'$filename.RAD_Beam_lst'";cat /home/wera/work/matlab/hfr_process/make_lst2mat_one.m) | /usr/local/bin/matlab -nodisplay
  /bin/rm $filename.RAD_Beam_lst

  # make beamformed range spectrum

  (echo g; echo -60; echo y;echo g; echo '-45'; echo y;echo g; echo -30; echo y;echo g; echo '-15'; echo y;echo g; echo 0; echo y;echo g; echo '15'; echo y;echo g; echo 30; echo y;echo g; echo 45; echo y;echo g; echo 60; echo n) | plotbeam $sortfile
  gifsicle --delay 100 $filename.SORT_{-60,-45,-30,-15,000,015,030,045,060}deg.gif --loop  >  $filename.SORT_beam.gif
  /bin/rm $filename.SORT_*deg.gif
  echo $filename.SORT_beam.gif made...

  # make individual channels spectrum

  (echo g; echo 1; echo y; echo g; echo 2; echo y; echo g; echo 3; echo y;   echo g; echo 4; echo y; echo g; echo 5; echo y; echo g; echo 6; echo y;   echo g; echo 7; echo y; echo g; echo 8; echo y; echo g; echo 9; echo y;   echo g; echo 10; echo y; echo g; echo 11; echo y; echo g; echo 12; echo y;   echo g; echo 13; echo y; echo g; echo 14; echo y; echo g; echo 15; echo y;   echo g; echo 16; echo n) | plotrcs $sortfile
  gifsicle --delay 100 $filename.SORT_ant0{1,2,3,4,5,6,7,8}.gif --loop  >  $filename.SORT_ant.gif
  /bin/rm $filename.SORT_ant??.gif
  echo $filename.SORT_ant.gif made...

  # make the beamformed azimuth spectrum
  # mapping of n*30 Hz  0     9    19    28    38    47    57    66    75

(echo g; echo 9; echo y;echo g; echo '19'; echo y;echo g; echo 28; echo y;echo g; echo '38'; echo y;echo g; echo 47; echo y;echo g; echo '57'; echo y;echo g; echo 66; echo y;echo g; echo 75; echo n) | plotang $sortfile

  gifsicle --delay 100 "$filename"_SORT_ran???.gif --loop  >  $filename.SORT_ran.gif
  /bin/rm "$filename"_SORT_ran???.gif
  echo $filename.SORT_ran.gif made...

  # copy it to sunset
  /usr/bin/scp $filename.RAD_Beam.gif sunset:/home/wera/work/hioos/$sitename/realtime/
  /usr/bin/scp $filename.RAD_Beam_anim.gif sunset:/home/wera/work/hioos/$sitename/realtime/
  /usr/bin/scp $filename.SORT_ant.gif sunset:/home/wera/work/hioos/$sitename/realtime/
  /usr/bin/scp $filename.SORT_beam.gif sunset:/home/wera/work/hioos/$sitename/realtime/
  /usr/bin/scp $filename.SORT_ran.gif sunset:/home/wera/work/hioos/$sitename/realtime/
  /usr/bin/scp $filename.RAD_Beam.mat sunset:/home/wera/work/hioos/$sitename/realtime/

  # CAUTION! do not enable this as the realtime to lawelawe is now through
  # the separate crontab mergebeam entry
  #/usr/bin/scp $filename.RAD_Beam.mat radlab@lawelawe:hioos/$sitename/realtime

  # cleanup
  # caution! if you remove the mat file, the one-hour median averaging will fail
  /bin/rm $filename.*{ran,beam,ant,anim}*.gif
Edit - History - Print - Recent Changes - Search
Page last modified on April 25, 2015, at 01:37 AM