示例#1
0
 def make_map(self, filename):
     logger.info('Plotting scenario\'s map...')
     if not gmtpy.have_gmt():
         logger.warning('Cannot plot map, GMT is not installed.')
     try:
         draw_scenario_gmt(self, filename)
     except gmtpy.GMTError:
         logger.warning('GMT threw an error, could not plot map.')
     except topo.AuthenticationRequired:
         logger.warning('Cannot download topography data (authentication '
                        'required). Could not plot map.')
示例#2
0
 def make_map(self, filename):
     logger.info('Plotting scenario\'s map...')
     if not gmtpy.have_gmt():
         logger.warning('Cannot plot map, GMT is not installed.')
     try:
         draw_scenario_gmt(self, filename)
     except gmtpy.GMTError:
         logger.warning('GMT threw an error, could not plot map.')
     except topo.AuthenticationRequired:
         logger.warning('Cannot download topography data (authentication '
                        'required). Could not plot map.')
示例#3
0
    def make_map(self, filename):
        logger.info('Plotting scenario\'s map...')
        if not gmtpy.have_gmt():
            logger.warning('Cannot plot map, GMT is not installed.')
            return
        if self.radius is None or self.radius > 5000 * km:
            logger.info('Drawing map for scenarios with a radius > 5000 km is '
                        'not implemented.')
            return

        try:
            draw_scenario_gmt(self, filename)
        except gmtpy.GMTError:
            logger.warning('GMT threw an error, could not plot map.')
        except topo.AuthenticationRequired:
            logger.warning('Cannot download topography data (authentication '
                           'required). Could not plot map.')
示例#4
0
import shutil
import unittest
import numpy as num
from numpy.testing import assert_allclose
from matplotlib import image, pyplot as plt

from pyrocko import util
from pyrocko.plot import gmtpy
from pyrocko.plot.gmtpy import cm, inch, golden_ratio

from .. import common

plot = False


@unittest.skipUnless(gmtpy.have_gmt(), 'GMT not available')
@unittest.skipUnless(gmtpy.have_pixmaptools(),
                     '`pdftocairo` or `convert` not available')
class GmtPyTestCase(unittest.TestCase):
    def setUp(self):
        self.tempdir = tempfile.mkdtemp()

    def tearDown(self):
        shutil.rmtree(self.tempdir)

    def fpath(self, fn):
        return os.path.join(self.tempdir, fn)

    def fpath_ref(self, fn):
        try:
            return common.test_data_file(fn)
import shutil
import unittest
import numpy as num
from matplotlib import image, pyplot as plt

from pyrocko import util
from pyrocko.plot import automap, gmtpy

from . import common

noshow = False
km = 1000.


@unittest.skipUnless(
    gmtpy.have_gmt(), 'GMT not available')
@unittest.skipUnless(
    gmtpy.have_pixmaptools(), '`pdftocairo` or `convert` not available')
class AutomapTestCase(unittest.TestCase):

    def setUp(self):
        self.tempdir = tempfile.mkdtemp()

    def tearDown(self):
        shutil.rmtree(self.tempdir)

    def fpath(self, fn):
        return os.path.join(self.tempdir, fn)

    def fpath_ref(self, fn):
        try:
示例#6
0
import unittest
import numpy as num
from numpy.testing import assert_allclose
from matplotlib import image, pyplot as plt

from pyrocko import util
from pyrocko.plot import gmtpy
from pyrocko.plot.gmtpy import cm, inch, golden_ratio

from . import common

plot = False


@unittest.skipUnless(
    gmtpy.have_gmt(), 'GMT not available')
@unittest.skipUnless(
    gmtpy.have_pixmaptools(), '`pdftocairo` or `convert` not available')
class GmtPyTestCase(unittest.TestCase):

    def setUp(self):
        self.tempdir = tempfile.mkdtemp()

    def tearDown(self):
        shutil.rmtree(self.tempdir)

    def fpath(self, fn):
        return os.path.join(self.tempdir, fn)

    def fpath_ref(self, fn):
        try: