From bf7ede6e420f84be5b55ff0490069d3e5d8c7599 Mon Sep 17 00:00:00 2001 From: g-weatherill Date: Mon, 4 Oct 2021 14:47:49 +0200 Subject: [PATCH] Small edit to adapt to OQ changes, fixes broken quakeml test --- shakyground2/shakemap.py | 14 ++++++++------ tests/earthquake_test.py | 2 +- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/shakyground2/shakemap.py b/shakyground2/shakemap.py index d8f5cb1..9f999fa 100644 --- a/shakyground2/shakemap.py +++ b/shakyground2/shakemap.py @@ -124,7 +124,9 @@ class Shakemap(object): ground motion models """ cmaker = ContextMaker( - self.tectonic_region, [gmm[1] for gmm in self.ground_motion_model] + self.tectonic_region, + [gmm[1] for gmm in self.ground_motion_model], + param={"imtls": {"PGA": []}}, # param is a dummy object to mock an OQ config ) # Always calculate rupture distance regardless of whether it is needed by the GMM if "rrup" not in cmaker.REQUIRES_DISTANCES: # pylint: disable=no-member @@ -372,12 +374,12 @@ class Shakemap(object): "crs": "+proj=latlong", # As we create a lot of those geotiff files in the earthquake event explorer # and want to store them on a map server, we want to make sure that the resulting - # geotiffs are small. - # That is why the we want to use a compression algorithm with some more custom options. - # The deflate algorithm is a loss less algorithm that is also used for the zip format. - # It features level and predictor arguments. + # geotiffs are small. That is why the we want to use a compression algorithm with + # some more custom options. The deflate algorithm is a loss less algorithm that is + # also used for the zip format. It features level and predictor arguments. # The chosen level is the maximum of 9, so that our files are small. - # The predictor is 3 to work better with floating point numbers (which the shakemaps are). + # The predictor is 3 to work better with floating point numbers (which the + # shakemaps are). "compress": "deflate", "zlevel": 9, "predictor": 3, diff --git a/tests/earthquake_test.py b/tests/earthquake_test.py index c7be905..13de260 100644 --- a/tests/earthquake_test.py +++ b/tests/earthquake_test.py @@ -215,7 +215,7 @@ class EarthquakeTestCase(unittest.TestCase): target_string_set = [ "gfz2021kdvq 2021-05-25 09:41:17.200000 (29.35200E, -1.74600N, 10.00 km) M 4.39", "gfz2021keus 2021-05-25 22:21:36.400000 (122.49800E, 24.83200N, 10.00 km) M 4.56", - "gfz2021kduj 2021-05-25 09:03:03.393825 (29.48394E, -1.78596N, 10.00 km) M 4.59", + "gfz2021kduj 2021-05-25 09:03:03.390000 (29.48400E, -1.78600N, 10.00 km) M 4.59", ] results = [] for event_id in event_id_set: -- GitLab