Ejemplo n.º 1
0
from tempfile import mkdtemp
from .common import Benchmark
from pyrocko import gf, util, cake
from pyrocko.fomosto import qseis, psgrn_pscmp

random = num.random
logger = logging.getLogger('pyrocko.test.test_gf_static')
benchmark = Benchmark()

r2d = 180. / math.pi
d2r = 1.0 / r2d
km = 1000.


@unittest.skipUnless(qseis.have_backend(), 'backend qseis not available')
@unittest.skipUnless(psgrn_pscmp.have_backend(),
                     'backend psgrn_pscmp not available')
class GFStaticTest(unittest.TestCase):
    tempdirs = []

    def __init__(self, *args, **kwargs):
        self._dummy_store = None
        self.qseis_store_dir = None
        self.pscmp_store_dir = None
        unittest.TestCase.__init__(self, *args, **kwargs)

    @classmethod
    def tearDownClass(cls):
        for d in cls.tempdirs:
            shutil.rmtree(d)
            north_shift=north,
            east_shift=east,
            depth=starget.depth)

        values = store.statics(
            dsource, receiver, starget.components,
            interpolation=starget.interpolation)

        for icomponent, value in enumerate(values):
            out[i, icomponent] = value * sfactor

    return out


@unittest.skipUnless(
    psgrn_pscmp.have_backend(), 'backend psgrn_pscmp not available')
class GFPsgrnPscmpTestCase(unittest.TestCase):

    tempdirs = []

    def __init__(self, *args, **kwargs):
        unittest.TestCase.__init__(self, *args, **kwargs)

    @classmethod
    def tearDownClass(cls):
        for d in cls.tempdirs:
            shutil.rmtree(d)

    def test_fomosto_vs_psgrn_pscmp(self):

        mod = cake.LayeredModel.from_scanlines(cake.read_nd_model_str('''
Ejemplo n.º 3
0
from pyrocko.fomosto import qseis, psgrn_pscmp


random = num.random
logger = logging.getLogger('pyrocko.test.test_gf_static')
benchmark = Benchmark()

r2d = 180. / math.pi
d2r = 1.0 / r2d
km = 1000.


@unittest.skipUnless(
    qseis.have_backend(), 'backend qseis not available')
@unittest.skipUnless(
    psgrn_pscmp.have_backend(), 'backend psgrn_pscmp not available')
class GFStaticTest(unittest.TestCase):
    tempdirs = []

    def __init__(self, *args, **kwargs):
        self._dummy_store = None
        self.qseis_store_dir = None
        self.pscmp_store_dir = None
        unittest.TestCase.__init__(self, *args, **kwargs)

    @classmethod
    def tearDownClass(cls):
        for d in cls.tempdirs:
            shutil.rmtree(d)

    def get_qseis_store_dir(self):