Sandbox: Difference between revisions

From Madagascar
Jump to navigation Jump to search
Nick (talk | contribs)
Nick (talk | contribs)
m →‎Using Madagascar: captcha edit test
 
(10 intermediate revisions by the same user not shown)
Line 6: Line 6:
The intent is to provide a middle ground between "fragment of useful information stranded in a forum post/in author's head" and "finished page ready for being posted to the world with pride". This sort of information benefits much more from collaborative editing than finished pages that are incrementally improved after creation.
The intent is to provide a middle ground between "fragment of useful information stranded in a forum post/in author's head" and "finished page ready for being posted to the world with pride". This sort of information benefits much more from collaborative editing than finished pages that are incrementally improved after creation.


=Pages under construction=
=Tri-fold brochure=
* [[Manual]]
For being handed over at conferences, displayed at booths of institutions using madagascar (if they will), etc.
* [[Library Reference]]
 
* [[Parallel Computing]]
Purpose: attracting new users to Madagascar
* [[Madagascar for non-seismologists]]
 
* [[Task-centric program list]]
The brochure is handled by the reader in two ways:
* [[IP self-audit]]
 
* [[SU to m8r dictionary]]
(1) Most often, closed (so pages 1 and 6 are the most important; this is why in newspapers, advertising on the first or last page costs much more than inside), or
* [[SEPlib to m8r dictionary]]
 
* [[Graphics development with vplot]]
(2) Opened and read in a manner similar to that of a book, in which case the order of pages is the one below:
 
{| border="1"
| 5
| 6
| 1
|-
| 2
| 3
| 4
|}
 
and the user reads it as 1-2-3-4-5-6.
 
Some ideas from the [[Why Madagascar]] page may be useful for the brochure.
 
This wiki page can be used to draft the text content of the brochure. Someone with experience in graphics has been identified as a free resource to help with the page layout, colors, etc.
 
An example we can learn from is the SU brochure. It looks a bit dry though -- A brochure needs more graphics than that. Graphics may need to be in uniform tones, so as to not increase the cost of printing (glossy paper, photographic quality costs).
 
[[Image:SU brochure 1.jpg]]
 
[[Image:SU brochure 2.jpg]]


=Info from the blog/mailing lists/forums=
=Info from the blog/mailing lists/forums=
Line 34: Line 56:
* [http://reproducibility.org/rsflog/index.php?/archives/28-Timing-the-execution.html Timing execution of SCons targets]
* [http://reproducibility.org/rsflog/index.php?/archives/28-Timing-the-execution.html Timing execution of SCons targets]
* [http://reproducibility.org/rsflog/index.php?/archives/18-Random-numbers.html The algorithm behind sfnoise]
* [http://reproducibility.org/rsflog/index.php?/archives/18-Random-numbers.html The algorithm behind sfnoise]
* [http://reproducibility.org/rsflog/index.php?/archives/15-Figure-size.html Figure sizes and aspect ratios]
* [http://m8r.info/rsflog/index.php?/archives/14-Color-schemes.html Demo of color schemes in sfgrey and sfgrey3]
* [http://reproducibility.org/rsflog/index.php?/archives/14-Color-schemes.html Demo of color schemes in sfgrey and sfgrey3]


==Configuration, install, testing, etc==
==Configuration, install, testing, etc==
Line 70: Line 91:
** Deciding whether programs should work with velocities or slownesses, and the standard axis order for a velocity model file.  
** Deciding whether programs should work with velocities or slownesses, and the standard axis order for a velocity model file.  
** Standard axis order for inputs to programs that do similar things, i.e. switching a migration program for another in a SCons rule should be as simple as just changing the name of the program, without having to scratch one's head to determine how should the data and velocity be set up. Create Python metaprograms that add transparently to the user dimensions of length 1 to 2-D datasets when needed by programs that deal with 3-D data.
** Standard axis order for inputs to programs that do similar things, i.e. switching a migration program for another in a SCons rule should be as simple as just changing the name of the program, without having to scratch one's head to determine how should the data and velocity be set up. Create Python metaprograms that add transparently to the user dimensions of length 1 to 2-D datasets when needed by programs that deal with 3-D data.
=How to transform a jpg image into a RSF file=
Provided that:
* your image is a grayscale one;
* samples are in byte format;
* you know the resolution of the image;
* you have ImageMagick installed on your computer;
your SConstruct file would look like this (simple jpg->rsf conversion + application of Sobel operator):
<python>
from rsfproj import *
n1 = 512
n2 = 512
Flow('lena.gray','lena.jpg',
    '''
    convert - ${TARGETS[0]}
    ''', stdout=0)
Flow('lena','lena.gray',
    '''
    echo
    in=$SOURCE
    data_format=native_uchar
    esize=1
    n1=%d
    n2=%d
    d1=1
    d2=1
    o1=0
    o2=0 | transp | dd type=float
    ''' % (n2, n1))
Result('lena',
      '''
      grey allpos=y title="Original Image" wantaxis=n
      ''')
Flow('grad','lena','grad2')
Result('grad',
      '''
      grey allpos=y title="Sobel Operator" wantaxis=n
      ''')
End ()
</python>
=How to transform a RSF file into an image, without axes=
==Using sfbyte2jpg==
<bash>
< model.rsf sfbyte | sfbyte2jpg > model.jpg
</bash>
Then use another program to convert <tt>model.jpg</tt> to the desired format.
==Using ImageMagick==
The following commands can be used in a SConstruct to generate almost any type of bitmap output:
<python>
Flow('data.gray','data',
    '''
    transp |  # Make data in row-major order
    byte gainpanell=all allpos=y |  # Convert data to byte representation
    disfil col=1 format="%02X" |  # Dump data in one column in ASCII-hex
    sed -e "s/\s*[0-9]*\:\s*//g" |  # Strip column numbers
    xxd -r -p  # Read ASCII output and convert it to binary form
    ''')
Flow('data.png','data.gray',
    '''
    convert -size %dx%d -depth 8 ${SOURCES[0]} ${TARGETS[0]}  # Run ImageMagick
    ''' % (n2, n1), stdin=0, stdout=0)
</python>
This one uses a 3rd party tool from ImageMagick suite (which
nowdays is included by default in any Linux distribution). It knows
almost any existing bitmap format. Just change the extension
in the last Flow() from .png to .gif or .jpg, for example.
Create the output simply by running scons data.png


=Artwork=
=Artwork=

Latest revision as of 22:03, 30 April 2011

The Wiki Sandbox contains links to:

  • useful documentation bits from the blog, mailing lists and forums. These bits may coagulate into documentation pages when a critical mass on a topic is attained;
  • pages under construction that may not be ready to go into the navbar (the navbar = the vertical list of links on the left of this page).
  • obsolete pages that have been unlinked from the navbar

The intent is to provide a middle ground between "fragment of useful information stranded in a forum post/in author's head" and "finished page ready for being posted to the world with pride". This sort of information benefits much more from collaborative editing than finished pages that are incrementally improved after creation.

Tri-fold brochure[edit]

For being handed over at conferences, displayed at booths of institutions using madagascar (if they will), etc.

Purpose: attracting new users to Madagascar

The brochure is handled by the reader in two ways:

(1) Most often, closed (so pages 1 and 6 are the most important; this is why in newspapers, advertising on the first or last page costs much more than inside), or

(2) Opened and read in a manner similar to that of a book, in which case the order of pages is the one below:

5 6 1
2 3 4

and the user reads it as 1-2-3-4-5-6.

Some ideas from the Why Madagascar page may be useful for the brochure.

This wiki page can be used to draft the text content of the brochure. Someone with experience in graphics has been identified as a free resource to help with the page layout, colors, etc.

An example we can learn from is the SU brochure. It looks a bit dry though -- A brochure needs more graphics than that. Graphics may need to be in uniform tones, so as to not increase the cost of printing (glossy paper, photographic quality costs).

Info from the blog/mailing lists/forums[edit]

Using Madagascar[edit]

Configuration, install, testing, etc[edit]

LaTeX[edit]

Brainstorming[edit]

  • Madagascar file bundles
  • Byteswapping option for sfdd
  • Google bombing for Madagascar; interface to industry
  • Parallelization API
  • Using XML in RSF headers;
    • Later: Author's own repudiation of the AJAX part of the previous proposal (other parts still stand).
    • Author's suggestion for an alternative to XML (from a private email to Sergey): "What does one do with XML? Read it with a program, right. XML is good if you can make no assumptions whatsoever about which language the said program was written in, and what that program is (could be a web browser of sorts, could be an Erlang application, could be a Python script, could be a C++ compiled binary). Then to deal with uncertainty you spend resources on insurance, using a verbose, completely unambiguous data description. So XML is the "canonical" approach. But what if one goes for the agile "worse is better" and notices that header file I/O costs nothing, so it can be done all in Python , regardless of what the language of the computational engine of the program. Then it does not make much sense to write from Python to XML, then read it back -- just write the header in Python! This, incidentally, is what the current syntax of RSF headers is. I realize that what I wanted XML for was delimiting in some way what was written to a header by a program and what was written by another. This way one would not get five trailing dimensions of length one because at some point the file was a five dimensional cube, while at the same time retaining meaningful dimensions of length one (i.e. the crossline for an inline extracted from a dataset). Rewriting to the header the complete description (n,o,d,unit,label) of the axes of the output for each program , all "kept together" by some syntax, would make it much easier to figure out what was actually done to the cube, and would avoid having to parse the entire file -- just read the last structure. JSON ( http://en.wikipedia.org/wiki/Json ) is designed to be an alternative to XML that is step in this direction (it is valid Javascript, and not at all far from Python), and of course, one can use Python syntax for keeping some variable values together, and do the I/O all in Python. I think this is what Lisp does and what the whole "data is code/code is data" thing is about."
  • From the Sergey-Reg Beardsley email exchange on rsfuser in Jul 2006: add to each history record Madagascar, OS versions
  • To have a consistent user interface, certain types of inputs and outputs should be standardized. A small beginning has been made by giving the verbosity option the same name everywhere. More meaningful issues would involve:
    • having all frequencies in Hertz
    • deciding whether all offsets should be half offsets or full offsets
    • FFT sign conventions (- for FFT forward in time, + for FFT forward in space, like in BEI)
    • Deciding whether programs should work with velocities or slownesses, and the standard axis order for a velocity model file.
    • Standard axis order for inputs to programs that do similar things, i.e. switching a migration program for another in a SCons rule should be as simple as just changing the name of the program, without having to scratch one's head to determine how should the data and velocity be set up. Create Python metaprograms that add transparently to the user dimensions of length 1 to 2-D datasets when needed by programs that deal with 3-D data.

Artwork[edit]

ASCII art – possibly useful for error messages, text UIs with ncurses, etc. Standard font:

 __  __           _                                      
|  \/  | __ _  __| | __ _  __ _  __ _ ___  ___ __ _ _ __ 
| |\/| |/ _` |/ _` |/ _` |/ _` |/ _` / __|/ __/ _` | '__|
| |  | | (_| | (_| | (_| | (_| | (_| \__ \ (_| (_| | |   
|_|  |_|\__,_|\__,_|\__,_|\__, |\__,_|___/\___\__,_|_|   
                          |___/                          

Big font:

 __  __           _                                      
|  \/  |         | |                                     
| \  / | __ _  __| | __ _  __ _  __ _ ___  ___ __ _ _ __ 
| |\/| |/ _` |/ _` |/ _` |/ _` |/ _` / __|/ __/ _` | '__|
| |  | | (_| | (_| | (_| | (_| | (_| \__ \ (_| (_| | |   
|_|  |_|\__,_|\__,_|\__,_|\__, |\__,_|___/\___\__,_|_|   
                           __/ |                         
                          |___/