Editing
Guide to madagascar programs
(section)
Jump to navigation
Jump to search
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
==sfstack== {| class="wikitable" align="center" cellspacing="0" border="1" ! colspan="4" style="background:#ffdead;" | Stack a dataset over one of the dimensions. |- ! colspan="4" | sfstack < in.rsf > out.rsf scale= axis=2 rms=n norm=y min=n max=n prod=n |- | colspan="4" | <br>This operation is adjoint to sfspray. |- | ''int '' || '''axis=2''' || || which axis to stack. If axis=0, stack over all dimensions |- | ''bool '' || '''max=n''' || [y/n] || If y, find maximum instead of stack. Ignores rms and norm. |- | ''bool '' || '''min=n''' || [y/n] || If y, find minimum instead of stack. Ignores rms and norm. |- | ''bool '' || '''norm=y''' || [y/n] || If y, normalize by fold. |- | ''bool '' || '''prod=n''' || [y/n] || If y, find product instead of stack. Ignores rms and norm. |- | ''bool '' || '''rms=n''' || [y/n] || If y, compute the root-mean-square instead of stack. |- | ''floats '' || '''scale=''' || || optionally scale before stacking [n2] |} While <tt>sfspray</tt> adds a dimension to a hypercube, <tt>sfstack</tt> effectively removes one of the dimensions by stacking over it. Here are some examples: <pre> bash$ sfmath n1=5 n2=3 output=x1+x2 > test.rsf bash$ < test.rsf sfdisfil 0: 0 1 2 3 4 5: 1 2 3 4 5 10: 2 3 4 5 6 bash$ < test.rsf sfstack axis=2 | sfdisfil 0: 1.5 2 3 4 5 bash$ < test.rsf sfstack axis=1 | sfdisfil 0: 2.5 3 4 </pre> Why is the first value not 1 (in the first case) or 2 (in the second case)? By default, <tt>sfstack</tt> normalizes the stack by the fold (the number of non-zero entries). To avoid normalization, use <tt>norm=n</tt>, as follows: <pre> bash$ < test.rsf sfstack norm=n | sfdisfil 0: 3 6 9 12 15 </pre> <tt>sfstack</tt> can also compute root-mean-square values as well as minimum and maximum values. <pre> bash$ < test.rsf sfstack rms=y | sfdisfil 0: 1.581 2.16 3.109 4.082 5.066 bash$ < test.rsf sfstack min=y | sfdisfil 0: 0 1 2 3 4 bash$ < test.rsf sfstack axis=1 max=y | sfdisfil 0: 4 5 6 </pre>
Summary:
Please note that all contributions to Madagascar are considered to be released under the GNU Free Documentation License 1.3 or later (see
My wiki:Copyrights
for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource.
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Navigation menu
Personal tools
English
Not logged in
Talk
Contributions
Create account
Log in
Namespaces
Page
Discussion
English
Views
Read
Edit
View history
More
Search
Getting Madagascar
download
Installation
GitHub repository
SEGTeX
Introduction
Package overview
Tutorial
Hands-on tour
Reproducible documents
Hall of Fame
User Documentation
List of programs
Common programs
Popular programs
The RSF file format
Reproducibility with SCons
Developer documentation
Adding programs
Contributing programs
API demo: clipping data
API demo: explicit finite differences
Community
Conferences
User mailing list
Developer mailing list
GitHub organization
LinkedIn group
Development blog
Twitter
Slack
Tools
What links here
Related changes
Special pages
Page information