USGS InfoBank banner.  USGS, Coastal and Marine Geology, InfoBank banner.
 USGS Coastal and Marine Geology banner.    Search InfoBank.
USGS InfoBank program -- graphed Skip navigational links
    ________   ________   ______________   ________   _________   _______________   ________  
  tab edge  Home  tab edge  Data  tab edge  Activities  tab edge  FACS  tab edge  Atlas  tab edge  Definitions  tab edge  More  tab edge  
   
InfoBank Programs: by Name   by Data Type   General Tools   GIS   Plotting   Web   USGS Disclaimer   InfoBank Programs
   
Expanded description
Topic Description
Name
graphed
Synopsis
/infobank/programs/plt/graphed/graphed.for
Description
  Program to interactively editing data.
    
Limitations
  It can only handle one data field at a time up to 50,000 records,

  but it will accept successive data files. It's useful for editing
  any kind of data (see INPUT) and is especially useful for locating
  and deleting spikes in the data. The program is set up so that all
  prompts requiring single character input can be answered simply by
  typing that character. A carriage return is not needed, and the
  character is not echoed on the terminal screen. Any command or
  prompt with the exception of the prompt for an input file can be
  exited gracefully by entering a 'Q'. Also, online help can be had
  at any time after entering the input file by typing either an 'H'
  or a '?'.
    
Prompts
  Enter name of input file:

  Enter an input format for the data field to be displayed:
  (i4,i3,3i2,i1,
       
  For the input format, three lines of the input file are displayed,
  and the default format for time is given. The user is required to
  complete the input format with the format for the data.
    
Notes
  An editing session with this program will consist mostly of

  locating and deleting bad data points. These points are never
  actually lost during the editing session, but are merely flagged
  for deletion. This way, deleted data points can be recovered later
  on within the same editing session in which they were deleted.
    
Output
  DISPLAY:

  The program can display any amount of data at a time. By default,
  the data is displayed 6 hours at a time, in 6 hour time windows.
  Also, the y axis is scaled to the extent of the whole data set by
  default. The y axis can also be scaled to reflect only the extent of
  the data displayed in the current time window.
  If the data input is bathymetry (that is a file name of <name>.3xx)
  then the data is displayed with values in ascending order from top
  to bottom. Otherwise, data is displayed in descending order from top
  to bottom.
  FILE:
  An output file is not automatically created by the program, but
  must be requested by the user. This can be done either upon exiting
  the program or any number of times during the editing session. The
  output file will contain all of those records not flagged for
  deletion and will contain the whole of each record, not just the
  time and data field that had been edited.
  
  In addition, the program writes out a file containing the points
  that were deleted, if any. This file is given the same name as the
  output file, but substitutes a .DEL for the file type.
    
Input
  FILE:

  Any data can be edited using this program. However, the program
  expects time in the first 10 columns of the record in
  YEAR/JULIAN_DAY/HOUR/MINUTE/SECOND/TENTH_OF_A_SECOND format.
  COMMANDS:
  All of the following commands are executed by typing the
  corresponding key on the keyboard (no carriage return is necessary).
  The following listing is only a summary and is organized
  alphabetically. More detailed information and a listing by function
  can be had online while running the program.
  a - display the first time window
  b - move backward one time window
  d - delete a point
  e - exit the program
  f - move forward one time window
  g - display length of time gaps in minutes or hours
  h - display the online help file
  j - jump to another time window
  k - save the data
  m - modify display characteristics
  n - delete a line segment
  o - restore a deleted line segment
  p - display deleted points with an 'x'
  q - exit from a command
  r - redraw the display
  s - display the data and display characteristics
  t - display the time for a point
  u - restore a deleted point
  v - display the data value for a point
  x - display the data points with an 'x'
  y - jump to the next time window containing a maximum or minimum
      data value
  z - display the last time window
  < - move backward one half time window
  > - move forward one half time window
  HELP:
  Graphed has an extensive on line help file which can be accessed by
  typing an 'H' or a '?' at any time after the prompt for an input
  file. It provides a summary of all of the commands organized by
  function, and detailed information about any command. In addition
  there is a help file with general inforamtion about Graphed and a
  file with suggestions on how to use the program.
    
Subroutines
  There are three types of subroutines listed here; those contained

  in the DRS shareable library, those contained in the Tektronix
  PLOT10 graphics software, and those internal to Graphed. Each
  subroutine may call other subroutines. Those are listed separately
  under the help files for the calling subroutines. The ones listed
  here are only those called by the main program module.
  INTERNAL:
  delete        jump        showdeleted    showxy
  deleteseg     keepdata    showmaxmin     
  draw          message     showpoints     restore
  findmaxmin    modify      showsummary    restoreseg
  graphelpg      setdwindo
  SHAREABLE:
  openem    showlines    converttime    getkey    changecase
  PLOT10:
  initt
  erase     
  finitt    tsend
    
Author
  Ed Maple  2/20/87

  Ed Maple  4/13/87  Added toggle in subroutine MODIFY to enable
      GRAPHED to fill each time window with the y axis max/min of the
      data within that window. New subroutine SETDWINDO written to
      enable this ability. Also modified subroutine JUMP to be more
      efficient and easier to use, adding the ability to jump by
      hours.
  Ed Maple  8/12/87  Added code to display bathymetry in increasing depth
      from top of screen to bottom. Also added code to write a log file of
      deleted points when an output file is written.
  Ed Maple 12/30/87  Changed call to SHOWSUMMARY at the beginning to a call
      to MODIFY so that a user has the option of modifying plot parameters
      on the way in without having to wait for the program to draw the
      data first.
  Ed Maple  6/27/89  Made change to KEEPDATA for option of adding 
      header records to the output file. Modified initialization of
      arrays LDELETE and LCHANGED to occur in a do loop rather than a
      FORTRAN DATA statement.
  C Degnan  7/9/92   Added second variable for new getkey call.
  M Hamer  10/7/92   Fixed bug that occurs when the 5% is added for display
      and ymax and ymin now to large to be read with format input.  This 
      occurs when input values are about 9, 99, 999, 9999 etc.  
  Clint Steele   1/5/2000    Added year handling for i/o
                     
    
Reads
         read (*, '(q,a)' )  length,adata(1:length)
         read (inunit, aformat, iostat = ierr) iyear(1),
*            iday, ihr, imin, isec, iten, data (1)

             read (*, '(a)' ) answer
         read (inunit, '(q,a)', end = 900) 
*              length,aline (icount) (1:length)
         read (aline (icount)(1:length), aformat) iyear(icount),
*            iday, ihr, imin, isec, iten, data (icount)
     read (bdata_whole(1:index(bdata_whole,' ') - 1), '(i4)') 
*                    i_bdata_whole

     read (ymin, bdata_format, err = 2000) ymin
     read (ymax, bdata_format, err = 2000) ymax
         read (*, '(a1)') anotherfile
    
Writes
         write (*, 500) atime
        write (a_bdata_whole, '(i1)') i_bdata_whole
        write (a_bdata_whole, '(i2)') i_bdata_whole
    
Calls
 call specialmode ('INITIALIZE')
     call openem (1, 0)
         call showlines (inunit, 3)
         call changecase ('CAPITAL', adata)
             call changecase ('CAPITAL', answer)
         call converttime ('COMPRESS', iday, ihr, imin, isec, 
*                          iten, itime, timerror)
     call initt (9600/10)
     call modify (time, icount, datamin, datamax, ymin, ymax,
*                 timespan, timegap, bdata, lfill, lbathydata)
     call setdwindo (time, data, ldeleted, icount, istart,
*                    startime, timespan, ymin, ymax, lfill,
*                    ywindomin, ywindomax)

     call specialmode ('GRAPHICS')
     call draw (time, data, ldeleted, icount, istart, startime,
*               timespan, timegap, aline)
     call tsend
         call getkey (akey, ikey)
         call changecase ('CAPITAL', akey)
                 call setdwindo (time, data, ldeleted, icount,
*                                istart, startime, timespan, ymin,
*                                ymax, lfill, ywindomin, ywindomax)
                 call draw (time, data, ldeleted, icount, istart,
*                           startime, timespan, timegap, aline)
                 call message ('Start of data')
                 call message ('Start of data')
                 call setdwindo (time, data, ldeleted, icount,
*                                istart, startime, timespan, ymin,
*                                ymax, lfill, ywindomin, ywindomax)
                 call draw (time, data, ldeleted, icount, istart,
*                           startime, timespan, timegap, aline)
             call delete (time, data, ldeleted, lchanged, icount,
*                         istart, startime, timespan, datamin,
*                         datamax, timegap, aline)

                 call specialmode ('TEXT')
                     call getkey (answer, ikey)
                     call changecase ('CAPITAL', answer)
                     call draw (time, data, ldeleted, icount,
*                               istart, startime, timespan,
*                               timegap, aline)
                         call keepdata (aline, ldeleted, lchanged,
*                                       icount, aname)
                 call message ('End of data')
                 call setdwindo (time, data, ldeleted, icount,
*                                istart, startime, timespan, ymin,
*                                ymax, lfill, ywindomin, ywindomax)
                 call draw (time, data, ldeleted, icount, istart,
*                           startime, timespan, timegap, aline)
             call gapsg (time, data, ldeleted, icount, istart,
*                       startime, timespan, timegap)

             call graphelpg ('?')
             call draw (time, data, ldeleted, icount, istart,
*                       startime, timespan, timegap, aline)

             call jump (time, icount, istart, startime, timespan)
             call setdwindo (time, data, ldeleted, icount, istart,
*                            startime, timespan, ymin, ymax, lfill,
*                            ywindomin, ywindomax)
             call draw (time, data, ldeleted, icount, istart,
*                       startime, timespan, timegap, aline)

             call keepdata (aline, ldeleted, lchanged, icount,
*                           aname)
             call draw (time, data, ldeleted, icount, istart,
*                       startime, timespan, timegap, aline)

             call modify (time, icount, datamin, datamax, ymin,
*                         ymax, timespan, timegap, bdata, lfill,
*                         lbathydata)

             call setdwindo (time, data, ldeleted, icount, istart,
*                            startime, timespan, ymin, ymax, lfill,
*                            ywindomin, ywindomax)

             call draw (time, data, ldeleted, icount, istart,
*                       startime, timespan, timegap, aline)

             call deleteseg (time, data, ldeleted, lchanged,
*                            icount, istart, startime, timespan,
*                            datamin, datamax, timegap, aline)

             call restoreseg (time, data, ldeleted, lchanged,
*                             icount, istart, startime, timespan,
*                             icount,datamin, datamax, timegap,
*                             aline)

             call showdeleted (time, data, ldeleted, icount,
*                              istart, startime, timespan)

             call draw (time, data, ldeleted, icount, istart,
*                       startime, timespan, timegap, aline)

             call showsummary (time, icount, datamin, datamax,
*                              ymin, ymax, timespan, timegap,
*                              bdata, lfill, ywindomin, ywindomax,
*                              lbathydata)
             call draw (time, data, ldeleted, icount, istart,
*                       startime, timespan, timegap, aline)

             call showxy (time, data, ldeleted, icount, istart,
*                         startime, timespan, timegap, akey,
*                         lbathydata, aline)

             call restore (time, data, ldeleted, lchanged, icount,
*                          istart, startime, timespan, datamin,
*                          datamax, timegap, aline)

             call showxy (time, data, ldeleted, icount, istart,
*                         startime, timespan, timegap, akey,
*                         lbathydata, aline)

             call showpoints (time, data, ldeleted, icount, istart,
*                             startime, timespan)

             call findmaxmin (time, data, ldeleted, icount, istart,
*                             startime, timespan, datamin, datamax,
*                             lfound)

                 call message
*           ('No other window contains the current max/min values')
                 call setdwindo (time, data, ldeleted, icount,
*                                istart, startime, timespan, ymin,
*                                ymax, lfill, ywindomin, ywindomax)
                 call draw (time, data, ldeleted, icount, istart,
*                           startime, timespan, timegap, aline)
                 call showmaxmin (time, data, ldeleted, icount,
*                                 istart, startime, timespan,
*                                 datamin, datamax)
                 call message ('End of data')
                 call setdwindo (time, data, ldeleted, icount,
*                                istart, startime, timespan, ymin,
*                                ymax, lfill, ywindomin, ywindomax)
                 call draw (time, data, ldeleted, icount, istart,
*                           startime, timespan, timegap, aline)
                 call message ('Start of data')
                 call setdwindo (time, data, ldeleted, icount,
*                                istart, startime, timespan, ymin,
*                                ymax, lfill, ywindomin, ywindomax)
                 call draw (time, data, ldeleted, icount, istart,
*                           startime, timespan, timegap, aline)
                 call message ('End of data')
                 call setdwindo (time, data, ldeleted, icount,
*                                istart, startime, timespan, ymin,
*                                ymax, lfill, ywindomin, ywindomax)
                 call draw (time, data, ldeleted, icount, istart,
*                           startime, timespan, timegap, aline)
         call tsend
         call message ('Would you like to begin '//
*                 'editing a new file? (Y or N)')
         call changecase ('CAPITAL', anotherfile)
             call message (' ')
             call message ('You have the option of '//
*                     'beginning a new editing '//
*                     'session with a new file.')
             call message ('It is essentially like '//
*                     'starting the program over '//
*                     'from the beginning')
             call message ('without having to '//
*                     'actually leave the program.')
             call message (' ')
 call finitt (0, 0)
 call specialmode ('TEXT')
    

Skip footer navigational links

InfoBank   Menlo Park Center   Santa Cruz Center   St. Petersburg Center   Woods Hole Center   Coastal and Marine Geology Program  
 
U. S. Department of the Interior   U. S. Geological Survey   Geologic Information   Ask-A-Geologist   USGS privacy statement   Disclaimer  

URL: /infobank/programs/plt/graphed/graphed.doc.html
Maintainer: Clint Steele
Last modified: Fri Oct 11 03:10:29 PDT 2002  (wcs)