comparison man/man1/op.1 @ 0:5242703e91d3 tip

Initial checkin for AIM92 aimR8.2 (last updated May 1997).
author tomwalters
date Fri, 20 May 2011 15:19:45 +0100
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:5242703e91d3
1 .TH OP 1 "14 September 1993"
2
3 .SH NAME
4 op \- Ordered sequence of operations on input stream.
5
6 .SH SYNTAX
7 op [options] [file]
8
9 .SH DESCRIPTION
10
11 A sequence of operations is done on each item in the input stream.
12 The operations are done in the order they appear on the
13 command line. Operations can be repeated as many times as needed on the
14 command line.
15
16 Input items may be binary numbers (short or float) or ascii lines
17 (terminated by CR) according to the type option.
18
19 .SH OPTIONS
20
21 1. Operations.
22
23 The list of operations is as follows. Some operations take valued
24 arguments (which are real numbers), others are flags, as indicated:
25
26 .nf
27 operation result for each input item x
28
29 add=<value> x+<value>
30 negate=on -x
31 multiply=<value> x*<value>
32 divide=<value> x/<value>
33 remainder=<value> real remainder of x/<value>
34 inverse=on 1/x
35 round=on x rounded to nearest integer
36 absolute=on |x|
37 power=<value> x^<value>
38 exponent=<value> <value>^x
39 e-exponent=on e^x
40 log=<value> log(x) to base <value>
41 e-log=on log(x) to base e.
42 sin=on sin(x)
43 cos=on cos(x)
44 tan=on tan(x)
45 threshold=<value> if ( x <value> ) 0 else if ( x = <value> ) 1
46 diff1=on first difference
47 diff2=on second difference
48 diff3=on third difference
49 cusum=on cumulative sum
50 cumean=on cumulative (recursive) mean an
51 cumin=on cumulative min
52 cumax=on cumulative max
53 .fi
54
55
56 2. type.
57
58 The `type' option sets the data type for all input and output items.
59 Recognised data types are: short, float, ascii.
60
61 Ascii data is read in line-by-line, and comment lines are allowed.
62 The following operation apply only to ascii input items, enabling
63 comment lines to be stripped or echoed directly to the output.
64
65 .nf
66 strip=<value> ignore lines beginning with <value> string
67 echo=<value> echo lines beginning with <value> string
68 number=on number output lines
69 .fi
70
71 If number=on then stripped lines are not numbered; they simply dissappear.
72 If there are no operations, (other than comment stripping/echoing or line
73 numbering), then ascii lines are echoed.
74
75
76 .SH EXAMPLES
77
78 1. Specify the following ordered sequence of operations on each binary
79 float in the input stream: invert (take reciprocal), scale up by 100,
80 square (raise to power 2), invert (take reciprocal), square root (raise to
81 power 0.5).
82
83 op type=float inverse=on multiply=100 power=2 inverse=on power=.5 file
84
85 2. Increase dynamic range by powering up and scaling down.
86 (Note that internal calculating is done in floating point; the short datatype
87 applies only to input and output).
88
89 op type=short power=4 divide=3e8 file
90
91 3. Print out the result of log2(17/16).
92
93 echo 17 | op type=ascii -div16 -log2
94
95 4. For each input number x output exp(-0.2x)
96
97 op mult=-0.2 e-exp=on
98
99 5. Read ascii data ignoring any comment lines defined as beginning with the
100 string "**". Read one ascii number per line and for each number x output 149-x.
101
102 op type=ascii strip="**" neg=on add=149 file
103
104 .SH "SEE ALSO"
105
106 options merge
107 .SH COPYRIGHT
108 .LP
109 Copyright (c) Applied Psychology Unit, Medical Research Council, 1995
110 .LP
111 Permission to use, copy, modify, and distribute this software without fee
112 is hereby granted for research purposes, provided that this copyright
113 notice appears in all copies and in all supporting documentation, and that
114 the software is not redistributed for any fee (except for a nominal
115 shipping charge). Anyone wanting to incorporate all or part of this
116 software in a commercial product must obtain a license from the Medical
117 Research Council.
118 .LP
119 The MRC makes no representations about the suitability of this
120 software for any purpose. It is provided "as is" without express or
121 implied warranty.
122 .LP
123 THE MRC DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
124 ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
125 THE A.P.U. BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES
126 OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
127 WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
128 ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
129 SOFTWARE.
130