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!
==sfspray== {| class="wikitable" align="center" cellspacing="0" border="1" ! colspan="4" style="background:#ffdead;" | Extend a dataset by duplicating in the specified axis dimension. |- ! colspan="4" | sfspray < in.rsf > out.rsf axis=2 n= d= o= label= unit= |- | colspan="4" | This operation is adjoint to sfstack. |- | ''int '' || '''axis=2''' || || which axis to spray |- | ''float '' || '''d=''' || || Sampling of the newly created dimension |- | ''string '' || '''label=''' || || Label of the newly created dimension |- | ''int '' || '''n=''' || || Size of the newly created dimension |- | ''float '' || '''o=''' || || Origin of the newly created dimension |- | ''string '' || '''unit=''' || || Units of the newly created dimension |} <tt>sfspray</tt> extends the input hypercube by replicating the data in one of the dimensions. The output dataset acquires one additional dimension. Here is an example: Start with a 2-D dataset <pre> bash$ sfmath n1=5 n2=2 output=x1+x2 > test.rsf bash$ sfin test.rsf test.rsf: in="/var/tmp/test.rsf@" esize=4 type=float form=native n1=5 d1=1 o1=0 n2=2 d2=1 o2=0 10 elements 40 bytes bash$ < test.rsf sfdisfil 0: 0 1 2 3 4 5: 1 2 3 4 5 </pre> Extend the data in the second dimension <pre> bash$ < test.rsf sfspray axis=2 n=3 > test2.rsf bash$ sfin test2.rsf test2.rsf: in="/var/tmp/test2.rsf@" esize=4 type=float form=native n1=5 d1=1 o1=0 n2=3 d2=1 o2=0 n3=2 d3=1 o3=0 30 elements 120 bytes bash$ < test2.rsf sfdisfil 0: 0 1 2 3 4 5: 0 1 2 3 4 10: 0 1 2 3 4 15: 1 2 3 4 5 20: 1 2 3 4 5 25: 1 2 3 4 5 </pre> The output is three-dimensional, with traces from the original data duplicated along the second axis. Extend the data in the third dimension <pre> bash$ < test.rsf sfspray axis=3 n=2 > test3.rsf bash$ sfin test3.rsf test3.rsf: in="/var/tmp/test3.rsf@" esize=4 type=float form=native n1=5 d1=1 o1=0 n2=2 d2=1 o2=0 n3=2 d3=? o3=? 20 elements 80 bytes bash$ < test3.rsf sfdisfil 0: 0 1 2 3 4 5: 1 2 3 4 5 10: 0 1 2 3 4 15: 1 2 3 4 5 </pre> The output is also three-dimensional, with the original data replicated along the third axis.
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