/[escript]/trunk/downunder/py_src/seismic.py
ViewVC logotype

Diff of /trunk/downunder/py_src/seismic.py

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 4598 by sshaw, Mon Dec 9 23:35:30 2013 UTC revision 4599 by sshaw, Sun Dec 15 23:51:13 2013 UTC
# Line 99  class SimpleSEGYWriter(object): Line 99  class SimpleSEGYWriter(object):
99                  sw.addRecord([i*2., i*0.67, i**2, -i*7])                  sw.addRecord([i*2., i*0.67, i**2, -i*7])
100             sw.write('example.segy')             sw.write('example.segy')
101    
102          :note: the writer uses `obsy`          :note: the writer uses `obspy`
103          """          """
104          COORDINATE_SCALE = 1000.          COORDINATE_SCALE = 1000.
105          def __init__(self, receiver_group=None, source=0., sampling_interval=4*U.msec, text="some seimic data"):          def __init__(self, receiver_group=None, source=0., sampling_interval=4*U.msec, text="some seimic data"):
# Line 181  class SimpleSEGYWriter(object): Line 181  class SimpleSEGYWriter(object):
181              :param filename: file name              :param filename: file name
182              :note: the function uses the `obspy` module.              :note: the function uses the `obspy` module.
183              """              """
184              from obspy import Trace, Stream, UTCDateTime              try:
185              from obspy.segy.segy import SEGYTraceHeader, SEGYBinaryFileHeader                  from obspy import Trace, Stream, UTCDateTime
186              from obspy.core import AttribDict                  from obspy.segy.segy import SEGYTraceHeader, SEGYBinaryFileHeader
187                    from obspy.core import AttribDict
188                except ImportError as e:
189                    raise RuntimeError("This feature (SimpleSEGYWriter.write())"+\
190                            " depends on obspy, which is not installed, see "+\
191                            "https://github.com/obspy/obspy for install guide")
192    
193              stream=Stream()              stream=Stream()
194                            

Legend:
Removed from v.4598  
changed lines
  Added in v.4599

  ViewVC Help
Powered by ViewVC 1.1.26