Editing
Revisiting SEP tour with Madagascar and SCons
(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!
===Windowing and plotting=== Our next task is to window and plot a significant portion of the data. Add the following line to the <tt>SConstruct</tt> file: <syntaxhighlight lang="python"> Flow('windowed','Txx.HH','window n2=10 min1=0.4 max1=0.8') </syntaxhighlight> The window command selects the first ten traces and the time window between 0.4 and 0.8 seconds. We will plot the windowed data with three different plotting programs. <syntaxhighlight lang="python"> plotpar = ''' transp=y poly=y yreverse=y pclip=100 nc=100 allpos=n ''' for plot in ('wiggle','contour','grey'): Result(plot,'windowed',plot + plotpar) </syntaxhighlight> For convenience, plotting parameters are put in a string called <tt>plotpar</tt>. A Python string can be enclosed in single, double, or triple quotes. Triple quotes allow the string to span multiple lines. In this case, we use triple quotes for convenience. Next, we loop (using Python's <tt>for</tt> construct) through three different programs (<tt>wiggle</tt>, <tt>contour</tt>, and <tt>grey</tt>). For each program, the command portion of <tt>Result</tt> is formed by concatenating two strings with Python's addition operator. Try running <tt>scons -Q wiggle.view</tt>. You should see something like the following output in your terminal: <pre> bash$ scons -Q wiggle.view < Txx.HH /path/to/RSF/bin/sfwindow n2=10 n1=200 f1=200 > windowed.rsf < windowed.rsf /path/to/RSF/bin/sfwiggle transp=y poly=y yreverse=y pclip=100 nc=200 > Fig/wiggle.vpl /path/to/RSF/bin/sfpen Fig/wiggle.vpl </pre> and a figure similar to Figure~(fig:wiggle) appearing on your screen. The <tt>-Q</tt> switch tells SCons to run in a quiet mode, suppressing verbose comments. We will use it from now on to save space. You can dismiss the figure by using the "q" key on the keyboard or by hitting the "quit" button. Run <tt>scons -Q view</tt>, and you should see simply <pre> bash$ scons -Q view /path/to/RSF/bin/sfpen Fig/wiggle.vpl </pre> Since the <tt>wiggle.vpl</tt> figure is up to date, SCons does not rebuild it. After quitting the figure, SCons will resume processing with <pre> < windowed.rsf /path/to/RSF/bin/sfcontour transp=y poly=y yreverse=y pclip=100 nc=200 > Fig/contour.vpl /path/to/RSF/bin/sfpen Fig/contour.vpl </pre> and a figure appearing on your screen. Quitting the figure, produces <pre> < windowed.rsf /path/to/RSF/bin/sfgrey transp=y poly=y yreverse=y pclip=100 nc=200 > Fig/grey.vpl /path/to/RSF/bin/sfpen Fig/grey.vpl </pre> and the next figure. [[Image:wiggle.png|frame|center|To see this figure on your screen, run <tt>scons~wiggle.view</tt>]] [[Image:contour.png|frame|center|To see this figure on your screen, run <tt>scons~contour.view</tt>]] [[Image:grey.png|frame|center|To see this figure on your screen, run <tt>scons~grey.view</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