Editing
Tutorial
(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!
===Using programs=== Madagascar programs follow the standard UNIX conventions for reading and writing RSF files to and from '''stdin''' and '''stdout'''. This is also the convention that Seismic Unix uses, so it should be familiar to SU users. For example: the program '''sfattr''' allows us to get attributes about an RSF file (mean, standard deviation, min, max, etc.) To get the attributes for a pre-computed file, we might use <pre> sfattr < file.rsf rms = 1.41316 mean = 0.999667 2-norm = 357.503 variance = 0.997693 std dev = 0.998846 max = 5.05567 at 36 8 27 min = -3.59936 at 18 9 6 nonzero samples = 64000 total samples = 64000 </pre> We demonstrate how to read and write RSF files using '''sfwindow''' which is a program that allows us to select portions of an RSF file. When '''sfwindow''' is used without any additional parameters, we are able to make a copy of a file with a different filename. For example: <pre> sfwindow < file.rsf > file2.rsf </pre> gives us two files, file.rsf and file2.rsf which are identical but not the same file. If your intention is simply to copy a file, you can also use '''sfcp''' . In addition to specifying files to read in and out on the command line we can specify the parameters for each program that are necessary for it to run, or to produce the desired result. The general format for specifying parameters on the command line is '''key=val''' , where '''key''' is the name of the parameter that you want to set, and '''val''' is the value of the parameter. There are four (4) types of values that are acceptable: integers, floating point numbers, booleans, or strings. Going back to the window program, we can specify the number of traces or pieces of the file that we want to keep like: <pre> sfwindow < file.rsf n1=10 > file-win.rsf </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