#!/usr/local/bin/perl # # gp.www.NEU # # W. Prescott 1996/11/12 # # Read CampaignsToWeb file from /attic # For each campaign name ($Camp): # Create a $Camp directory # Write a $Camp.html page listing all stations # For each station name ($Sta): # Create a $Camp/$Sta directory # Write a $Sta.html page pointing to # A $Sta_app.html page calling graphing applet # A $Sta_foot.html page with best-fit summary info # Run CommonMode writing results to appropriate directory # Copy $Camp directory to web server # Note: # @Stations is an array of station names (sorted) # from the contents of xyz directory. # @Names is an array of station names # from the .vel file (i.e. output from CommonMode). # @Names has length $NumSta. # # Index: # ----- # Main # Procedure CheckCampaignsOnWeb # Procedure ComputeBoundary # Procedure CreateCampHTML # Procedure CreateStaCompPlots # Procedure CreateStaHTML # Procedure CreateJavaStaHTML # Procedure CreateVelocityMap # Procedure CreateVelocityMapClickCoords # Procedure PStoGIF # Procedure PStoGIF1 # Procedure PStoGIF2 # Modifications: # ------------- # 1996/01/23 whp Adapted from CreateMembersHTML and gp.www # 1998/02/18 whp Added ability to handle more than one campaign # from command line # 1998/02/24 whp Added test to skip plotting for zero length files # 1998/04/30 whp Change ps to gif conversion. Use facility in gs. # 1998/07/30 whp Create station names from xyz file names # instead of CampaignList, # so that only stations with observations appear. # 1998/09/02 whp Add ehzsouth; use local copy of html.header # 1999/01/12 whp Added clickable velocity maps # 1999/01/12 whp Added clickable index file and maps # 1999/01/12 whp Fixed Track clickable map # 1999/02/23 whp Read error scaling factors from CommonMode # .vel file. # 1999/06/30 whp Created gp_www.pm: Taking subroutines # out of this routine and putting them in a package # This package is used by gp.www.qoca as well. # 2000/03/02 whp Converted to use commonmode.CommonMode # and updatexyz.UpdateXYZ # 2000/03/02 whp Changed generation of station list to # read it from CampaignList instead of # using xyz files. # Import subroutines # ------------------ use gp_www; # Main # ---- print ("gp.www.NEU: Creating NEU web files\n"); # Useful paths # ------------ $CampaignsOnWeb = "/attic/CampaignsOnWeb"; $CampaignsToWeb = "/attic/CampaignsToWeb"; $PostProcessPath = "/GPSdata/postprocess"; $ItrfPath = "/GPSdata/postprocess/itrf"; $WebResultsDir = "gps"; # Check number of arguments. # ------------------------- if ($#ARGV >= 0) { undef (@Campaigns); for ($i=0; $i<=$#ARGV; ++$i) { push (@Campaigns,$ARGV[$i]); } } else { # Read list of campaigns to post-process and move to web # ------------------------------------------------------ system ("sort -ru $CampaignsToWeb > $CampaignsToWeb.$$"); open (CampListHdl, "$CampaignsToWeb.$$"); undef (@Campaigns); while () { push (@Campaigns,$_); } close (CampListHdl); system ("rm $CampaignsToWeb $CampaignsToWeb.$$"); } # Process the list of campaigns # ----------------------------- foreach $Camp (@Campaigns) { print ("gp.www.NEU: Processing $Camp\n"); if (substr($Camp,-1) eq "\n") { chop($Camp);} # Check that campaign is in CampaignsOnWeb # If not add it and call gp.www.UpdateWebIndex # -------------------------------------------- &gp_www::CheckCampaignsOnWeb($CampaignsOnWeb,$Camp); # Create a campaign directory # --------------------------- if (-e $Camp) { print ("gp.www.NEU: Error---Directory $Camp exists\n"); } mkdir ($Camp,0775); # Create a list of stations # ------------------------- @CampaignListLines = `grep '^$Camp\[^A-Za-z0-9\#_\]' /attic/CampaignList`; undef(@Stations); foreach $Line (sort @CampaignListLines) { @Field = split(/[ \t\n]+/,$Line); push (@Stations,$Field[1]); } # @StationXYZList= (); # $XYZPath = "$PostProcessPath/xyz/$Camp"; # opendir(XYZHdl,"$XYZPath") # || die "gp.www.NEU: $XYZPath not found"; # @StationXYZList = grep(!/^\./,readdir(XYZHdl)); # close (XYZHdl); # foreach $Sta (sort @StationXYZList) # { # push (@Stations,substr($Sta,0,4)); # } # Rotate XYZ to NEU and # generate files needed for plotting and display # ---------------------------------------------- if (!-e "$ItrfPath/$Camp") { system ("mkdir $ItrfPath/$Camp"); } $Cmd = "java -mx96m commonmode.CommonMode $Camp orig"; system($Cmd); # Create Web Files # ---------------- &gp_www::CreateWebFiles("orig",$Camp,@Stations); # Copy to web server # ------------------ &gp_www::MoveToServers($Camp,$WebResultsDir); system "rm -r $Camp"; } # End loop on campaigns exit;