/[escript]/trunk/downunder/test/python/run_seismic.py
ViewVC logotype

Diff of /trunk/downunder/test/python/run_seismic.py

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

revision 5287 by caltinay, Mon Jun 23 22:22:44 2014 UTC revision 5288 by sshaw, Tue Dec 2 23:18:40 2014 UTC
# Line 1  Line 1 
1    from __future__ import print_function
2  ##############################################################################  ##############################################################################
3  #  #
4  # Copyright (c) 2003-2014 by University of Queensland  # Copyright (c) 2003-2014 by University of Queensland
# Line 36  from esys.weipa import saveSilo Line 36  from esys.weipa import saveSilo
36  logging.basicConfig(format='%(name)s: %(message)s', level=logging.INFO)  logging.basicConfig(format='%(name)s: %(message)s', level=logging.INFO)
37    
38  try:  try:
39        from esys.ripley import Rectangle, Brick as rRect, rBrick
40        HAVE_RIPLEY = True
41    except ImportError:
42        HAVE_RIPLEY = False
43    
44    try:
45        from esys.finley import Rectangle, Brick as fRect, fBrick
46        HAVE_FINLEY = True
47    except ImportError:
48        HAVE_FINLEY = False
49    
50    
51    
52    try:
53      TEST_DATA_ROOT=os.environ['DOWNUNDER_TEST_DATA_ROOT']      TEST_DATA_ROOT=os.environ['DOWNUNDER_TEST_DATA_ROOT']
54  except KeyError:  except KeyError:
55      TEST_DATA_ROOT='ref_data'      TEST_DATA_ROOT='ref_data'
# Line 45  try: Line 59  try:
59  except KeyError:  except KeyError:
60      WORKDIR='.'      WORKDIR='.'
61            
62  writeFailMessage = "This feature (SimpleSEGYWriter.write()) depends on obspy, which is not installed, see https://github.com/obspy/obspy for install guide"  writeFailMessage = "This feature (SimpleSEGYWriter.write()) depends on obspy,"+\
63    " which is not installed, see https://github.com/obspy/obspy for install guide"
64    
65    
66  class TestSeismicTools(unittest.TestCase):  class TestSeismicTools(unittest.TestCase):
# Line 115  class TestSeismicTools(unittest.TestCase Line 130  class TestSeismicTools(unittest.TestCase
130                      "functionspace != solution for %s"%label)                      "functionspace != solution for %s"%label)
131    
132      def test_sonicwave2D(self):      def test_sonicwave2D(self):
133          from esys.finley import Rectangle as fRect          doms = []
134          from esys.ripley import Rectangle as rRect          if HAVE_RIPLEY:
135          for domType, impl in [(fRect, "finley"), (rRect, "ripley")]:              doms.append((rRect, "ripley"))
136            if HAVE_FINLEY:
137                doms.append((fRect, "finley"))
138            for domType, impl in doms:
139              domain=domType(5,5, diracPoints=[(0.5,1.)], diracTags=['sss'])              domain=domType(5,5, diracPoints=[(0.5,1.)], diracTags=['sss'])
140              self.sonicRunner(domain, "%s.Rectangle"%impl)              self.sonicRunner(domain, "%s.Rectangle"%impl)
141    
142      def test_sonicwave3D(self):      def test_sonicwave3D(self):
143          from esys.finley import Brick as fBrick          doms = []
144          from esys.ripley import Brick as rBrick          if HAVE_RIPLEY:
145          for domType, impl in [(fBrick, "finley"), (rBrick, "ripley")]:              doms.append((rBrick, "ripley"))
146            if HAVE_FINLEY:
147                doms.append((fBrick, "finley"))
148            for domType, impl in doms:
149              domain=domType(5,5,5, diracPoints=[(0.5,0.5,1.)], diracTags=['sss'])              domain=domType(5,5,5, diracPoints=[(0.5,0.5,1.)], diracTags=['sss'])
150              self.sonicRunner(domain, "%s.Brick"%impl)              self.sonicRunner(domain, "%s.Brick"%impl)
151                                                                        

Legend:
Removed from v.5287  
changed lines
  Added in v.5288

  ViewVC Help
Powered by ViewVC 1.1.26