IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changes between Initial Version and Version 1 of DVO_Intro


Ignore:
Timestamp:
May 18, 2009, 11:02:23 PM (17 years ago)
Author:
rodney
Comment:

Initial Revision (s.r.)

Legend:

Unmodified
Added
Removed
Modified
  • DVO_Intro

    v1 v1  
     1= DVO Language anad Display Tools =
     2
     3This is a general introduction to the DVO shell and some of its graphics functionality.  The dvo commands are taken from the transcript of Gene Magnier's dvo demo at the IPP Workshop, 18 May, 2009.
     4
     5* dvo is a shell environment, like bash or csh
     6* command line editing is emacs-like
     7
     8== Getting help ==
     9** three commands :  'help'  '?' '??'
     10** 'help' gives a list of help topics.  The 'help' output is incomplete/nonexistant for many commands
     11** '?'  - brief description of commands,  generated automatically from comments in the code
     12*** (Use 'which' to get '?' like help for a single command)
     13** '??' - shows currently defined variables
     14
     15==== Useful help topics ====
     16Some help items provide an overview of major functions, instead of a
     17specific command.  Try these:
     18
     19{{{
     20dvo: help Variables
     21dvo: help Math
     22dvo: help Graphics
     23dvo: help Kii
     24}}}
     25
     26
     27== Variables ==
     28 * set and access scalar variables with $ prefix
     29 * Enclose math expressions in { }
     30
     31{{{
     32dvo: $a = 5
     33dvo: $b = "hello there"
     34dvo: echo $a
     35dvo: echo $b
     36dvo: echo {6*$a} {-2.5*log(10000)} ; echo $a
     37dvo: echo $a; $a = 10; echo $a
     38}}}
     39
     40== Shell Escapes ==
     41 * Do shell escapes with "bang" (!) or 'exec'
     42 * exec is necessary for macro files b/c '!' is a comment char
     43 * use backticks (`) to store the results of a command line execution
     44 in a dvo variable
     45
     46{{{
     47dvo: !ls
     48dvo: exec ls
     49dvo: $word = `ls`
     50dvo: echo $word
     51}}}
     52
     53
     54=== Lists : ===
     55Lists are collections of scalar variables.  Can contain a mix of types.
     56Start a list definition with the 'list' command, end it with a line
     57containing only 'end'.
     58Use 'help list' for more info
     59
     60{{{
     61dvo: list fooList
     62>> 5.6
     63>> tada
     64>> 19
     65>> end
     66}}}
     67
     68The contents of a list are accessible as scalar variables with names
     69derived from the list name.
     70
     71{{{
     72dvo: ??
     73fooList:0 = 5.6
     74fooList:1 = tada
     75fooList:2 = 19
     76fooList:n = 3
     77}}}
     78
     79
     80You can collect the output of a command line expression directly into
     81a list by using the '-x' option
     82{{{
     83dvo: list files -x "ls"
     84dvo: echo $files:n
     8512
     86dvo: for i 0 $files:n
     87>> echo $files:$i
     88>> end
     89}}}
     90
     91You can break a string into substrings, using whitespace delimiters:
     92
     93{{{
     94dvo: $test = adaopdaow aeiaoiepoa fsdp eaoeap
     95dvo: list word -split
     96>> $test adaopdaow aeiaoiepoa fsdp eaoeap
     97dvo: for i 0 $word:n
     98>> echo $word:$i
     99>> end
     100}}}
     101
     102== for loops ==
     103 * for <iterator> <start> <end> <incr>
     104 * close the loop with 'end'
     105
     106{{{
     107dvo: for i 0 10 2
     108>> echo $i
     109>> end
     1100
     1112
     1124
     1136
     1148
     115}}}
     116
     117{{{
     118dvo: for i 0 $fooList:n
     119>> echo $fooList:$i
     120>> end
     1215.6
     122tada
     12319
     124}}}
     125
     126
     127= Macros =
     128 * see 'help macro'
     129 *      warning : scope is not restricted
     130        **  variables defined in macros can conflict with variables
     131          set at higher levels if they have the same name
     132 * flow control functions are available (for, if, break,
     133
     134{{{
     135dvo: macro example
     136> for i 0 $0
     137> echo $i
     138> end
     139> end
     140dvo: example a b c
     1410
     1421
     1432
     1443
     145}}}
     146
     147= Vectors =
     148 * the command to make an index vector is 'create'
     149 * see 'help create'
     150 * build vectors from other vectors using 'set'
     151
     152{{{
     153dvo: create x 0 1000
     154dvo: echo x[0]
     155dvo: echo x[200]
     156dvo: echo {4*x[5]}
     157dvo: set y = x^2
     158dvo: echo x[5] y[5]
     159}}}
     160
     161== Image display ==
     162
     163 * device -n <name> : instantiate a device with name <name>
     164 **   any graphics command will accept -n <name> to send output to that
     165  window (as opposed to the current window)
     166
     167 * set style options to adjust line width, color, point size, etc.
     168 * see 'help style' for gory details.
     169 * use 'label' to put labels on the +x +y -x or -y axes. 
     170
     171 * Text commands can have sub- or superscript with '_' and '^',
     172where the subscript is terminated  by '|'
     173
     174
     175* Read an image:
     176{{{
     177rd image simtest.fits
     178}}}
     179
     180* image interaction tools :
     181**  cursor:             see 'help cursor'
     182**  star :       get stats from the position where the cursor is,
     183
     184== Plotting in a Graphics Window ==
     185
     186* region        : define a region on the sky for plotting in.
     187** see 'help region'
     188
     189* plot vs cplot : 
     190**  plot just plots in the x-y coord system
     191**  cplot plots in the currently defined coord system
     192
     193* csystem : convert vectors between coordinate systems
     194
     195{{{
     196 dev -n 1
     197 region
     198 create R 0 360 1
     199 set D = zero(R)
     200 csystem G C R D
     201 cplot R D
     202}}}
     203
     204== Read vectors from a file ==
     205* for reading from an Ascii file see 'help read'
     206* for reading from a fits table use 'read -fits'
     207
     208
     209== interactive work with a cmf and fits file ==
     210
     211* plotting vector data on top of an image
     212* vload : load x,y vectors as an overlay onto a graphics window (can set plot styles)
     213* vzload : load x,y vectors into an overlay with point sizes set by a z vector
     214* available overlays: red, green, blue,  yellow  (can be toggled on and off with buttons in the Kapa window)
     215