#!/bin/csh -f # # Shell script to set up and run a series of days of data based on a # set of rinex files from a specific site. (Used to process SWIS data). # The data are processed in 12-hour sessions with a final session to # handle any residual data. The letters are used to denote sessions # within one day. # if( $#argv == 0 ) then echo ' ' echo 'Usage: sh_makerun ' echo 'where is a list of rinex files' echo ' from a single site (e.g. rinex/swis*.99o.Z)' echo 'The processing is split into 12-hour sessions with the start and' echo 'and stop times set to the actual times of the data. ' echo ' ' echo 'The log of the run looks like:' echo ' csh sh_makerun rinex/swis16*.99o.Z' echo '---------------------------------' echo 'Running rinex/swis1600.99o.Z' echo 'Start time 99 6 9 4 21 15.0000000 0 9G 1G 4G 5G 8G14G16G25G29G30' echo 'End time 99 6 11 0 2 30.0320000 0 8G 8G 9G21G17G26G 2G23G31' echo 'Total Epochs 5243 Processed in 4 sections' echo 'sh_gamit -d 1999 160 -expt swis -sessinfo 30 1440 4 48 -yrext -netext a' echo 'sh_gamit -d 1999 160 -expt swis -sessinfo 30 1440 16 48 -yrext -netext b' echo 'sh_gamit -d 1999 161 -expt swis -sessinfo 30 1440 4 48 -yrext -netext c' echo 'sh_gamit -d 1999 161 -expt swis -sessinfo 30 923 16 48 -yrext -netext d' echo '---------------------------------' echo 'Running rinex/swis1610.99o.Z' echo 'Start time 99 6 10 19 9 45.0000000 0 8G 4G 6G10G13G18G19G22G24' echo 'End time 99 6 11 0 2 30.0010000 0 8G 8G 9G21G17G26G 2G23G31' echo 'Total Epochs 587 Processed in 1 sections' echo 'sh_gamit -d 1999 161 -expt swis -sessinfo 30 587 19 11 -yrext -netext a' echo '---------------------------------' echo 'Running rinex/swis1670.99o.Z' echo 'Start time 99 6 16 14 30 15.0000000 0 9G 1G 4G 5G 7G 8G 9G14G16G29' echo 'End time 99 6 17 2 29 44.9940000 0 9G 9G 5G 8G29G21G 1G 7G30G25' echo 'Total Epochs 1438 Processed in 1 sections' echo 'sh_gamit -d 1999 167 -expt swis -sessinfo 30 1438 14 24 -yrext -netext a' echo ' ' endif set ex = `echo a b c d e f g h i j k l m n o p q r s t u v w x y z` foreach rx (`echo $argv`) echo '---------------------------------' echo 'Running ' $rx set ext = $rx:e # Get all the times from the rinex file if( $ext == 'Z' ) then zcat $rx | grep '^ [09][0-9] ' >! t.t else cat $rx | grep '^ [09][0-9] ' >! t.t endif # set ts = `head -1 t.t` set te = `tail -1 t.t` # Tell the user start and stop times echo 'Start time '$ts echo 'End time '$te set jds = `doy $ts | head -1 | awk '{print $10}'` set jde = `doy $te | head -1 | awk '{print $10}'` set numep = `echo $jde $jds | awk '{print int(($1-$2)*86400/30)+1}'` set nums = `echo $numep | awk '{print int($1/1440)+1}'` echo 'Total Epochs '$numep' Processed in '$nums' sections' set std = `doy $ts | head -1 | awk '{print $6}'` set sty = `doy $ts | head -1 | awk '{print substr($2,1,4)}'` set stt = `doy $ts | head -1 | awk '{print substr($0,17,2),substr($0,20,2) }'` # Now loop over the times, setting up processing in 12-hour blocks (number of # epochs is based on 30-sec sampling) set cnt = 0 while ( $cnt < $nums ) @ cnt = $cnt + 1 if( $cnt == $nums ) then set nep = `echo $numep $cnt | awk '{print $1-($2-1)*1440}'` else set nep = 1440 endif # Only process if we have sufficient data. if( $nep > 400 ) then set sd = `echo $jds $cnt | awk '{print $1+($2-1)/2.0}'` set std = `doy $sd | head -1 | awk '{print $6}'` set stt = `doy $sd | head -1 | awk '{print substr($0,17,2),substr($0,20,2) }'` set sessinfo = `echo "30 $nep $stt"` # Now actually run gamit to process the data. Adding an echo at the start of # the next line, will simply list the way the data will be processed. sh_gamit -d $sty $std -expt swis -sessinfo $sessinfo -yrext -netext $ex[$cnt] else echo Only $nep epochs in final data segment endif end end