Examples

Tutorial on colormaps

October 18, 2014 Examples No comments

The example in rsf/tutorials/colormaps reproduces the tutorial from Matteo Niccoli on how to evaluate and compare color maps. The tutorial was published in the August 2014 issue of The Leading Edge. Madagascar users are encouraged to try improving the results.

See also:

Several new color palettes have been recently added to Madagascar (thanks to Aaron Stanton): color=seismic (red-yellow-white-black, popular among seismic interpreters), color=owb (orange-white-black), and color=rwb (red-white-black).

Tutorial on data slicing

August 20, 2014 Examples No comments

The example in rsf/tutorials/slicing reproduces the tutorial from Evan Bianco of simple data slicing.

See also:

Madagascar users are encouraged to try improving the results.

Making a wedge

July 1, 2014 Examples No comments

The example in rsf/tutorials/wedge reproduces the example from Evan Bianco of simple convolution modeling with a wedge model.

See also:

Erupting Mount St. Helens

May 27, 2014 Examples No comments

The example in rsf/tutorials/sthelens reproduces the analysis by Evan Bianco of the digital elevation data from Mount St. Helens before and after its catastrophic eruption.


Madagascar users are encouraged to try improving the results.

Light Bartlein color palette

May 15, 2014 Examples No comments

The orange-white-purple diverging color palette was suggested in the article

Light, A. and P.J. Bartlein (2004) The end of the rainbow? Color schemes for improved data graphics. EOS Transactions of the American Geophysical Union 85(40):385

Matteo Niccoli recommends it for seismic data as a replacement for the familiar red-white-blue pallete (color=g in Madagascar). Now the Light-Bartlein palette is available to Madagascar plotting programs, such as sfgrey, as color=lb. See the following example from rsf/rsf/sfgrey:

More information:

Matt Hall’s tutorial on smoothing

March 11, 2014 Examples No comments

If you enjoyed Matt Hall‘s tutorial on smoothing surfaces and attributes in the last month’s issue of The Leading Edge, you can find it reproduced in Madagascar (with some extensions) under rsf/tutorials/smoothing.

If you like IPython notebooks, you can also reproduce this exercise using the provided notebook.

Madagascar users are encouraged to try improving this reproducible example.

Cube-helix color palette

August 23, 2013 Examples No comments

The “cube helix” color palette was suggested by Dave Green for displaying astronomical intensity. This pallette is designed to be monotonically increasing on terms of its perceived brightness, which results in a nice greyscale when printed on a black and white printer.

Now this palette is available to Madagascar plotting programs, such as sfgrey, as color=x. See the following example from rsf/rsf/sfgrey:

More information:

Color palettes

March 19, 2013 Examples No comments

In addition to the standard color palettes, it is now possible to use a custom palette by specifying it in a simple comma-separated text file (CSV). The following example from rsf/rsf/sfgrey uses the perceptional rainbow palette created by Matteo Niccoli. See Matteo’s blog posts for an explanation.

Lorenz attractor

May 17, 2011 Examples No comments

Just for fun… sflorenz computes “Lorenz attractor” in X-Z plane. See an example in rsf/rsf/fractal and an animated gif. Need 3D plot …

Parallel processing

December 27, 2007 Examples 1 comment

Many of the data processing operations are data-parallel: different traces, shot gathers, frequency slices, etc. can be processed independently. Madagascar provides several mechanisms for handling this type of embarrassingly parallel applications on computers with multiple processors.

  1. OpenMP
  2. OpenMP is a standard framework for parallel applications on shared-memory systems. It is supported by the latest versions of GCC and by some other compilers.
    To run a data-parallel processing task like

    sfradon np=100 p0=0 dp=0.01 < inp.rsf > out.rsf

    on a shared-memory computer with multiple processors (such as a multi-core PC), try sfomp, as follows:.

    sfomp sfradon np=100 p0=0 dp=0.01 < inp.rsf > out.rsf

    sfomp splits the input along the slowest axis (presumed to be data-parallel) and runs it through parallel threads. The number of threads is set by the OMP_NUM_THREADS environmental variable or (by default) by the number of available CPUs.

  3. MPI
  4. MPI (Message-Passing Interface) is a standard framework for parallel processing on different computer architectures including distributed-memory systems. Several MPI implementations (such as MPICH) are available.
    To parallelize a task using MPI, try sfmpi, as follows:

    mpirun -np 8 sfmpi sfradon np=100 p0=0 dp=0.01 input=inp.rsf output=out.rsf

    where the argument after -np specifies the number of processors involved. sfmpi will use this number to split the input along the slowest axis (presumed to be data-parallel) and to run it through parallel threads.
    Note: Some MPI implementations do not support system calls implemented in sfmpi and therefore will not support this option.

  5. MPI + OpenMP
  6. It is possible to combine the advantages of shared-memory and distributed-memory architectures by using OpenMP and MPI together.

    mpirun -np 32 sfmpi sfomp sfradon np=100 p0=0 dp=0.01 input=inp.rsf output=out.rsf

    will distribute the job on 32 nodes and split it again on each node using shared-memory threads.

  7. SCons
  8. If you process data using SCons, another option is available. Change

    Flow('out','inp','radon np=100 p0=0 dp=0.01')

    in your SConstruct file to

    Flow('out','inp','radon np=100 p0=0 dp=0.01',split=[3,256])

    where the optional split= parameter contains the axis that needs to be split and the size of this axis. Then run something like

    scons -j 8 CLUSTER='localhost 4 node1.utexas.edu 2' out.rsf

    The -j options instructs SCons to run in parallel creating 8 threads, while the CLUSTER= option supplies it with the list of nodes to use and the number of processes to involve for each node. The output may look like

    < inp.rsf /RSFROOT/bin/sfwindow n3=42 f3=0 squeeze=n > inp__0.rsf
    < inp.rsf /RSFROOT/bin/sfwindow n3=42 f3=42 squeeze=n > inp__1.rsf
    /usr/bin/ssh node1.utexas.edu "cd /home/test ; /bin/env < inp.rsf /RSFROOT/bin/sfwindow n3=42 f3=84 squeeze=n > inp__2.rsf "
    < inp.rsf /RSFROOT/bin/sfwindow n3=42 f3=126 squeeze=n > inp__3.rsf
    < inp.rsf /RSFROOT/bin/sfwindow n3=42 f3=168 squeeze=n > inp__4.rsf
    /usr/bin/ssh node1.utexas.edu "cd /home/test ; /bin/env < inp.rsf /RSFROOT/bin/sfwindow f3=210 squeeze=n > inp__5.rsf "
    < inp__0.rsf /RSFROOT/bin/sfradon p0=0 np=100 dp=0.01 > out__0.rsf
    /usr/bin/ssh node1.utexas.edu "cd /home/test ; /bin/env < inp__1.rsf /RSFROOT/bin/sfradon p0=0 np=100 dp=0.01 > out__1.rsf "
    < inp__3.rsf /RSFROOT/bin/sfradon p0=0 np=100 dp=0.01 > out__3.rsf
    /usr/bin/ssh node1.utexas.edu "cd /home/test ; < spike__4.rsf /RSFROOT/bin/sfradon p0=0 np=100 dp=0.01 > out__4.rsf "
    < inp__2.rsf /RSFROOT/bin/sfradon p0=0 np=100 dp=0.01 > out__2.rsf
    < inp__5.rsf /RSFROOT/bin/sfradon p0=0 np=100 dp=0.01 > out__5.rsf
    < out__0.rsf /RSFROOT/bin/sfcat axis=3 out__1.rsf out__2.rsf out__3.rsf out__4.rsf out__5.rsf > out.rsf
    

    Splitting the input with sfwindow and putting the output back together with sfcat are immediately apparent. The advantage of the SCons-based approach (in addition to documentation and reproducible experiments) is fault tollerance: If one of the nodes dies during the process, one should be able to restart the computation without recreating parts that are already computed.

All these options will continue to evolve and improve with further testing. Please report your experiences and suggestions.