IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Aug 9, 2005, 7:56:30 AM (21 years ago)
Author:
eugene
Message:

opihi userguide updates

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/doc/www/html/DVO/userguide.htm

    r4726 r4733  
    22<meta name=title content=DVO Examples>
    33<meta name=page  content=DVO Examples>
    4 
    5 <h3> User Interface </h3>
    6 
    7 The interface has an interaction similar to <tt>tcsh</tt>.  The arrows
    8 allow editing of previous commands.  You can also use emacs-like
    9 commands such as cntl-a to reach the beginning of the line and cntl-e
    10 to reach the end.  There is command and file completion: if you type
    11 part of a command (as the first thing on a line) and then type tab, it
    12 will fill in as much as possible, until the word is not unique.
    13 Typing tab twice at that point will list the possible endings.  For
    14 any but the first word on a line, the same thing will happen for the
    15 files in the current directory.  It is also possible to type just a
    16 fraction of a command, as long as it is unique.  An ambiguous command
    17 will list the possible alternatives.  For example:
    18 
    19 <pre>
    20 dvo: c
    21 ambiguous command: c ( catalog cgrid clear create cursor )
    22 </pre>
    23 
    24 The shell is an interpretive programming language.
    25 Variables are set as follows:
    26 
    27 <pre>
    28 dvo: $fred = 10
    29 </pre>
    30 
    31 Any expression within curly brackets {} is assumed
    32 to be an arithmetical expression and is evaluated before the line is
    33 executed.  For example:
    34 
    35 <pre>
    36 echo {$fred*dcos(45)}
    37 </pre>
    38 
    39 would give the response 7.07107.  There are math functions cos, sin,
    40 and tan, which operate on radian expressions, and also dcos, dsin,
    41 dtan, which operate on degree expressions.  There are also the
    42 equivalent inverse functions: eg., asin and dasin return radians and
    43 degrees, respectively.  The help section on Math defines all of the
    44 available math functions. 
    45 
    46 <h3> Miscellaneous Commands </h3>
    47 
    48 <pre>
    49 !                         -- system call
    50 ?                         -- list commands
    51 ??                        -- list variables
    52 echo                      -- type this line
    53 exec                      -- system call
    54 exit                      -- exit program
    55 help                      -- get help on a function
    56 output                    -- redirect output to file
    57 quit                      -- exit program
    58 scan                      -- scan line from keyboard or file to variable
    59 wait                      -- wait until return is typed
    60 which                     -- show command
    61 </pre>
    62 
    63 Most of these are self-explanatory.  The command ?? prints the system
    64 variables.  The <tt>help</tt> command will provide help on a single
    65 command or, without any arguments, will list all available help
    66 files (this includes general help not associated with a specific
    67 command). 
    68 
    69 <h3> Shell Programing </h3>
    70 
    71 <pre>
    72 break                     -- escape from function
    73 for                       -- loops
    74 if                        -- logical cases
    75 input                     -- read command lines from a file
    76 macro                     -- deal with the macros
    77 </pre>
    78 
    79 <p>
    80 There are several options for programming in <tt>status</tt>.  First,
    81 a file which contains a series of commands can be executed with
    82 <tt>input (filename)</tt>.  It is also possible to define macros which
    83 will behave much like regular commands.  A macro is defined by typing
    84 <tt>macro name</tt> or <tt>macro create name</tt> followed by the
    85 commands.  Arguments to the macro are assigned to the variables $1
    86 .. $N and the number of arguments is given by $0.  Macros may be
    87 defined in <tt>input</tt> files, and in fact when <tt>status</tt> is
    88 started, it loads the file <tt>~/.statusrc</tt> which may contain
    89 default macros.  Simple loops and if statements can be performed, and
    90 are quite useful for complex macros.
    91 
    92 <p>
    93 'If' statements are similar in syntax to C if statements.  Math
    94 expresions in the if statement must be contained in curly braces, as
    95 elsewhere.  Variables with string values may use the logical ==
    96 operator to test if two strings are the same.  'For' loops are quite
    97 simplistic.  The form is:
    98 
    99 <pre>
    100 for var first last delta
    101  (commands)
    102 end
    103 </pre>
    104 
    105 <p>
    106 The value of <tt>$var</tt> will start at the value <tt>first</tt> and increment by
    107 <tt>delta</tt> after each loop.  The loop will stop after <tt>$var</tt> is greater
    108 than <tt>stop</tt>.  The value <tt>delta</tt> is optional, with 1 assumed.
    109 The value of <tt>$var</tt> may be changed during the loop, and if set
    110 beyong the value of <tt>last</tt> will end the loop early. 
    111 
    112 <h3> Vector Plotting </h3>
    113 
    114 <pre>
    115 box                       -- draw a box on the plot
    116 clear                     -- erase plot
    117 create                    -- create a new vector
    118 cursor                    -- get coords from cursor
    119 grid                      -- plot cartesian grid
    120 hist                      -- create histogram from a vector
    121 labels                    -- define labels for plot
    122 limits                    -- define plot limits
    123 plot                      -- plot a pair of vectors
    124 print                     -- write vectors to file
    125 ps                        -- define labels for plot
    126 set                       -- vector math
    127 style                     -- set the style for graph plots
    128 vectors                   -- list vectors
    129 zplot                     -- plot scaled points
    130 </pre>
    131 
    132 <p>
    133 In addition to scalar variables, <tt>status</tt> can manipulate and
    134 display 1-D vector variables.  Many of the commands which extract data
    135 from the photometry database place the data in vectors as well as
    136 plotting them.  A vector can also be created based on a number
    137 sequence with the command <tt>create name Nelements start delta</tt>.
    138 The resulting vector has $Nelements$ entries, starting at a value of
    139 $start$ and running until $start + delta*Nelements$.  If $delta$ is
    140 0.0, all elements will have the value of $start$.  A histogram of a vector
    141 may be made with the command <tt>hist</tt>, which creates a new vector
    142 containing the histogram of the first vector.  The data range and bin
    143 size of the histogram are defined in same way as with create.  This
    144 makes it easy to create the index vector that goes with a histogram
    145 vector: 
    146 
    147 <pre>
    148 hist y Ny 1 100 0.1
    149 create dx 1 100 0.1
    150 </pre>
    151 
    152 <p>
    153 The above will create a histogram of y in Ny and the index in dx.
    154 Plotting this with <tt>plot dx Ny</tt> will show the histogram.
    155 
    156 <p>
    157 Vector math is performed with a command of the form <tt>set new =
    158   (expression)</tt>.  The expression is some math function employing
    159   vectors and scalars.  A complete listing of the math operators
    160   available in <tt>set</tt> can be found in the help for <tt>set</tt>.
    161 
    162 <p>
    163 Once vectors are defined, they may be plotted.  A pair of vectors can
    164 be plotted against each other if they have the same number of entries.
    165 The plotting is performed on the graphics window, Kapa.  There are
    166 actually several graphics windows available to <tt>status</tt>, any of
    167 which may be used to plot at any time.  Some of the more complex
    168 operations default to either graphics window 0 or 1, depending on the
    169 context.  Except for those functions with a pre-defined window, all
    170 plotting functions apply to the current graphics window unless an
    171 option <tt>-n N</tt> is given to specify a different window.  The
    172 plotting style is determined by the command <tt>style</tt> which can set
    173 the line width, the line type (solid, dashed, dotted, etc), the point
    174 type (box, cross, etc), the point size, the color, and whether a pair
    175 of vectors is plotted as a sequence of points, a set of connected
    176 lines, or a histogram.  Some functions which make plots use their own
    177 styles, as discussed below.  The function <tt>limits</tt> lets the user
    178 set the range of the plot axes, or check the current setting.  The
    179 command <tt>plot</tt> will plot a pair of vectors on the current graphics
    180 window using the current plotting style for that window.  The command
    181 <tt>zplot</tt> will plot a pair of vectors with the point size scaled by
    182 a third vector, with maximum and minimum point sizes representing
    183 specified values.  The <tt>cursor</tt> command goes the other way: this
    184 command puts the Kapa window in cursor mode and waits for input from
    185 Kapa.  The user can then type any alphanumeric key on the graphics
    186 windows and will be told both the pointer location (in the graphics
    187 coordinates) and will have the coordinates stored in <tt>status</tt>
    188 variables.  For example, by typing ``1'' in the sky display window,
    189 the RA and DEC of the pointer are stored in the variables <tt>$R1</tt>
    190 and <tt>$D1</tt>.  This command can be used to let the user define
    191 locations or regions of interest on the Kapa window. (Future addition:
    192 <tt>button</tt>, which does the same with the mouse buttons). 
    1934
    1945<h3> Database Functions </h3>
Note: See TracChangeset for help on using the changeset viewer.