Program of the month: sfintbin

June 10, 2015 Celebration No comments

sfintbin uses trace headers to arrange input traces in a 3-D cube.

The input to this program typically comes from reading a SEGY file with sfsegyread.

The following example from tccs/phase/boon3 shows a typical output:

sfintbin takes as an input a 2-D trace file and its corresponding trace header file (specified by head=). The header file is assumed to contain integer values. The output 3-D cube is generated according to trace header keys, which can be specified by name (xk=, yk=) or by number (xkey=, ykey=). In the example above, the parameters are xk=cdp and yk=fldr. If you are unsure which keys to use, try sfheaderattr. The range of values can be controlled with xmin=, xmax=, ymin=, ymax=.

sfintbin performs a very simple operation: it goes through the input file and assigns traces to the output according to their header keys. If there are several traces with the same x and y keys, the last one survives. If there are bins in the output with no input, they are filled with zeros. You can output the mask of empty traces using mask=. You can output the mapping of traces using map=. The latter is particularly useful for the inverse operation (mapping from 3-D back to 2-D), which can be performed with inv=y.

For an absent trace header key, which corresponds to a trace number in a gather, you can set xkey= to a negative number. For this to work, the input needs to be sorted in the corresponding gathers, which can be accomplished with sfheadersort.

To produce a 4-D output (for example, a set of gathers in 3-D), try sfintbin3.

10 previous programs of the month:

Literate programming with IPython notebooks

June 2, 2015 Systems No comments

Donald KnuthLiterate programming is a concept promoted by Donald Knuth, the famous computer scientist (and the author of the Art of Computer Programming.) According to this concept, computer programs should be written in a combination of the programming language (the usual source code) and the natural language, which explains the logic of the program.

When it comes to scientific programming, using comments for natural-language explanations is not always convenient. Moreover, it is limited, because such explanations may require figures, equations, and other common elements of scientific texts. IPython/Jupyter notebooks provide a convenient tool for combining different text elements with code. See the notebook at https://github.com/sfomel/ipython/blob/master/LiterateProgramming.ipynb for an example on how to implement literate programming using an IPython notebook with reproducible SConstruct data-analysis workflows in Madagascar.

Related posts:
* Madagascar in the cloud
* Reproducible research and IPython notebooks

1M

May 27, 2015 Celebration No comments

Madagascar passes a symbolic mark of one million lines of code. Black Duck Open Hub reports that

In a Nutshell, Madagascar… has had 12,444 commits made by 85 contributors representing 1,098,223 lines of code

Amplitude balancing

May 9, 2015 Documentation No comments

Another old paper is added to the collection of reproducible documents:
Iterative least-square inversion for amplitude balancing

Variations in source strength and receiver amplitude can introduce a bias in the final AVO analysis of prestack seismic reflection data. In this paper we tackle the problem of the amplitude balancing of the seismic traces from a marine survey. We start with a 2-D energy map from which the global trend has been removed. In order to balance this amplitude map, we first invert for the correction coefficients using an iterative least-square algorithm. The coefficients are calculated for each shot position along the survey line, each receiver position in the recording cable, and each offset. Using these coefficients, we then correct the original amplitude map for amplitude variations in the shot, receiver, and offset directions.

Two-dimensional Hilbert transform

May 7, 2015 Documentation No comments

A new paper is added to the collection of reproducible documents:
Seismic dip estimation based on the two-dimensional Hilbert transform and its application in random noise attenuation

In seismic data processing, random noise seriously affects the seismic data quality and subsequently the interpretation. This study aims to increase the signal-to-noise ratio by suppressing random noise and improve the accuracy of seismic data interpretation without losing useful information. Hence, we propose a structure-oriented polynomial fitting filter. At the core of structure-oriented filtering is the characterization of the structural trend and the realization of nonstationary filtering. First, we analyze the relation of the frequency response between two-dimensional (2D) derivatives and the 2D Hilbert transform (Riesz transform). Then, we derive the noniterative seismic local dip operator using the 2D Hilbert transform to obtain the structural trend. Second, we select polynomial fitting as the nonstationary filtering method and expand the application range of the nonstationary polynomial fitting. Finally, we apply variableamplitude polynomial fitting along the direction of the dip to improve the adaptive structureoriented filtering. Model and field seismic data show that the proposed method suppresses the seismic noise while protecting structural information.

Structure-constrained acoustic impedance

May 6, 2015 Documentation No comments

A new paper is added to the collection of reproducible documents:
Structure-constrained relative acoustic impedance using stratigraphic coordinates

Acoustic impedance inversion involves conversion of seismic traces to a reflection coefficient time series, and then into acoustic impedance. The usual assumption for the transformation of post-stack seismic data into impedance , is that seismic traces can be modeled using the simple convolutional model. According to the convolutional model, a seismic trace is a normal-incidence record, which is an assumption that is strictly true only if the earth structure is composed of horizontal layers. In the presence of dipping layers, such an assumption is violated, which introduces bias in the result of impedance inversion. I propose to implement impedance inversion in the stratigraphic coordinate system, where the vertical direction is normal to reflectors and seismic traces represent normal-incidence seismograms. Tests on field data produce more accurate and detailed impedance results from inversion in the stratigraphic coordinate system, compared to impedance results using the conventional Cartesian coordinate system.

Summer events

May 5, 2015 Celebration No comments

Two exciting events are being planned for this summer. The Madagascar School for Advanced Users is being planned for August 8-9, 2015. The school will take place in Qingdao, China, and will be hosted by the China University of Petroleum. Unlike previous Madagascar schools, the intended audience are not beginners but current users of Madagascar who want to learn more about advanced topics (parallel computing; graphical user interfaces; interfaces to C++, Python, and Matlab, etc.) More information is available at https://www.ahay.org/wiki/Qingdao2015. The Working Workshop on 3D Seismic Data Processing is being planned for August 19-22, 2015. The workshop will take place in Houston and will be hosted by Rice University. Unlike previous working workshops, the participations is not limited to Madagascar users. Users of other software packages with interest in seismic field data processing are encouraged to participate. The workshop is being organized by Karl Schleicher, with support of SEG. More information is available at https://www.ahay.org/wiki/SEG3DSeismicProcessingWorkingWorkshopHouston2015-Land3D

Program of the month: sfbox

May 1, 2015 Celebration No comments

sfbox draws a boxed baloon-style label, which is useful for annotating graphics.

The following example from sep/avo/imp annotates several reflectors on a seismic section:

sfbox has a large number of parameters to control the box appearance. The most important are: label= for the text on the label, x0= and y0 for the position of the pointer tip (in Vplot coordinates), xt= and yt= for the relative shift of the label with respect to the pointer tip.

The following example from tccs/timelapse/duri uses xt=0 and yt=0 to hide the pointer under the label.

Selecting proper parameters for the location of the label can be tricky. The task is made interactive by the vpannotate script. vpannotate takes a Vplot file as an input and adds an annotation to it. It can do it in the batch mode (when used with batch=y) or in an interactive mode (when used with batch=n). In the later case, the selected parameters are saved in a text file, which can be used as a parameter file for sfbox (or, alternatively, for vpannotate batch=y).

10 previous programs of the month

Tutorial on seismic survey design

April 23, 2015 Examples No comments

The example in rsf/tutorials/survey reproduces the tutorial from Evan Bianco on designing 3D seismic surveys. For more explanation, see Evian’s blog post Laying out a seismic survey.

Madagascar users are encouraged to try improving the results.

Reproducible research in psychology

April 21, 2015 Links No comments

An article A Perfect Storm: The Record of a Revolution by Eric-Jan Wagenmakers, a mathematical psychologist from the Unversity of Amsterdam, describes a reproducibility revolution, which is taking place in psychology:

The dynamics of political revolutions are in some ways similar to the academic revolution that has recently gripped the field of psychology. Over the last two decades, increasing levels of competition for scarce research funding have created a working environment that rewards productivity over reproducibility; this perverse incentive structure has caused some of the findings in the psychological literature to be spectacular and counter-intuitive, but likely false […] The general dissatisfaction with the state of the field was expressed in print only occasionally, until in 2011 two major events ignited the scientific revolution that is still in full force today.



The article was published this month by the Inquisitive Mind (In-Mind) magazine.

Eric-Jan concludes:

Although some researchers are less enthusiastic about the “replicability movement” than others, it is my prediction that the movement will grow until its impact is felt in other empirical disciplines including the neurosciences, biology, economy, and medicine. The problems that confront psychology are in no way unique, and this affords an opportunity to lead the way and create dependable guidelines on how to do research well. Such guidelines have tremendous value, both to individual scientists and to society as a whole.