#!/usr/bin/env python

import sys

import numpy as np


def wplot(w):
    """Plots seismic waveform"""

    import pylab

    pylab.figure(figsize=(7.5, 3))
    line = pylab.plot(w[:, 0], w[:, 1])

    pylab.setp(line, color='k', linestyle='-')
    pylab.setp(line, color='k', linestyle='', marker='.', markersize=0.5)
    pylab.axis('tight')
    pylab.title(file)

    pylab.show()



if __name__ == '__main__':
    """ Plots record section read from SU or SEGY file
    """

    for filename in sys.argv[1:]:

        w = np.loadtxt(filename)

        print ''
        print filename
        print 'min, max:', w[:, 1].min(), w[:, 1].max()
        print ''

        # plot waveform
        wplot(w)

