#!/bin/csh -bf # # gp.results # # Store processing results. # N.E. King # April 1994 # # Modifications: # April 1995 Modified to run GIPSY R3 on swave, and save results on /attic. # 1995/10/17 whp Adapted from bard script to gp.save # Changed some of calls and added # DataList updating. # 1995/11/02 whp Reorganized save and result computations. # 1996/03/22 whp Web is no longer updated automatically. # Now the campaign names are saved for a # (daily) updating done independently. # 1996/04/09 whp Moved Stacov file creation to a separate subroutine. # (gp.CreateStacov). Now gp.results expects to # get the name of the stacov file. # 1996/04/09 whp Passed stacov file name to gp.CountTrack # 1996/??/?? whp Added call to gp.UpdateXYZ; Removed LNEV updating # 1997/02/12 whp Added call to gp.UpdateRes # 1997/03/10 whp Restored automatic web updating (call gp.www.NEU). # 1997/03/21 whp Pass path to xyz directory to gp.UpdateXYZ. # 1997/04/21 whp Restructure reference stacov file construction. # 1997/05/02 whp Added a flag to gp.results call to suppress|enable web update # 1997/05/08 whp Added a flag to gp.results call to suppress inclusion of # reference stations. # 1997/11/24 whp Changed behavior relative to number of reference stations. # Before: No transformation was done if RefStaCount < 3 # Now: A translation-only transformation is done # 1997/1?/?? whp Put it back to no translation for RefStaCount < 3 # It wasn't working as thought. (Transform # doesn't do anything for less than 3). # 1997/12/17 whp Store xyz files in campaign-specific directories # 1998/02/18 whp Restructure transformation: # Put everything in a loop on campaign name # Always use gp.stacov file that is local to campaign # If folder does not exist, create it and put track # gp.stacov in as the default. # Eliminate UseTrackStas option # 1998/04/11 whp Adapt to handle single stations stacov files # from point positioning # 1998/04/30 whp Removed $WebUpdate flag and call to gp.www.NEU. # This is called from gp.queue now. # 1998/10/21 whp Modify call to gp.UpdateXYZ. Allows distinction # between Track and other nets in updating XYZ Files. # 1999/06/22 whp Add command to save transformed stacov routinely. # 2000/01/31 whp Now uses itrf97. # 2000/03/03 whp Calls java version of updatexyz. # 2001/01/30 whp Define $PATH before call to gp.UpdateXYZ, # to avoid security violation on suid script # 2001/06/08 whp No longer calls gp.UpdateRes # 2001/06/08 whp Calls java version of updatexyz---again. # Check Number of Arguments # ------------------------- echo " " if ($#argv != 2) then echo "Usage: gp.results StacovFileName LogFileName" exit 1 endif set StacovName = $1 set LogFileName = $2 set RefFrameDir = /GPSdata/postprocess/itrf set XYZdir = /GPSdata/postprocess/xyz # Set default reference stacov # ---------------------------- set RefFrame = "gp.stacov" echo "gp.results: Processing $StacovName" # Exit if there is no Stacov File # ------------------------------- if (! -e $StacovName) then echo gp.results: Solution file $StacovName not found. echo gp.results: stops. exit 2 endif set yymmmdd = `grep datejpl SaveObsDate | awk '{print $2}'` set Campaigns = `cat CampaignsToInclude` # Loop on campaign names. # For each: # 1) Get appropriate gp.stacov reference frame file. # 2) Rotate into this system # 3) Update xyz files # Note: Flags UseTrackStas and IncRefSta are now obsolete # ------------------------------------------------------- foreach Campaign ($Campaigns) # 1) Get appropriate gp.stacov reference frame file. # -------------------------------------------------- rm -f $RefFrame >& /dev/null if (-e $RefFrameDir/$Campaign/$RefFrame) then echo "gp.results: Using $RefFrameDir/$Campaign/$RefFrame" >> $LogFileName cp $RefFrameDir/$Campaign/$RefFrame . else echo "Using $RefFrameDir/itrf97/$RefFrame" >> $LogFileName cp $RefFrameDir/itrf97/$RefFrame . endif # Check number of tracking stations. # If sufficient, update xyz files and web data. # (Without a minimum number of tracking stations # the solution cannot be rotated into itrf. # ----------------------------------------- gp.CountRefStations $RefFrame $StacovName set RefStaCount = $status if ( $RefStaCount > 2 ) then # 2) Rotate into this system # -------------------------- rm -f $$.[0-9].stacov >& /dev/null # Map reference frame to time of observation (.1.) # ------------------------------------------------------ /bin/csh -bf /goa/bin/stamrg -i $RefFrame \ -o $$.1.stacov -v $yymmmdd > /dev/null # Apply minimal internal constraints to remove # the uncertainties due to the loosely defined # internal reference frame (.2.) # ------------------------------------------------------ /bin/csh -bf /goa/bin/project -i $StacovName \ -o $$.2.stacov -r -s -t > /dev/null # Transform the internal frame into an external # reference frame with helmert transformation (.3.) # Note: Does not yet work for less than 3 reference stas # ------------------------------------------------------ /bin/csh -bf /goa/bin/transform -f $$.1.stacov -i $$.2.stacov \ -o $$.3.stacov -r -s -t > $$.transform.log # Update sta_pos file with transformed coordinates # ------------------------------------------------ # gp.update_sta_pos $$.3.stacov # Print out summary of transformation and store # rms in .../postprocess/res # -------------------------- cat $$.transform.log >> $LogFileName # Save stacov to transformed solution archive # If local stacovs directory exists, save it there also # ----------------------------------------------------- gp.saveTransformedStacov.pl $$.3.stacov $StacovName set yyyymmdd = `grep datelong SaveObsDate | awk '{print $2}'` set Path = `ap tr $yyyymmdd` if (! -e stacovs) mkdir stacovs cp -f $$.3.stacov stacovs/$StacovName rm -f $$.[0-9].stacov $$.transform.log gp.stacov >& /dev/null # 3) Update xyz files # Add solution to xyz/campaign/cccc.xyz files # ------------------------------------------- echo stacovs/$StacovName > FileList.$$ gp.UpdateXYZ.pl FileList.$$ $XYZdir $Campaign gp if ($status != 0) then echo gp.results: gp.UpdateXYZ.pl returned error. echo gp.results: stops. exit 4 endif else # CountTrack status echo gp.results: Not enough reference stations echo gp.results: XYZ and Web not updated endif # CountTrack status end # End of loop on campaigns exit