Home On-line Data Access FAQ Software Download
Documentation EPIC Contacts What's New Site Map
 
EPIC Programs Database Management EPIC I/O Library Matlab MexEPS
Web Utilities X-Motif Interface PPLUS Graphic Package Java

EPIC Web Utilities -- COVER

'How-to" description for PMEL users

How to use Mark Renton's 'cover' utility for executing a script or any executable image from html, on the fly.

Used by the EPIC Web Browser:

* create an HTML document like 

http://www.pmel.noaa.gov/epic/software/ewb_sample.htm, using:

<FORM METHOD="POST" ACTION="http://www.pmel.noaa.gov/epic-bin/cover">


* the script to be executed must be:

  - listed by name in tao-bin/cover.scripts, 
    e.g., If the script is tao-bin/scripts/PLOT-4
    e.g., Then put this line into tao-bin/scripts:
        scripts/PLOT-4
  - named in the HTML document as a forms INPUT, 
    e.g., if the script is named 
          tao-bin/scripts/PLOT-4, use 
    HTML such as:
   <INPUT TYPE="radio" NAME="script" CHECKED VALUE="scripts/PLOT-4" >

* Parameters can be passed to the script by collecting their 
  values from FORMS input.  Default for the first parameter 
  is 'P1', second one is 'P2', etc.  Example HTML:

  <SELECT NAME="P1">
  <OPTION VALUE=ep489c002_ctd > 140.1117 W  _   2.0133 S
  <OPTION> ........................
  </SELECT>

  followed by:

  <INPUT TYPE="hidden" VALUE=ep489c002_ctd NAME="@140.1117 W  _   2.0133 S" >

  Notes:  The '.....' stuff is necessary because PC Browsers
  don't display properly without it.

*  The script itself can do anything with the parameters 
   the user has input on the FORMS.  Examples are ASCII 
   listings or PLOTS.  Images can easily be created on-the-fly, 
   and plots can be cached.  This is all easy to do in the 
   script.  

* ASCII listings on-the-fly:  An example script is 
  tao-bin/CTDLST-RUN which has only a single paramter as input, 
  namely, the file name without the extension '.cdf'.  The 
  script contains 

  - environment variables to set paths so the 
    EPIC listing program will run properly  

  - the path specification for the directory containing the 
    data files (in netCDF format in this case) 

  - the path for the temp directory in which junk files are made

  - the shell commands to run the EPIC listing program with 
    an appropriate input file, which is created by the shell 
    as a temp file.  

  - the listing is created as a disk file 
    and cat is used to put it on the screen for the user.  

  - the listing files could easily be cached (they aren't now)

  - the script ends by doing a cleanup of the temp files.

*  PLOTS can be made on-the-fly:  An example script is 
   tao-bin/PLOT-4 which has only a single paramter as input, 
  namely, the file name without the extension '.cdf'.  The 
  script contains 

  - environment variables to set paths so  
    PPLUS will run properly  

  - the path specification for the directory containing the 
    data files (in netCDF format in this case) 

  - the path for the temp directory in which junk files are made
    the path for the cache directory in which graphics files 
    are cached.

  - the shell commands to run a PPLUS script (.ppc file) with 
    the data file name as an input parameter.  

  - the plot is created by PPLUS as a metacode file, which 
    is converted by m2gif to a GIF file.  

  - the shell script uses 'echo' to write HTML to standard 
    unix output (stdout), including <IMG SRC="the-gif-file"> 
    to put the PLOT on the screen as a clickable in-line image 
    for the user.  

  - the GIF files are cached (trivial with the script) in 
    a non-colliding fashion (this means that multiple users 
    can try to make the same plot at the same time and 
    the procedure will not fail.

  - the script ends by doing a cleanup of the temp files.

*  Download of netCDF files is accomplished a shell script 
   such as /tao-bin/CDF-URL, which uses 'echo' to 
   put the netCDF file out as a URL:

   echo "Location: http://www.pmel.noaa.gov/epic/demonstration/data/$1.cdf"
   echo ""

If you have any questions about COVER utility please contact: epic@noaa.gov or Mark Renton (the author) mark.renton@noaa.gov

 
NOAA PMEL EPIC EPIC