Editing
Installation
(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!
==Testing and quick start== Here are a few simple tests and a brief introduction to Madagascar: Typing any Madagascar command in a terminal window without parameters should generate brief documentation. Try one of the following: <pre> sfin sfattr sfspike sfbandpass sfwiggle </pre> If you get an error like "Command not found," you may not have your <tt>$PATH</tt> environment variable set correctly, or you may need to issue the <tt>rehash</tt> command. Now try making a simple Madagascar data file: <pre> sfspike n1=1000 k1=300 > spike.rsf </pre> This command generates a one-dimensional list of 1000 numbers, all zero except for a spike equal to one at position 300. If this generates an error like <pre> Cannot write to data file /path/spike.rsf@: Bad file descriptor </pre> you may need to create the directory pointed to by your <tt>$DATAPATH</tt> environment variable. The file <tt>spike.rsf</tt> is a text header. The actual data are stored in the binary file pointed to by the <tt>in=</tt> parameter in the header. You can look at the header file directly with <tt>more</tt>, or better, examine the file properties with <pre> sfin spike.rsf </pre> You can learn more about the contents of <tt>spike.rsf</tt> with <pre> sfattr < spike.rsf </pre> The following command applies a bandpass filter to <tt>spike.rsf</tt> and puts the result in <tt>filter.rsf</tt>: <pre> sfbandpass fhi=2 phase=y < spike.rsf > filter.rsf </pre> The following command makes a graphics file from <tt>filter.rsf</tt>: <pre> sfwiggle clip=0.02 title="Welcome to Madagascar" < filter.rsf > filter.vpl </pre> If you have an X11 display program running, and your <tt>$DISPLAY</tt> environment variable is set correctly, you can display the graphics file with: <pre> sfpen < filter.vpl </pre> You can pipe Madagascar commands together and do the whole thing at once like this: <pre> sfspike n1=1000 k1=300 | sfbandpass fhi=2 phase=y | \ sfwiggle clip=0.02 title="Welcome to Madagascar" | sfpen </pre> If you have SCons installed, you can use it to automate Madagascar processing. Here is a simple <tt>SConstruct</tt> file to make <tt>filter.rsf</tt> and <tt>filter.vpl</tt>: <syntaxhighlight lang="python"> # # Setting up # from rsf.proj import * # # Make filter.rsf # Flow('filter',None,'spike n1=1000 k1=300 | bandpass fhi=2 phase=y') # # Make filter.vpl # Result('filter','wiggle clip=0.02 title="Welcome to Madagascar"') End() </syntaxhighlight> Put the file in an empty directory, give it the name <tt>SConstruct</tt>, <tt>cd</tt> to that directory, and issue the command: <pre> scons </pre> The graphics file is now stored in the <tt>Fig</tt> subdirectory. You can view it manually with: <pre> sfpen Fig/filter.vpl </pre> ... or you can use: <pre> scons view </pre> When a SConstruct file makes more than one graphics file, the <tt>scons view</tt> command will display all of them in sequence. [[Image:filter.png|frame|center|Welcome to Madagascar.]] Now edit the <tt>SConstruct</tt> file: change the title string on the <tt>Result</tt> line to "Hello World!", save the file, and rerun the scons command. You will see that scons has figured out that the file <tt>filter.rsf</tt> does not need to be rebuilt because nothing that affects it has changed. Only the file <tt>filter.vpl</tt> is rebuilt.
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