obspy/obspy — pull request #601 by miili (2013-07-31 20:00:25+00:00)
Title: Plotting of record-sections added

Offset is either read in meters from ```tr.stats.distance``` or azimuthal distance is calculated from AttribDict ```trace.stats.coordinates``` and events latitude and longitude as arguments.

Traces can be scaled ```scale=1.0``` and a velocity reduction can be performed ```vred=6500```.

```python
st.plot(type='section', plot_dx=10e3, outfile='sample_section.png')
```
![Record Section](https://f.cloud.github.com/assets/4992805/888826/7953ff7c-fa14-11e2-8b3d-16960000d61a.png)

complete list of parameters:
```
:type scale: scalar, optional
:param scale: Scale the traces width with this factor.
Default is to ``1.0``
:type vred: scalar, optional
:param vred: Perform velocity reduction, in m/s.
:type norm: 'stream', 'trace', optional
:param norm: Defines how the traces are normalized,
either against each trace or against the global
maximum. Default is ``trace``
:type offset_min: Scalar or None, optional
:param offset_min: Minimum offset in Meters to plot.
Default is minimum offset.
:type offset_max: Scalar or None, optional
:param offset_min: Maximum offset in Meters to plot.
Default is maximum offset.
:type azim_dist: bool, optional
:param azim_dist: Plot in azimuthal distance from event.
:type ev_lat: float or None, optional
:param ev_lat: Events' latitude in degree.
:type ev_lon: float or None, optional
:param ev_lon: Events' longitude in degree.
:type plot_dx: Integer, optional
:param plot_dx: Spacing of ticks on the spatial x-axis.
Either km or degree, depending on ``azim_dist``
:type recordstart: Integer, optional
:param recordstart: Seconds to crop from the beginning.
:type recordlength: Integer, optional
:param recordlength: Length of the record section in seconds.
:type alpha: Float < 1.0, optional
:param alpha: Transparancy of the traces between 0.0 - 1.0.
:type time_down: Bool, optional
:param time_down: Flip the plot horizontaly, time goes down.
Default is time goes up.
```

Tested on Ubuntu 12.04. with numPy 1.7.1, SciPy 0.12.0, Matplotlib 1.1.1rc.

Added two new tests to ```test_waveform.py```, all passed.

Ran 14 tests in 26.488s
OK

Thankful for comments and tips since this is my first commit.

cheers, Marius

---------------------------------------------------------