next up previous [pdf]

Next: About this document ... Up: Fomel: Installation Previous: Troubleshooting

Testing and quick start

Here are a few simple tests and and a brief introduction to Madagascar:

Typing any Madagascar command in a terminal window without parameters should generate a brief documentation on that command. Try one of the following:

sfin
sfattr
sfspike
sfbandpass
sfwiggle

If you get an error like ``Command not found'', you may not have your PATH environment variable set correctly, or you may need to issue the rehash command.

Now try making a simple Madagascar data file:

sfspike n1=1000 k1=300 > spike.rsf
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
Cannot write to data file /path/spike.rsf@: Bad file descriptor
you may need to create the directory pointed to by your DATAPATH environment variable.

The file spike.rsf is a text header. The actual data are stored in the binary file pointed to by the in= parameter in the header. You can look at the header file directly with more, or better, examine the file properties with:

sfin spike.rsf
You can learn more about the contents of spike.rsf with
sfattr < spike.rsf
The following command applies a bandpass filter to spike.rsf and puts the result in filter.rsf:
sfbandpass fhi=2 phase=1 < spike.rsf > filter.rsf
The following command makes a graphics file from filter.rsf:
sfwiggle title="Welcome to Madagascar" < filter.rsf > filter.vpl
If you have an X-Window display program running, and your DISPLAY environment variable is set correctly, you can display the graphics file with
xtpen < filter.vpl
You can pipe Madagascar commands together and do the whole thing at once like this:
sfspike n1=1000 k1=300 | sfbandpass fhi=2 phase=1 | \
sfwiggle title="Welcome to Madagascar" | xtpen
If you have SCons installed, you can use it to automate Madagascar processing. Here is a simple SConstruct file to make filter.rsf and filter.vpl:
#
# Setting up
#
from rsfproj import *
 
#
# Make filter.rsf
#
Flow('filter',None,
     'spike n1=1000 k1=300 | bandpass fhi=2 phase=1')
 
#
# Make filter.vpl
#
Result('filter',
       'wiggle clip=0.02 title="Welcome to Madagascar"')

End()

Put the file in an empty directory, give it the name SConstruct, cd to that directory, and issue the command:

scons
The graphics file is now stored in the Fig subdirectory. You can view it manually with:
xtpen Fig/filter.vpl
or you can use
scons view
When an SConstruct file makes more than one graphics file, the scons view command will display all of them in sequence.

filter
filter
Figure 1.
Welcome to Madagascar.
[pdf] [png] [scons]

The result should look like Figure 1.

Now edit the SConstruct file: change the title string on the Result line to "Hello World!", save the file, and rerun the scons command. You will see that scons has figured out that the file filter.rsf does not need to be rebuilt because nothing that affects it has changed. Only the file filter.vpl is rebuilt.


next up previous [pdf]

Next: About this document ... Up: Fomel: Installation Previous: Troubleshooting

2009-01-16