Rescale
With this you can make simple changes to the Big Array. The top two fields in the window are the Real and Imaginary parts of a single complex number. When the rescale is executed this number will complex multiplied to the complex values stored in all the pixels of the Big Array. This is then followed by complex addition with the complex pair below. You can use this to initialize the Big Array by multiplying by 0 and adding whatever you want.
The picture above is of the window created from a script icon.
The window that appears when selected from the menu has an OK button for immediate
use instead of the black button,and the batch button does not appear.
To use the batch button you should read this
link.
Using a Formula or Quick Calculation
These panes below both permit you to enter mathematical expressions to be evaluated in the process of calculation. The difference between them is that the "Formula" option evaluates the two fields for every single pixel of the big array while the "Quick Calc." pane evaluates all fields just one time on each click or execution of the icon. Although the six upper fields of the "Quick calc." pain are evaluated during the execution of either of these pains, experience has shown me that it is easy to forget to return to the desired pain before closing the window.
If you choose to read data in from a batch file the following will happen: If the "Rescale Big Array" window is front the first 4 fields or each record are used to fill the fields in that window. If the second or third pane are front the fields of each record (seven max) are entered with the names "c1, ..., c7" and are available for use in the equations. This permits one to change the numbers in each execution of the icon.
If the "Formula" or "Quick Calc." pains are front at the time of execution, and if a "Symbol Defs." icon has been executed then the table of symbols will be read before reading any of the fields of these windows. These symbols and their values from the "Symbol Defs" icon are available to use in your calculations. Furthermore, if a symbol is defined in field 1-6 of the "Quick Calc." pane and if the check box next to the field is checked, that symbol will be added to the "Symbol Defs" list of symbols and values or if the symbol already exists, it's value will replace the old value. This new symbol will be available to those icons that use symbols. Make sure it is defined before use.
This is getting really complicated isn't it. So click the help button in the window and re-read this occasionally to refresh your memory. The programmer/user who wrote this does.
|
|
When the Rescale Icon appears in a script, it will have a "Monitor Symbol" button in its window. When pressed a small window is produced which can be placed for maximum visibility.
When the icon is executed in the script the symbol in the yellow box is looked up in the symbol table kept in the "SYMBOL DEFS" icon. This value may have been placed or changed in the symbol list by a entry in the "Quick Calc" pane of this or any other "Rescale" icon. If you have lost track of which "Rescale" icon produced the monitor window, click on the little monitor widow and the appropriate "Rescale" icon will be highlighted.
If you find that the execution of your script stops at this icon, reexamine the expressions in the windows. No box can be empty. It must have at least a zero.
The expression must make sense. Make sure that every multiply is indicated by "*" and that all parentheses close.
Here is a secret.
If there is a red data line from the "peakFinder"
icon to this icon some new constants will be defined using numbers from the "peakFinder".
maxX ---- the x-coordinate of the peak found by the icon.
maxY ---- the y-coordinate of the peak found by the icon.
maxR ---- the real part of the value at that location.
maxI ---- the imaginary part of the value at that location.
These can be used by either "Formula" or "QuickCalc"
You may use the functions below. The functions are all floating point. Put arguments in parentheses.
+, -, *, /
^ raise a number to the power of the other
% --- modulus
pi ------ is defined already (no parentheses)
N ------is the size of the array. The total number of pixels is N times N.(no parentheses)
rnd ----will give you one random number. (-1 ≤ rnd < 1)
Use "rnd" twice or more in one execution of the icon gives the same number.
tm -----if check box checked number of seconds since document started up.(no parentheses)
sin
cos
tan
log -----log base 10
log2 --- log base 2
ln ----- log base e
exp ---e^( )
abs
sqrt
asin
acos
atan
sinh
cosh
tanh
asinh
acosh
atanh
ceil ----- round up to int.
floor ----round down to int
round
trunc
rint
near
dtor ----- degrees to radians
rtod ----- radians to degrees
Thanks to Graham Cox for his
MacZoop expression parser.
© 2000, Graham Cox