Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
CB-quakemodel committed Jul 5, 2024
1 parent 73d227c commit 51fd29f
Show file tree
Hide file tree
Showing 21 changed files with 38 additions and 39 deletions.
2 changes: 1 addition & 1 deletion openquake/smt/demos/demo_residuals_script.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
ESMFlatfileParserURL
from openquake.smt.residuals import gmpe_residuals as res
from openquake.smt.residuals import residual_plotter as rspl
from openquake.smt.database_visualiser import db_magnitude_distance
from openquake.smt.residuals.sm_database_visualiser import db_magnitude_distance

import warnings
warnings.filterwarnings("ignore")
Expand Down
2 changes: 1 addition & 1 deletion openquake/smt/residuals/gmpe_residuals.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
from openquake.hazardlib.gsim import get_available_gsims
from openquake.hazardlib import imt
import openquake.smt.intensity_measures as ims
from openquake.smt.strong_motion_selector import SMRecordSelector
from openquake.smt.residuals.sm_selector import SMRecordSelector
from openquake.smt.sm_utils import convert_accel_units, check_gsim_list

GSIM_LIST = get_available_gsims()
Expand Down
2 changes: 1 addition & 1 deletion openquake/smt/residuals/parsers/asa_database_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
from datetime import datetime
from math import sqrt
from openquake.hazardlib.geo import *
from openquake.smt.sm_database import *
from openquake.smt.residuals.sm_database import *
from openquake.smt.sm_utils import convert_accel_units, get_time_vector
from openquake.smt.residuals.parsers.base_database_parser import (
get_float, get_int, SMDatabaseReader, SMTimeSeriesReader)
Expand Down
2 changes: 1 addition & 1 deletion openquake/smt/residuals/parsers/esm_database_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
from copy import copy

from openquake.smt.sm_utils import convert_accel_units, get_time_vector
from openquake.smt.sm_database import *
from openquake.smt.residuals.sm_database import *
from openquake.smt.residuals.parsers.base_database_parser import (
SMDatabaseReader, SMTimeSeriesReader, SMSpectraReader)

Expand Down
6 changes: 3 additions & 3 deletions openquake/smt/residuals/parsers/esm_flatfile_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@
from linecache import getline
from collections import OrderedDict

from openquake.smt.sm_database import (GroundMotionDatabase, GroundMotionRecord,
Earthquake, Magnitude, Rupture, FocalMechanism, GCMTNodalPlanes,
Component, RecordSite, RecordDistance)
from openquake.smt.residuals.sm_database import (
GroundMotionDatabase, GroundMotionRecord, Earthquake, Magnitude, Rupture,
FocalMechanism, GCMTNodalPlanes, Component, RecordSite, RecordDistance)
from openquake.smt.sm_utils import (MECHANISM_TYPE, DIP_TYPE, vs30_to_z1pt0_cy14,
vs30_to_z2pt5_cb14)
from openquake.smt.residuals.parsers import valid
Expand Down
6 changes: 3 additions & 3 deletions openquake/smt/residuals/parsers/esm_url_flatfile_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@
from linecache import getline
from collections import OrderedDict

from openquake.smt.sm_database import (GroundMotionDatabase, GroundMotionRecord,
Earthquake, Magnitude, Rupture, FocalMechanism, GCMTNodalPlanes,
Component, RecordSite, RecordDistance)
from openquake.smt.residuals.sm_database import (
GroundMotionDatabase, GroundMotionRecord, Earthquake, Magnitude, Rupture,
FocalMechanism, GCMTNodalPlanes, Component, RecordSite, RecordDistance)
from openquake.smt.sm_utils import (
MECHANISM_TYPE, DIP_TYPE, vs30_to_z1pt0_cy14, vs30_to_z2pt5_cb14)
from openquake.smt.residuals.parsers import valid
Expand Down
10 changes: 5 additions & 5 deletions openquake/smt/residuals/parsers/esm_ws_flatfile_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@
from linecache import getline
from collections import OrderedDict

from openquake.smt.sm_database import (GroundMotionDatabase, GroundMotionRecord,
Earthquake, Magnitude, Rupture, FocalMechanism, GCMTNodalPlanes,
Component, RecordSite, RecordDistance)
from openquake.smt.sm_utils import (MECHANISM_TYPE, DIP_TYPE,
vs30_to_z1pt0_cy14, vs30_to_z2pt5_cb14)
from openquake.smt.residuals.sm_database import (
GroundMotionDatabase, GroundMotionRecord, Earthquake, Magnitude, Rupture,
FocalMechanism, GCMTNodalPlanes, Component, RecordSite, RecordDistance)
from openquake.smt.sm_utils import (
MECHANISM_TYPE, DIP_TYPE, vs30_to_z1pt0_cy14, vs30_to_z2pt5_cb14)
from openquake.smt.residuals.parsers import valid
from openquake.smt.residuals.parsers.base_database_parser import SMDatabaseReader

Expand Down
11 changes: 5 additions & 6 deletions openquake/smt/residuals/parsers/gem_flatfile_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,11 @@
from linecache import getline
from collections import OrderedDict

from openquake.smt.sm_database import (GroundMotionDatabase, GroundMotionRecord,
Earthquake, Magnitude, Rupture,
FocalMechanism, GCMTNodalPlanes,
Component, RecordSite, RecordDistance)
from openquake.smt.sm_utils import (MECHANISM_TYPE, DIP_TYPE, vs30_to_z1pt0_cy14,
vs30_to_z2pt5_cb14)
from openquake.smt.residuals.sm_database import (
GroundMotionDatabase, GroundMotionRecord, Earthquake, Magnitude, Rupture,
FocalMechanism, GCMTNodalPlanes, Component, RecordSite, RecordDistance)
from openquake.smt.sm_utils import (
MECHANISM_TYPE, DIP_TYPE, vs30_to_z1pt0_cy14, vs30_to_z2pt5_cb14)
from openquake.smt.residuals.parsers import valid
from openquake.smt.residuals.parsers.base_database_parser import SMDatabaseReader

Expand Down
10 changes: 5 additions & 5 deletions openquake/smt/residuals/parsers/ngawest2_flatfile_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@
from linecache import getline
from collections import OrderedDict

from openquake.smt.sm_database import (GroundMotionDatabase, GroundMotionRecord,
Earthquake, Magnitude, Rupture, FocalMechanism, GCMTNodalPlanes,
Component, RecordSite, RecordDistance)
from openquake.smt.sm_utils import (MECHANISM_TYPE, DIP_TYPE,
vs30_to_z1pt0_cy14, vs30_to_z2pt5_cb14)
from openquake.smt.residuals.sm_database import (
GroundMotionDatabase, GroundMotionRecord, Earthquake, Magnitude, Rupture,
FocalMechanism, GCMTNodalPlanes, Component, RecordSite, RecordDistance)
from openquake.smt.sm_utils import (
MECHANISM_TYPE, DIP_TYPE, vs30_to_z1pt0_cy14, vs30_to_z2pt5_cb14)
from openquake.smt.residuals.parsers.base_database_parser import \
SMDatabaseReader
from openquake.smt.residuals.parsers import valid
Expand Down
2 changes: 1 addition & 1 deletion openquake/smt/residuals/parsers/sigma_database_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
import numpy as np
from collections import OrderedDict
from datetime import datetime
from openquake.smt.sm_database import *
from openquake.smt.residuals.sm_database import *
from openquake.smt.residuals.parsers.base_database_parser import (
get_float, get_int, SMDatabaseReader, SMTimeSeriesReader, SMSpectraReader)

Expand Down
2 changes: 1 addition & 1 deletion openquake/smt/residuals/parsers/simple_flatfile_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
from openquake.hazardlib.scalerel.wc1994 import WC1994
from openquake.hazardlib.geo.mesh import Mesh
from openquake.hazardlib.geo.point import Point
from openquake.smt.sm_database import *
from openquake.smt.residuals.sm_database import *
from openquake.smt.sm_utils import (convert_accel_units, create_planar_surface,
get_hypocentre_on_planar_surface, z1pt0_to_z2pt5, vs30_to_z1pt0_as08)
from openquake.smt.residua.sparsers.base_database_parser import (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
from openquake.hazardlib.geo.point import Point
from openquake.hazardlib.geo.line import Line
from openquake.hazardlib.geo.surface.simple_fault import SimpleFaultSurface
from openquake.smt.sm_database import *
from openquake.smt.residuals.sm_database import *
from openquake.smt.sm_utils import convert_accel_units, create_planar_surface,\
get_hypocentre_on_planar_surface, z1pt0_to_z2pt5, vs30_to_z1pt0_as08
from openquake.smt.residuals.parsers.base_database_parser import (
Expand Down
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion openquake/smt/database_visualiser.py → ...e/smt/residuals/sm_database_visualiser.py
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
import numpy as np
import matplotlib.pyplot as plt
from openquake.smt.sm_utils import _save_image
from openquake.smt.strong_motion_selector import SMRecordSelector
from openquake.smt.residuals.sm_selector import SMRecordSelector


DISTANCES = {
Expand Down
2 changes: 1 addition & 1 deletion openquake/smt/strong_motion_selector.py → openquake/smt/residuals/sm_selector.py
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
from openquake.hazardlib.geo.mesh import Mesh
from openquake.hazardlib.geo.point import Point
from openquake.hazardlib.geo.polygon import Polygon
from openquake.smt.sm_database import GroundMotionDatabase
from openquake.smt.residuals.sm_database import GroundMotionDatabase

def rank_sites_by_record_count(database, threshold=0):
"""
Expand Down
8 changes: 4 additions & 4 deletions openquake/smt/response_spectrum.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@
# You should have received a copy of the GNU Affero General Public License
# along with OpenQuake. If not, see <http://www.gnu.org/licenses/>.
"""
Simple Python Script to integrate a strong motion record using
the Newmark-Beta method
Simple Python Script to integrate a strong motion record using the
Newmark-Beta method
"""
import numpy as np
from math import sqrt

import matplotlib.pyplot as plt
from openquake.smt.sm_utils import (_save_image, get_time_vector, convert_accel_units,
get_velocity_displacement)
from openquake.smt.sm_utils import (
_save_image, get_time_vector, convert_accel_units, get_velocity_displacement)


class ResponseSpectrum(object):
Expand Down
2 changes: 1 addition & 1 deletion openquake/smt/tests/database_io_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
import json
import pprint
import unittest
from openquake.smt.sm_database import load_database
from openquake.smt.residuals.sm_database import load_database
from openquake.smt.residuals.parsers.esm_flatfile_parser import ESMFlatfileParser


Expand Down
2 changes: 1 addition & 1 deletion openquake/smt/tests/residuals/residual_plots_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

from openquake.smt.residuals.parsers.esm_flatfile_parser import ESMFlatfileParser
import openquake.smt.residuals.gmpe_residuals as res
from openquake.smt.database_visualiser import DISTANCES
from openquake.smt.residuals.sm_database_visualiser import DISTANCES
from openquake.smt.residuals.residual_plots import (
residuals_density_distribution, likelihood, residuals_with_depth,
residuals_with_magnitude, residuals_with_vs30, residuals_with_distance,
Expand Down
2 changes: 1 addition & 1 deletion openquake/smt/tests/residuals/residual_plotter_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
from openquake.smt.residuals.residual_plotter import (
ResidualPlot, LikelihoodPlot, ResidualWithMagnitude, ResidualWithDepth,
ResidualWithVs30, ResidualWithDistance)
from openquake.smt.database_visualiser import DISTANCES
from openquake.smt.residuals.sm_database_visualiser import DISTANCES


BASE_DATA_PATH = os.path.join(os.path.dirname(__file__), "data")
Expand Down
2 changes: 1 addition & 1 deletion openquake/smt/tests/residuals/residuals_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
ESMFlatfileParser
import openquake.smt.residuals.gmpe_residuals as res
import openquake.smt.residuals.residual_plotter as rspl
from openquake.smt.strong_motion_selector import rank_sites_by_record_count
from openquake.smt.residuals.sm_selector import rank_sites_by_record_count


BASE_DATA_PATH = os.path.join(os.path.dirname(__file__), "data")
Expand Down

0 comments on commit 51fd29f

Please sign in to comment.