ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/doc/man/man1/rcalc.1
(Generate patch)

Comparing ray/doc/man/man1/rcalc.1 (file contents):
Revision 1.4 by greg, Tue Dec 9 15:59:06 2003 UTC vs.
Revision 1.17 by greg, Sun Mar 13 16:11:48 2022 UTC

# Line 9 | Line 9 | rcalc - record calculator
9   ][
10   .B \-l
11   ][
12 + .B "\-p | \-P"
13 + ][
14   .B \-n
15   ][
16   .B \-w
# Line 21 | Line 23 | rcalc - record calculator
23   ][
24   .B "\-o format"
25   ][
26 + .B "\-in M"
27 + ][
28 + .B "\-on M"
29 + ][
30   .B "\-f source"
31   ][
32   .B "\-e expr"
# Line 54 | Line 60 | A special form of the
60   option may be followed immediately by a 'd' or an 'f' and an optional
61   count, which defaults to 1, indicating the number of double or float
62   binary values to read per record on the input file.
63 + If the input is byte-swapped, the
64 + .I \-iD
65 + or
66 + .I \-iF
67 + options may be substituted.
68   If binary input is specified, no format string or file is needed.
69   .PP
70   A
# Line 66 | Line 77 | or
77   .I \-of
78   options do not require a count, as this will be determined by the
79   number of output channels in the given expressions.
80 + If byte-swapped output is desired, the
81 + .I \-oD
82 + or
83 + .I \-oF
84 + options may be substituted.
85   .PP
86 + The
87 + .I \-p
88 + option specifies "passive mode," where characters that do not
89 + match the input format are passed unaltered to the output.
90 + If the
91 + .I \-P
92 + option is given instead, then valid input records that do not
93 + yield a positive
94 + .I cond
95 + value are similarly passed to the output.
96 + (See paragraph below.)\0
97 + These options options require that the
98 + .I \-i
99 + input format and
100 + .I \-o
101 + output format also be present.
102 + With both input and output formats, the passive mode can
103 + effectively substitute information in the middle of a file
104 + or stream without affecting the rest of the data.
105 + .PP
106 + If a
107 + .I \-in
108 + option is given with a positive integer argument,
109 + .I rcalc
110 + will stop processing input once it has loaded this number of records.
111 + Similarly, if a
112 + .I \-on
113 + option is present,
114 + .I rcalc
115 + will stop after producing this many records, which may be a smaller
116 + number if the
117 + .I cond
118 + variable is used.
119 + If multiple input files are given, these counts are continuous over
120 + the input and do not reset on each file.
121 + .PP
122   The variable and function definitions in each
123   .I \-f source
124 < file are read and compiled.
124 > file are read and compiled from the RADIANCE library where it is found.
125   The
126   .I \-e expr
127   option can be used to define variables on the command line.
# Line 177 | Line 229 | and the following operators:
229   .PP
230          +  -  *  /  ^
231   .PP
232 < Operators are evaluated left to right.
232 > Operators are evaluated left to right, except '^',
233 > which is right associative.
234   Powers have the highest precedence; multiplication and
235   division are evaluated before addition and subtraction.
236   Expressions can be grouped with parentheses.
# Line 204 | Line 257 | If
257   is positive, output is produced.
258   If
259   .I cond
260 < is less than or equal to zero, the record is skipped and no other expressions
260 > is less than or equal to zero, the record is skipped (or passed to the
261 > output if
262 > .I \-P
263 > is specified) and no other expressions
264   are evaluated.
265   This provides a convenient method for avoiding inappropriate calculations.
266   The following library of pre-defined functions and variables is provided:
267   .TP 10n
268 + .BR $N
269 + Return the value for input column
270 + .I N.
271 + If an input format is given, using a channel number generates an error.
272 + .TP
273   .BR "in(n)"
274   Return the value for input column
275   .I n,
# Line 219 | Line 280 | This is an alternate way to get a column value instead
280   the $N notation, and is more flexible since it is programmable.
281   This function is disabled if an input format is used.
282   .TP
283 < .BR "if(cond, then, else)"
284 < if cond is greater than zero,
283 > .BR "if(test, then, else)"
284 > if test is greater than zero,
285   then is evaluated, otherwise else is evaluated.
286   This function is necessary for recursive definitions.
287   .TP
# Line 234 | Line 295 | is zero, the number of available arguments is returned
295   .BR "rand(x)"
296   compute a random number between 0 and 1 based on x.
297   .TP
298 + .BR "min(a1, a2, ..)"
299 + return the minimum value from a list of arguments.
300 + .TP
301 + .BR "max(a1, a2, ..)"
302 + return the maximum value from a list of arguments.
303 + .TP
304   .BR "floor(x)"
305   return largest integer not greater than x.
306   .TP
# Line 268 | Line 335 | trigonometric functions.
335   inverse trigonometric functions.
336   .TP
337   .BR "atan2(y, x)"
338 < inverse tangent of y/x (range -pi to pi).
338 > inverse tangent of y/x (range \-pi to pi).
339   .SH EXAMPLE
340   To print the square root of column two in column one,
341   and column one times column three in column two:
342   .IP "" .2i
343   rcalc -e '$1=sqrt($2);$2=$1*$3' inputfile > outputfile
344 + .SH ENVIRONMENT
345 + RAYPATH         the directories to check for auxiliary files.
346   .SH AUTHOR
347   Greg Ward
348   .SH BUGS
# Line 282 | Line 351 | String variables can only be used in input and output
351   options, not in definitions.
352   .PP
353   Tabs count as single spaces inside fields.
354 + .PP
355 + The
356 + .I \-P
357 + option buffers up to 16 Kbytes of data per record.
358 + Longer records passed because the "cond" variable
359 + evaluates to <= 0 will be partial; a warning will
360 + be generated and the string "*** MISSING DATA ***"
361 + will appear at the break.
362 + The only workaround is to use the
363 + .I \-p
364 + option instead, which does not pass rejected records.
365   .SH "SEE ALSO"
366 < calc(1), cnt(1), ev(1), getinfo(1), lam(1), tabfunc(1), total(1)
366 > cnt(1), ev(1), getinfo(1), icalc(1), rcollate(1), rlam(1),
367 > rsplit(1), tabfunc(1), total(1)

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines