Changes between Initial Version and Version 1 of heli_ewII

02/26/12 12:56:39 (10 years ago)



  • heli_ewII

    v1 v1  
     3= [wiki:Earthworm Earthworm] Module: heli_ewII = 
     4'''Contributed by: ''' 
     5== Function == 
     6heli_ewII is designed to autmatically provide GIF images of waveforms for display on the WWW. It can run as an Earthworm module or a standalone program 
     7== Details == 
     10heli_ewII creates Helicorder displays of waveforms for the WWW. Jim Luetgert created the original heli1 10/7/98. He did all the hard work. Pete Lombard then did extensive cleaning and debugging. This effort resulted in two versions: heli_standalone, which was a free-standing program (although using earthworm functions), and heli_ew, which ran as a Module, thus providing error processing and restarts. 
     12Meanwhile, Jim Luetgert and others proceeded to develop and enhance similar programs. We're aware of six such efforts. What to do. Given Pete's efforts to stabilize heli_standalone, and its proven track-record for reliability, and that we're to provide a mission-critical system, as well as a community effort, we're producing heli_ewII as the staid, reliable, supported product. It is a combination of heli_ew and heli_standalone. 
     14We will carry fancier products as contributed to us by others in the earthworm/Contrib section. From time to time, we may adopt and adapt some of these more advanced products into the core earthworm software. 
     181. Runs on NT and Solaris. 
     19Runs as a module: Specifying earthworm parameters in its configuration file will cause it to become a module. It will attach to the specified ring, produce heartbeats, and use earthworm logging. It can be restarted if it asserts 'restartMe' in its .desc file. 
     212. Runs as a standalone program: If no Earthworm paramters are given in the .d file, it will run standalone. Errors will be written to stderr. 
     233.Does not try to move files to another machine. This was removed in the name of security and modularity. Moving the image files to a separate server machine is a reasonable option, but should be done by another facility. Shared disks via operating system features or SendFile are two options. 
     24heli_ewII is designed to rapidly provide GIF images of waveforms for display on the WWW. heli_ewII periodically retrieves data for a selected list of stations and updates GIF images which are transferred to webserver(s). The required waveforms are obtained via requests to Earthworm waveserver(s) and plotted directly to GIF format image files. When all of the required GIF files have been constructed, .html wrappers are built. 
     26The default structure for the webserver consists of an index.html page listing the stations and dates available for viewing. The dates are each a hotlink to an .html wrapper for each station/date helicorder GIF. 
     28How to set it up: 
     30The first task is to set up a directory for the GIF images and .html files. 
     32Now comes the fun part; setting up the configuration files. 
     34heli_ewII.d - 
     38# This is the heli_ewII parameter file. This module gets data gulps 
     39# from the waveserver(s), and creates helicorder displays. 
     40# This program runs either standalone or as an Earthworm module. 
     41# If any of the four Earthworm paramaters below are stated, it will asssume 
     42# that it's supposed to be a module. It will beat it's heart into the ring, 
     43# and use the Earthworm logging scheme. Other wise, it runs standalone. 
     46#  Basic Earthworm setup: 
     48LogSwitch    1              # 0 to completely turn off disk log file 
     49MyModuleId   MOD_HELI       # module id for this instance of report 
     50RingName     HYPO_RING      # ring to get input from 
     51HeartBeatInt 15             # seconds between heartbeats 
     53wsTimeout 12    # time limit (secs) for any one interaction with a wave server. 
     56>>>> We need to know a reasonable time limit for getting 
     57>>>> a response from any wave server. 
     60# List of wave servers (ip port comment) to contact to retrieve trace data. 
     61 WaveServer aaa.bbb.ccc.ddd  16022      "wsv2 - ad1" 
     62 WaveServer aa2.bb2.cc2.dd2  16023      "wsv2 - ad2" 
     63 WaveServer    16024      "wsv2 - ad3" 
     66>>>> This is the list of waveservers to try.  If the requested 
     67>>>> data for a given SCNL is on more than one waveserver, the 
     68>>>> first listed will be preferentially used.  If a request 
     69>>>> fails (gap in the data, broken connection) the alternate 
     70>>>> server(s) will be tried.  The comment field is optional; 
     71>>>> it makes error messages a bit more helpful.  The maximum 
     72>>>> number of waveservers is specified by MAX_WAVESERVERS in 
     73>>>> heli1.h. 
     76# Directory in which to store the  .gif, and .html files. 
     77GifDir   /home/luetgert/GIFs/helicorder/ 
     80>>>> This is the directory on your local machine which is used to 
     81>>>> store the  GIF and .html files.  For 
     82>>>> each SCNL, there is also a SCNL.hist file which keeps track of 
     83>>>> which dates are available for display.  This is used to 
     84>>>> construct the index.html file. 
     85>>>> If SaveDrifts (see below under optional commands) is set, 
     86>>>> a file SCNL.drft is created for each SCNL.  Each time a new 
     87>>>> helicorder line is started, the mean, rms, min and max 
     88>>>> values for the first minute of data are recorded. 
     91# Plot Parameters - sorry it's so complex, but that's the price of versatility 
     92        # The following is designed such that each SCNL creates it's own 
     93        # helicorder display; one per day of data. 
     94# S                  Site 
     95# C                  Component 
     96# N                  Network 
     97# L                  Location 
     100>>>> These are the SCNL identifiers as they appear in the 
     101>>>> waveserver menu. 
     104# 04 HoursPerPlot    Total number of hours per gif image 
     106# 05 Plot Previous   On startup, retrieve and plot n previous hours from tank. 
     109>>>> This lets you fill in those little gaps left by system crashes, 
     110>>>> power outages, silly mistakes, etc.  I usually leave this 
     111>>>> set to 1 so that gaps get filled automatically if something 
     112>>>> bad happens and statmgr has to restart heli1.  This will only 
     113>>>> let you fill on past data from today's plot (i.e. <=24). 
     114>>>> If you need past day's plots use heli4, the offline 
     115>>>> helicorder gif generator. 
     118# 06 Local Time Diff UTC - Local.  e.g. -7 -> PDT; -8 -> PST 
     119# 07 Local Time Zone Three character time zone name. 
     120# 08 Show UTC        UTC will be shown on one of the time axes. 
     121# 09 Use Local       The day page will be local day rather than UTC day. 
     124>>>> These variables govern how the time axes are displayed on 
     125>>>> your plot and whether the plot starts at 00:00 UTC or local. 
     128# 10 XSize           Overall size of plot in inches 
     129# 11 YSize           Setting these > 100 will imply pixels 
     132>>>> These let you tailor the size of your display. 
     135# 12 Minutes/Line    Number of minutes per line of trace 
     138>>>> We have found that 15 minutes/line makes a pretty nice 
     139>>>> display.  If you specify a number of minutes/line which 
     140>>>> is not evenly divisible into 60, the program will pick 
     141>>>> the nearest number of minutes/line which is evenly 
     142>>>> divisible into 60. 
     145# 13 Gain Factor     Instrument gain in microvolt/bit. 
     148>>>> By specifying the total instrument gain, we can (at least 
     149>>>> approximately) calibrate the amplitudes of the plot.  For 
     150>>>> instance, for analog stations in the NCSN a station running 
     151>>>> with an attenuation of 24dB (e.g. MSL) has a total system gain 
     152>>>> of app. 1.0 microvolt/bit.  HSF, with an attenuation of 18dB, 
     153>>>> has a total system gain of app. 0.5 microvolt/bit. 
     156# 14 Scale Factor    Scale factor to dress up image. 
     159>>>> This lets you turn down the amplitude of those really noisy sites. 
     162# 15 Mean Removal    Mean of 1st minute of each line will be removed. 
     165>>>> Unfortunately, some data sources are not zero-mean and others can 
     166>>>> can have unacceptable drift rates.  If this flag is set, each time 
     167>>>> a new line is started, the mean of the first minute in the line 
     168>>>> is calculated and removed from the data for the rest of the line. 
     169>>>> This is not bulletproof! It can fail if there is a noise burst 
     170>>>> in that first minute. 
     173# Comment            A comment for the top of the display. 
     175#     S    C   N  L 04  05  06 07   08   09  10  11   12 13 14  Comment 
     177 Plot AHID BHE US -- 12 1   -8  PST  1  0  20  20  15 0.1  1.5  1   "Alston BPA" 
     178 Plot ADK  SHZ AT -- 12 1   -8  PST  1  0  20  20  15 0.1  1.5  1   "Mt. Rainier Summit" 
     181    # *** Optional Commands *** 
     183 Days2Save     7    # Number of days to display on web page; default=7 
     186>>>> This variable governs how many dates are retained in the SCNL.hist 
     187>>>> file in your local gifs directory. 
     190 UpdateInt    10    # Number of minutes between updates; default=2 
     193>>>> Each UpdateInt minutes, heli1 wakes up and updates all its files. 
     196 RetryCount    2    # Number of attempts to get a trace from server; default=2 
     199>>>> If you can't get it in two trys, there is probably something 
     200>>>> seriously wrong.  Nonetheless, there may be reasons to try some more. 
     203 Logo    smusgs.gif # Name of logo in GifDir to be plotted on each image 
     206>>>> If a Logo is specified, the appropriate gif file should be 
     207>>>> placed in the /GIFs/helicorder/ directory so the program can 
     208>>>> find it.  If specified the Logo will be appear in the upper 
     209>>>> left corner of each SCNL/date helicorder plot. 
     212# We accept a command "Clip" which sets trace clipping at this many 
     213# vertical divisions 
     214Clip 5 
     217# We accept a command "SaveDrifts" which logs drifts to GIF directory. 
     218  SaveDrifts 
     221>>>> If SaveDrifts is set, a file SCNL.drft is created for each SCNL. 
     222>>>> Each time a new helicorder line is started, the mean, rms, 
     223>>>> min and max values for the first minute of data are recorded. 
     226# We accept a command "Make_HTML" to construct and ship index HTML file. 
     229# We accept a command "IndexFile" to name the HTML file. 
     230# Default is "index.html" 
     231IndexFile welcome.html 
     233# We accept a command "BuildOnRestart" to totally rebuild images on restart. 
     236# We accept a command "Debug" which turns on a bunch of log messages 
     237# Debug 
     238# WSDebug 
     241Customizing the .html wrapper: 
     243The .html wrapper for the primary web page has provision for customization to reflect the identity and flavor of an individual earthworm site. If you do nothing, a generic wrapper is constructed. You may control, however, the top part of the index page and the bottom of the index page by placing the .html code you want in files named indexa.html and indexb.html respectively in the GIFs/helicorder/ directory. The module will attempt to open and read indexa.html for the top of the page; if it can't find the file, it generates a generic beginning for the index.html file. It then pastes in links to the helicorder GIF images. Finally, it looks for indexb.html to finish off the page. If there is no indexb.html, it provides a generic ending. 
     244== Helpful Hints ==