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!
==sfscale== {| class="wikitable" align="center" cellspacing="0" border="1" ! colspan="4" style="background:#ffdead;" | Scale data. |- ! colspan="4" | sfscale < in.rsf > out.rsf axis=0 rscale=0. pclip=100. dscale=1. |- | colspan="4" | <br>To scale by a constant factor, you can also use sfmath. |- | ''int '' || '''axis=0''' || || Scale by maximum in the dimensions up to this axis. |- | ''float '' || '''dscale=1.''' || || Scale by this factor (works if rscale=0) |- | ''float '' || '''pclip=100.''' || || data clip percentile |- | ''float '' || '''rscale=0.''' || || Scale by this factor. |} <tt>sfscale</tt> scales the input dataset by a factor. Here are some simple examples. First, let us create a test dataset. <pre> bash$ sfmath n1=5 n2=3 o1=1 o2=1 output="x1*x2" > test.rsf bash$ < test.rsf sfdisfil 0: 1 2 3 4 5 5: 2 4 6 8 10 10: 3 6 9 12 15 </pre> Scale every data point by 2: <pre> bash$ < test.rsf sfscale dscale=2 | sfdisfil 0: 2 4 6 8 10 5: 4 8 12 16 20 10: 6 12 18 24 30 </pre> Divide every trace by its maximum value: <pre> bash$ < test.rsf sfscale axis=1 | sfdisfil 0: 0.2 0.4 0.6 0.8 1 5: 0.2 0.4 0.6 0.8 1 10: 0.2 0.4 0.6 0.8 1 </pre> Divide by the maximum value in the whole 2-D dataset: <pre> bash$ < test.rsf sfscale axis=2 | sfdisfil 0: 0.06667 0.1333 0.2 0.2667 0.3333 5: 0.1333 0.2667 0.4 0.5333 0.6667 10: 0.2 0.4 0.6 0.8 1 </pre> The <tt>rscale=</tt> parameter is synonymous with <tt>dscale=</tt> except when it is equal to zero. With <tt>sfscale dscale=0</tt>, the dataset gets multiplied by zero. If using <tt>rscale=0</tt>, the other parameters are used to define scaling. Thus, <tt>sfscale rscale=0 axis=1</tt> is equivalent to <tt>sfscale axis=1</tt>, and <tt>sfscale rscale=0</tt> is equivalent to <tt>sfscale dscale=1</tt>.
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