From harlan Thu Jul 13 10:50:59 1995
Status: RO
X-VM-v5-Data: ([nil nil nil nil nil nil nil nil nil]
	[nil "Thu" "13" "July" "1995" "10:50:44" "-0700" "Bill Harlan" "harlan" nil nil "ASCII data routines" "^From:" nil nil "7" nil nil nil nil]
	nil)
Received: by oas.Stanford.EDU id AA28480
  (5.65c/IDA-1.4.4 for matt); Thu, 13 Jul 1995 10:50:44 -0700
Return-Path: <harlan>
Message-Id: <199507131750.AA28480@oas.Stanford.EDU>
From: Bill Harlan <harlan>
To: sep@sep.Stanford.EDU
Subject: ASCII data routines
Date: Thu, 13 Jul 1995 10:50:44 -0700

                                     Thur., July 13, 1995
SEP,

I've installed utilities on oas for manipulating 
ASCII data represented as rows and columns of numbers.  
This is very useful for files describing picked data 
and irregularly sampled data that cannot be expressed 
as traces.  The files are like spreadsheets.   Each row 
specifies one complete datapoint, and each column 
corresponds to some coordinate.  Utilities will sort,
interpolate, or smooth rows by values in different columns, 
will plot different columns against each other as color maps 
or curves, will transform columns, etc.

The attached man page "man asciidata" lists routines
which I've installed so far,  and describes the
way that parameters are specified.  The interface is
a cousin of getch, but designed more for interactivity, 
to create decent defaults for parameters depending on the values
specified for other parameters.

(I'm still trying to solve a problem with HP's compilers.)

                                      Bill Harlan

.................................................................
asciidata,(setpar)MISC. REFERENCE MANUAL PAGES asciidata,(setpar)

NAME
     setpar - a format for interactively  setting  parameters  to
     process ASCII data.

SYNTAX
     setpar process-name

LIST OF ASCIIDATA/SETPAR PROCESS NAMES
     Most of these processes are designed for processing rows and
     columns  of ASCII data like a spreadsheet.  All have indivi-
     dual man pages.

     aniso:
          Estimate equivalent medium anisotropic velocities  from
          logs (Vp sonic required; Vs and density optional).
          Plots also.

     dcod:
          Echos decoded parameter value  from  file  to  standard
          output.

     dt2vel:
          Converts DTS units of sonic log into velocity units.

     fplot:
          Plots curves and  irregular  grids  in  color  or  gray
          scale, from ASCII files.

     interp:
          Sort  and/or  interpolate  linked  columns   of   ASCII
          numbers.

     ladd:
          Scale and add together different columns  of  different
          files, or same columns of same files.

     paste:
          This is a standard Unix utility that can be used to add
          the columns of one file to the columns of another file,
          row by row.

     plane:
          Converts 3d crosswell  picks  into  2d  projection  for
          crosswell tomography.

     range:
          Selects rows whose columns fall within a certain range.

     rays:
          Model anisotropic  rays  between  specified  endpoints.
          (Not yet debugged.)

     setpar:
          The process setpar provides an X-window  interface  for
          other processes.

     shuffle:
          Rearranges the columns of a file.

     smooth:
          Smooth columns of an array with a Gaussian.

     subset:
          Randomly selects a specified fraction of  the  rows  of
          input file.

     timedepth:
          Converts a column of an ASCII  file  between  time  and
          depth.

     transf:
          Linearly transform one column of a file.

DESCRIPTION
     setpar is  a  format  for  setting  parameters  for  various
     interactive  Unix processes.  Processes using this style can
     receive parameter specifications from  interactive  standard
     input,  from  a  redirected  parameter  file, or with the X-
     window command "setpar".

     The default values of parameters are changed  by  specifica-
     tions  in  the  format  "name=value",  where  values  can be
     integers, floats, an array of floats, or character strings.

     For example, to change the name  of  an  input  file  and  a
     "column" parameter for the process "range", type the command
     "range", then type  type  "input=file.data  column=2"  on  a
     separate  line.  When you are satisfied with changed parame-
     ters type "run".  You can reuse these  parameters  with  the
     "save" and "set" commands.

     Alternatively,  you  can  place  the  line  "input=file.data
     column=2"  into  a  parameter  file "file.par" and then type
     "range < file.par".

     Or you can enter the command "setpar range" to  activate  an
     X-window,  which  shows  defaults  and  features a field for
     specifying parameters.

SETTING PARAMETERS
     To set parameters, first type the name of the process.   The
     screen  will  display  the names of all parameters and their
     defaults.  These defaults can be changed  in  any  order  by
     typing   in   the   format   "name=value".    For   example,
     "input=test.dat" changes the  name  of  the  input  file  to
     "test.dat".  Try  to  change  parameters  from the top down,
     since some changes will affect the defaults of other parame-
     ters.  Names of parameters are case insensitive.

     Real and integer values are not distinguished, decimals  are
     optional,  and  exponential notation is allowed.  To specify
     an array of values, separate each value by a  space,  as  in
     "name=1 2 3". To specify a string containing blanks, enclose
     the entire expression in double quotes. The values of string
     parameters are case sensitive.

     You can also place the specifications in a file and pipe the
     file into standard input.  Or you can type the command "set-
     par process" to set the parameters for the "process"  within
     an X-window.

SPECIAL ACTIONS
     Typing the following commands will perform certain  standard
     actions.

     run  You are satisfied with the selected  parameters.   Exe-
          cute the remaining actions of this process normally. An
          end of file (control D) will perform the same function.
          Other synonyms are "quit" and "exit".

     save=file
          Save the current parameters in a  parameter  file.  The
          parameter  file  will look just like the screen listing
          of current defaults.  This file can later be piped into
          as  standard  input as "setpar < file" or accessed with
          the "set" command.

     set=file
          Revise the current parameters with  the  specifications
          in the parameter file.

     stall
          Cease executing the process further.

DETAILS OF DECODING
     A parameter specification  can  include  spaces  before  and
     after  an equals sign. The variable name must be preceded by
     a space or the beginning of a line.  Spaces are  defined  as
     blanks, formfeeds, newline, tab, and vertical tabs.

     The value of a parameter begins  with  the  first  non-space
     character  after  the  equals  sign.  A floating point value
     ends with the first non-digit (digits include 0-9, ".", "+",
     "-",  and  "e").   Integers  are  decoded  as floating point
     numbers, then rounded to the nearest integer.   A  character
     string  value  can begin and end with double quotes ("...").
     If quotes are omitted, then the  string  is  assumed  to  be
     bracketed  by  spaces.  To include spaces in the string, you
     must use quotes; otherwise, they are optional.

     An array of integers or floats can be specified as a list of
     numbers separated by spaces.  For example,       column= 1 2
     3 4

     will specify an array of four numbers.  Any non-digit  char-
     acter, or end of a line, will terminate the array.

     A character "#" comments out the rest of a line, to the next
     carriage return.  "#" is useful for deactivating a parameter
     specification in a parameter file without deleting it.

     Each line of a parameter file is decoded  in  order.   If  a
     parameter is specified more than once in a file, the parame-
     ter will be reset more than once, with corresponding changes
     in  any dependent defaults.  If a single parameter is speci-
     fied more than once on a line, only the  last  specification
     is used.

     When two different parameters  are  specified  on  the  same
     line,  there is no guarantee of the order in which they will
     be used.  If one of the two may change the default value for
     the  other, then place them on separate lines.  For example,
     place the names of input and output files on separate lines,
     since the default name for the output file is set to a vari-
     ation of the input file name.

AUTHOR
     W.S. Harlan    --


UPDATED
     Thu Jul 13 10:32:49 PDT 1995




















Sun Release 4.1          Last change: l                         4



