AWS Reporting

The following is an introduction to the AWS reporting package.  I've also tried to give an overview of what's going on with AWS as a whole; Martha's and Larry's pages document some of this stuff in admirable detail. 
Note that most of the hyperlinks below point to copies of the files, not the actual "live" files.  This means that if the originals get modified, the copies may or may not be out of date.  I'll try to keep them up, but your best bet for absolute accuracy is to check these things where they live. 

Contents

The Flow
The Components
Specific Tasks

The Flow

The ThinkPad in Bill's office runs a batch file called AWS.  (TODO: remove pipe chars from comments in aws.bat!) The batch file uses a time-polling system to decide when to call the stations and do other things.  When the correct time rolls around, it calls CALLSTN.BAT

CALLSTN.BAT sets an environment variable to the abbreviations of the station names (ARK, CHE, etc.).  This makes the abbrevs available, and also serves to count the stations.  (So if the number of stations changes, you have to change this SET statement). 
The data files get copied to //Bob//work/aws/xfer/dat/... semaphore file is created in //Bob//work/aws/xfer/ready... AWSWAIT.PL sees it...and data gets entered into the files on Bob, winding up in //Bob/work/bbs/data/(STN)(YR)(RECID).TXT. 

A C-shell script called ALLREPORTS.CSH gets called from AWSWAIT.PL.  This script uses the GETDATA executable to extract the appropriate data for the days we're interested in.  The text files output by the various calls to GETDATA then get massaged into nice-looking reports by two C programs called CLIMREPORTand SOILREPORT.  Four reports wind up being generated by ALLREPORTS.CSH: clim.rpt, soil.rpt, 7dayclim.rpt, and 7daysoil.rpt.  ALLREPORTS.CSH uses a database of stations to determine which stations get reported, what sensors they have, their locations, and what kinds of data they produce. 

The Components

There are a variety of software and data components which cooperate to make all this happen.  Specifically: 

Programs and Scripts

Data

Specific Tasks

If a station goes up or down

To change a station's status, you have to whack on several different files.  Note that the hyperlinks here will show you the file you need to edit -- the copy of the file, that is!

  1. AWS.BAT on the ThinkPad: Remove the station abbreviation from the list.
  2. STNLIST.NEW: cd to /work/aws/sysdata.  su to "aws", if you haven't already.  Check the station list out ("co -l stnlist.new").  Edit the file, change "up" to "down" or vice versa, save it out, and check the file back in ("ci -u stnlist.new").
  3. Special case for particular stations: if you take down ANTigo, CHEtek, CRAnmoor, or HANcock, go into the "spud-mailing" perl script ($bp/pl/emailspuds.pl) and modify the list of reports there.

If the reports don't appear to be running

If you notice that the reports haven't been updating for a day or two, the most likely culprit is the ThinkPad.

Special Christmas Bonus Ugly Kludge Special

Because of a problem with how getdata handles dates, the reporting stuff goes haywire for the week that spans the new year. Some details on how to fix it are in ALLREPORTS.CSH, but I will try to document it better here too. Real Soon Now.

























This Component Hasn't Been Documented Yet