Changeset 4733 for trunk/Ohana/doc/www/html/DVO/userguide.htm
- Timestamp:
- Aug 9, 2005, 7:56:30 AM (21 years ago)
- File:
-
- 1 edited
-
trunk/Ohana/doc/www/html/DVO/userguide.htm (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/doc/www/html/DVO/userguide.htm
r4726 r4733 2 2 <meta name=title content=DVO Examples> 3 3 <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 arrows8 allow editing of previous commands. You can also use emacs-like9 commands such as cntl-a to reach the beginning of the line and cntl-e10 to reach the end. There is command and file completion: if you type11 part of a command (as the first thing on a line) and then type tab, it12 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. For14 any but the first word on a line, the same thing will happen for the15 files in the current directory. It is also possible to type just a16 fraction of a command, as long as it is unique. An ambiguous command17 will list the possible alternatives. For example:18 19 <pre>20 dvo: c21 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 = 1029 </pre>30 31 Any expression within curly brackets {} is assumed32 to be an arithmetical expression and is evaluated before the line is33 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 the42 equivalent inverse functions: eg., asin and dasin return radians and43 degrees, respectively. The help section on Math defines all of the44 available math functions.45 46 <h3> Miscellaneous Commands </h3>47 48 <pre>49 ! -- system call50 ? -- list commands51 ?? -- list variables52 echo -- type this line53 exec -- system call54 exit -- exit program55 help -- get help on a function56 output -- redirect output to file57 quit -- exit program58 scan -- scan line from keyboard or file to variable59 wait -- wait until return is typed60 which -- show command61 </pre>62 63 Most of these are self-explanatory. The command ?? prints the system64 variables. The <tt>help</tt> command will provide help on a single65 command or, without any arguments, will list all available help66 files (this includes general help not associated with a specific67 command).68 69 <h3> Shell Programing </h3>70 71 <pre>72 break -- escape from function73 for -- loops74 if -- logical cases75 input -- read command lines from a file76 macro -- deal with the macros77 </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 with82 <tt>input (filename)</tt>. It is also possible to define macros which83 will behave much like regular commands. A macro is defined by typing84 <tt>macro name</tt> or <tt>macro create name</tt> followed by the85 commands. Arguments to the macro are assigned to the variables $186 .. $N and the number of arguments is given by $0. Macros may be87 defined in <tt>input</tt> files, and in fact when <tt>status</tt> is88 started, it loads the file <tt>~/.statusrc</tt> which may contain89 default macros. Simple loops and if statements can be performed, and90 are quite useful for complex macros.91 92 <p>93 'If' statements are similar in syntax to C if statements. Math94 expresions in the if statement must be contained in curly braces, as95 elsewhere. Variables with string values may use the logical ==96 operator to test if two strings are the same. 'For' loops are quite97 simplistic. The form is:98 99 <pre>100 for var first last delta101 (commands)102 end103 </pre>104 105 <p>106 The value of <tt>$var</tt> will start at the value <tt>first</tt> and increment by107 <tt>delta</tt> after each loop. The loop will stop after <tt>$var</tt> is greater108 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 set110 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 plot116 clear -- erase plot117 create -- create a new vector118 cursor -- get coords from cursor119 grid -- plot cartesian grid120 hist -- create histogram from a vector121 labels -- define labels for plot122 limits -- define plot limits123 plot -- plot a pair of vectors124 print -- write vectors to file125 ps -- define labels for plot126 set -- vector math127 style -- set the style for graph plots128 vectors -- list vectors129 zplot -- plot scaled points130 </pre>131 132 <p>133 In addition to scalar variables, <tt>status</tt> can manipulate and134 display 1-D vector variables. Many of the commands which extract data135 from the photometry database place the data in vectors as well as136 plotting them. A vector can also be created based on a number137 sequence with the command <tt>create name Nelements start delta</tt>.138 The resulting vector has $Nelements$ entries, starting at a value of139 $start$ and running until $start + delta*Nelements$. If $delta$ is140 0.0, all elements will have the value of $start$. A histogram of a vector141 may be made with the command <tt>hist</tt>, which creates a new vector142 containing the histogram of the first vector. The data range and bin143 size of the histogram are defined in same way as with create. This144 makes it easy to create the index vector that goes with a histogram145 vector:146 147 <pre>148 hist y Ny 1 100 0.1149 create dx 1 100 0.1150 </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 employing159 vectors and scalars. A complete listing of the math operators160 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 can164 be plotted against each other if they have the same number of entries.165 The plotting is performed on the graphics window, Kapa. There are166 actually several graphics windows available to <tt>status</tt>, any of167 which may be used to plot at any time. Some of the more complex168 operations default to either graphics window 0 or 1, depending on the169 context. Except for those functions with a pre-defined window, all170 plotting functions apply to the current graphics window unless an171 option <tt>-n N</tt> is given to specify a different window. The172 plotting style is determined by the command <tt>style</tt> which can set173 the line width, the line type (solid, dashed, dotted, etc), the point174 type (box, cross, etc), the point size, the color, and whether a pair175 of vectors is plotted as a sequence of points, a set of connected176 lines, or a histogram. Some functions which make plots use their own177 styles, as discussed below. The function <tt>limits</tt> lets the user178 set the range of the plot axes, or check the current setting. The179 command <tt>plot</tt> will plot a pair of vectors on the current graphics180 window using the current plotting style for that window. The command181 <tt>zplot</tt> will plot a pair of vectors with the point size scaled by182 a third vector, with maximum and minimum point sizes representing183 specified values. The <tt>cursor</tt> command goes the other way: this184 command puts the Kapa window in cursor mode and waits for input from185 Kapa. The user can then type any alphanumeric key on the graphics186 windows and will be told both the pointer location (in the graphics187 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 define191 locations or regions of interest on the Kapa window. (Future addition:192 <tt>button</tt>, which does the same with the mouse buttons).193 4 194 5 <h3> Database Functions </h3>
Note:
See TracChangeset
for help on using the changeset viewer.
