IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Aug 9, 2005, 5:15:14 PM (21 years ago)
Author:
eugene
Message:

moving things around a bit

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/doc/www/html/Opihi-Programs/index.htm

    r4734 r4735  
    2828<p>
    2929The command-line interaction is based on the readline libraries and
    30 behaves like #tcsh/#.  Arrows can be used for editing.  There is both
     30behaves like <tt>tcsh</tt>.  Arrows can be used for editing.  There is both
    3131command and file completion with the TAB key.  You can also use
    3232emacs-like commands such as ctrl-a to reach the beginning of the line
     
    5959consist of the standard math operators (+,-,*,/) as well as any
    6060already-defined variables and the functions log(), ln(), sqrt(),
    61 exp(), ten() ($10^x$), sin(), cos(), etc.  Other special operators are
    62 the carret (^) for exponetiation (eg, 2^3 is 8) and the @ symbol as a
    63 binary arc-tangent (eg, 1@3 is 18.43 degrees).  In addition, the
    64 operator #<</# returns the minimum of the two surrounding values, and
    65 #>>/# returns the maximum.  Variables can be numeric or character
    66 strings.  If the shell does not understand the syntax of the line as a
    67 math expression, it is assumed to be a string.
     61exp(), ten() (10<sup>x</sup>), sin(), cos(), etc.  Other special
     62operators are the carret (^) for exponetiation (eg, 2^3 is 8) and the
     63@ symbol as a binary arc-tangent (eg, 1@3 is 18.43 degrees).  In
     64addition, the operator <tt><<</tt> returns the minimum of the two
     65surrounding values, and <tt>>></tt> returns the maximum.  Variables
     66can be numeric or character strings.  If the shell does not understand
     67the syntax of the line as a math expression, it is assumed to be a
     68string.
    6869
    6970<em>local variables</em>
     
    8283
    8384would give the response 7.07107 if $fred had the value of 10.0.  There
    84 are math functions #cos/#, #sin/#, and #tan/#, which operate on radian
    85 expressions, and also #dcos/#, #dsin/#, #dtan/#, which operate on
     85are math functions <tt>cos</tt>, <tt>sin</tt>, and <tt>tan</tt>, which operate on radian
     86expressions, and also <tt>dcos</tt>, <tt>dsin</tt>, <tt>dtan</tt>, which operate on
    8687degree expressions.  There are also the equivalent inverse functions:
    87 eg., #asin/# and #dasin/# return radians and degrees, respectively.
     88eg., <tt>asin</tt> and <tt>dasin</tt> return radians and degrees, respectively.
    8889The help section on Math defines all of the available math functions.
    8990
     
    130131
    131132<h4> queues </h4>
     133
     134<pre>
     135queuelist                 -- list existing queues
     136queuesize                 -- return the length of the given queue
     137queueinit                 -- create a zero-length queues
     138queuedelete               -- delete a queues
     139queuepush                 -- add an item to the end of the queue
     140queuepop                  -- remove and return the first item in the queue
     141</pre>
    132142
    133143A queue is a data construct consisting of a sequence of lines from
     
    267277exit                      -- exit program
    268278help                      -- get help on a function
     279config                    -- reload configuration information
     280exit                      -- exit program
     281quit                      -- exit program
     282wait                      -- wait until return is typed
     283sleep                     -- sleep for N seconds
     284usleep                    -- sleep for N microseconds
     285which                     -- show command
     286cd                        -- change current working directory
     287pwd                       -- report current working directory
     288date                      -- return the current date
     289file                      -- test file existence
     290memory                    -- long listing of the allocated memory
     291version                   -- list version information
     292</pre>
     293
     294Most of these commands should be clear from the simple descriptions
     295above, or from the online help.  The command ?? prints the system
     296variables.  The <tt>help</tt> command will provide help on a single
     297command or, without any arguments, will list all available help files
     298(this includes general help not associated with a specific command).
     299
     300<h3> String Manipulation and other data commands </h3>
     301
     302<pre>
     303local                     -- define local variables
    269304output                    -- redirect output to file
    270 quit                      -- exit program
    271305scan                      -- scan line from keyboard or file to variable
    272 wait                      -- wait until return is typed
    273 which                     -- show command
    274 </pre>
    275 
    276 Most of these are self-explanatory.  The command ?? prints the system
    277 variables.  The <tt>help</tt> command will provide help on a single
    278 command or, without any arguments, will list all available help
    279 files (this includes general help not associated with a specific
    280 command). 
    281 
    282 <em>output</em>
    283 
    284 <em>scan</em>
    285 
    286 <h3> 1D Data and the Graphing Window </h3>
    287 
    288 <h3> Vector Plotting </h3>
     306sprintf                   -- formatted print to a variable
     307fprintf                   -- formatted print to standard output
     308getchr                    -- find character in string
     309strlen                    -- string length
     310substr                    -- substring
     311</pre>
     312
     313These commands provide a few tools to manipulate data in opihi
     314variables.  The #local/# command specifies that the given variable is
     315local to its macro.  The #output/# command changes the default output
     316destination for functions which print results to the screen.  This
     317function does not zero the file length; new output is appended to the
     318file.  The command #scan/# reads specific lines from a file, an
     319optionally places them in an opihi variable (EOF is returned at the
     320end of a file).  The group of commands #getchr/#, #strlen/#, and
     321#substr/# provide the ability to manipulate the elements of a string.
     322Finally, #sprintf/# and #fprintf/# perform formatted output to a
     323variable and to the screen, respectively. 
     324
     325<h3> Vectors</h3>
     326
     327<h4>Vector Manipulation Functions</h4>
     328
     329<pre>
     330create                    -- create a new vector
     331hist                      -- create histogram from a vector
     332print                     -- write vectors to file
     333vectors                   -- list vectors
     334accum                     -- accumulate vector values in another vector
     335applyfit                  -- apply fit to new vector
     336applyfit2d                -- apply 2-d fit to new vector
     337circstats                 -- circular statistics
     338concat                    -- reduce vector dimension
     339datafile                  -- define file to read vectors
     340delete                    -- delete vectors or matrices
     341fft1d                     -- fft on the pixel-stream in an image
     342fit                       -- fit polynomial to vector pair
     343gaussdev                  -- generate a gaussian deviate vector
     344gaussint                  -- return the integrated gaussian vector
     345histogram                 -- generate histogram from vector
     346integrate                 -- integrate a vector
     347interpolate               -- interpolate between vector pairs
     348vectors                   -- list vectors
     349medacc                    -- accumulate vector values in another vector
     350peak                      -- find vector peak in range
     351read                      -- read vectors from datafile
     352set                       -- image and vector math
     353sort                      -- sort list of vectors
     354subset                    -- expand vector dimension
     355uniq                      -- create a uniq vector subset from a vector
     356vbin                      -- bin values in a vector to be within a range
     357vclip                     -- clip values in a vector to be within a range
     358select                    -- selective vector assignment
     359vgauss         
     360vgrid         
     361vload                     -- load vectors on Kii
     362vstat                     -- get info from imreg database
     363vsmooth                   -- gaussian smooth of a vector
     364vroll                     -- roll vector elements
     365vpop                      -- remove first element
     366write                     -- write vectors to datafile
     367</pre>
     368
     369<h4>The Graphing Window (Kapa)</h4>
    289370
    290371<pre>
    291372box                       -- draw a box on the plot
    292373clear                     -- erase plot
    293 create                    -- create a new vector
    294374cursor                    -- get coords from cursor
    295375grid                      -- plot cartesian grid
    296 hist                      -- create histogram from a vector
    297376labels                    -- define labels for plot
    298377limits                    -- define plot limits
    299378plot                      -- plot a pair of vectors
    300 print                     -- write vectors to file
    301379ps                        -- define labels for plot
    302 set                       -- vector math
    303380style                     -- set the style for graph plots
    304 vectors                   -- list vectors
    305381zplot                     -- plot scaled points
     382device                    -- set / get current graphics device
     383jpeg                      -- write text line on graph
     384line                      -- plot line
     385dot                       -- plot a single point
     386resize                    -- set graphics/image window size
     387section                   -- define section of graph
     388textline                  -- write text line on graph
     389zplot                     -- plot x y with size scaled by z
    306390</pre>
    307391
     
    314398
    315399<p>
    316 In addition to scalar variables, <tt>status</tt> can manipulate and
    317 display 1-D vector variables.  Many of the commands which extract data
    318 from the photometry database place the data in vectors as well as
    319 plotting them.  A vector can also be created based on a number
    320 sequence with the command <tt>create name Nelements start delta</tt>.
    321 The resulting vector has $Nelements$ entries, starting at a value of
    322 $start$ and running until $start + delta*Nelements$.  If $delta$ is
    323 0.0, all elements will have the value of $start$.  A histogram of a vector
    324 may be made with the command <tt>hist</tt>, which creates a new vector
    325 containing the histogram of the first vector.  The data range and bin
    326 size of the histogram are defined in same way as with create.  This
    327 makes it easy to create the index vector that goes with a histogram
    328 vector: 
     400A vector can be created based on a number sequence with the command
     401<tt>create name Nelements start delta</tt>.  The resulting vector has
     402#Nelements/# entries, starting at a value of #start/# and running
     403until #start + delta*Nelements/#.  If #delta/# is 0.0, all elements
     404will have the value of #start/#.  A histogram of a vector may be made
     405with the command <tt>hist</tt>, which creates a new vector containing
     406the histogram of the first vector.  The data range and bin size of the
     407histogram are defined in same way as with create.  This makes it easy
     408to create the index vector that goes with a histogram vector:
    329409
    330410<pre>
     
    411491green, blue, and yellow overlays.
    412492
    413 <h3> programming considerations </h3>
     493<h4>Image Manipulation Functions</h4>
     494
     495<pre>
     496clip                      -- clip values in a buffer to be within a range
     497contour                   -- create contour from image
     498cut                       -- extract a cut across an image
     499extract                   -- extract a portion of a buffer into another buffer
     500fft2d                     -- fft on an image
     501fit2d                     -- fit 2-d polynomial to vector triplet
     502header                    -- print buffer header
     503imcut                     -- linear image cut between arbitrary coords
     504imhist                    -- histogram of an image region
     505imsmooth                  -- circular gaussian smoothing
     506kern                      -- convolve with 3x3 kernel
     507keyword                   -- extract a FITS keyword from buffer header
     508buffers                   -- list the currently allocated buffers
     509mcreate                   -- create a matrix
     510minterp                   -- interpolate image pixels
     511rd                        -- load fits image
     512rdseg                     -- read a segment of an image from a file
     513rebin                     -- rebin data by factor of N
     514roll                      -- roll image to new start point
     515rotate                    -- rotate image
     516set                       -- image and vector math
     517shift                     -- shift data in an image
     518spline.apply              -- apply spline fit to generate an image
     519spline.const              -- create spline 2nd deriv. terms
     520stats                     -- give statistics on a portion of a buffer
     521subraster                 -- subraster of fits image
     522unsign                    -- toggle the UNSIGN status
     523wd                        -- write an image to a file
     524zap                       -- delete pixels
     525</pre>
     526
     527<h4>The Image Display Window (Kii)</h4>
     528
     529<pre>
     530ps                        -- define labels for plot
     531center                    -- center image on coords
     532device                    -- set / get current graphics device
     533erase                     -- erase objects on an overlay
     534jpeg                      -- write text line on graph
     535load                      -- load an SAOimage style overlay
     536point                     -- load overlay with single point
     537save                      -- save an SAOimage style overlay
     538resize                    -- set graphics/image window size
     539tv                        -- display an image on the Kii window
     540tvcontour                 -- send contour to overlay
     541tvgrid                    -- wait until return is typed
     542</pre>
     543
     544
     545<h4>Other data functions</h4>
     546
     547<pre>
     548gaussj                    -- solve Ax = B (N-D)
     549gridify                   -- convert vector triplet to buffer
     550ungridify                 -- convert buffer region to vector triplet
     551dimendown                 -- convert matrix to vector
     552dimenup                   -- convert vector to matrix
     553mget                      -- extract a vector from a matrix
     554mset                      -- insert a vector in a matrix
     555svd                       -- singular value decomposition of a matrix
     556swapbytes                 -- byte swap thing
     557</pre>
     558
     559
     560
     561<h3> Programming Considerations </h3>
    414562The programming structure of the Opihi front-end
    415 makes it very easy to add commands to the package; more about this
    416 later.
     563makes it very easy to add commands to the package.
Note: See TracChangeset for help on using the changeset viewer.