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!
==sfheadercut== {| class="wikitable" align="center" cellspacing="0" border="1" ! colspan="4" style="background:#ffdead;" | Zero a portion of a dataset based on a header mask. |- ! colspan="4" | sfheadercut mask=head.rsf < in.rsf > out.rsf |- | colspan="4" | <br>The input data is a collection of traces n1xn2,<br>mask is an integer array of size n2. |- | ''file '' || '''mask=''' || || auxiliary input file name |} <tt>sfheadercut</tt> is close to <tt>sfheaderwindow</tt> but instead of windowing the dataset, it fills the traces specified by the header mask with zeroes. The size of the input data is preserved. Here is an example of using <tt>sfheaderwindow</tt> for zeroing every other trace in the input file. First, let us create an input file with ten traces: <pre> bash$ sfmath n1=5 n2=10 output=x2+1 > input.rsf bash$ < input.rsf sfdisfil 0: 1 1 1 1 1 5: 2 2 2 2 2 10: 3 3 3 3 3 15: 4 4 4 4 4 20: 5 5 5 5 5 25: 6 6 6 6 6 30: 7 7 7 7 7 35: 8 8 8 8 8 40: 9 9 9 9 9 45: 10 10 10 10 10 </pre> Next, we can create a mask with alternating ones and zeros using <tt>sfinterleave</tt>. <pre> bash$ sfspike n1=5 mag=1 | sfdd type=int > ones.rsf bash$ sfspike n1=5 mag=0 | sfdd type=int > zeros.rsf bash$ sfinterleave axis=1 ones.rsf zeros.rsf > mask.rsf bash$ sfdisfil < mask.rsf 0: 1 0 1 0 1 0 1 0 1 0 </pre> Finally, <tt>sfheadercut</tt> zeros the input traces. <pre> bash$ sfheadercut < input.rsf mask=mask.rsf > output.rsf bash$ sfdisfil < output.rsf 0: 1 1 1 1 1 5: 0 0 0 0 0 10: 3 3 3 3 3 15: 0 0 0 0 0 20: 5 5 5 5 5 25: 0 0 0 0 0 30: 7 7 7 7 7 35: 0 0 0 0 0 40: 9 9 9 9 9 45: 0 0 0 0 0 </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