hyperdd 0.2.0__tar.gz → 0.2.1.dev1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {hyperdd-0.2.0 → hyperdd-0.2.1.dev1}/PKG-INFO +1 -1
- {hyperdd-0.2.0 → hyperdd-0.2.1.dev1}/hyperdd/io/inputs.py +2 -2
- {hyperdd-0.2.0 → hyperdd-0.2.1.dev1}/hyperdd.egg-info/PKG-INFO +1 -1
- {hyperdd-0.2.0 → hyperdd-0.2.1.dev1}/pyproject.toml +1 -1
- {hyperdd-0.2.0 → hyperdd-0.2.1.dev1}/tests/test_inputs.py +12 -0
- {hyperdd-0.2.0 → hyperdd-0.2.1.dev1}/LICENSE +0 -0
- {hyperdd-0.2.0 → hyperdd-0.2.1.dev1}/README.md +0 -0
- {hyperdd-0.2.0 → hyperdd-0.2.1.dev1}/hyperdd/__init__.py +0 -0
- {hyperdd-0.2.0 → hyperdd-0.2.1.dev1}/hyperdd/config.py +0 -0
- {hyperdd-0.2.0 → hyperdd-0.2.1.dev1}/hyperdd/core/__init__.py +0 -0
- {hyperdd-0.2.0 → hyperdd-0.2.1.dev1}/hyperdd/core/cluster.py +0 -0
- {hyperdd-0.2.0 → hyperdd-0.2.1.dev1}/hyperdd/core/datatypes.py +0 -0
- {hyperdd-0.2.0 → hyperdd-0.2.1.dev1}/hyperdd/core/dtres.py +0 -0
- {hyperdd-0.2.0 → hyperdd-0.2.1.dev1}/hyperdd/core/jacobian.py +0 -0
- {hyperdd-0.2.0 → hyperdd-0.2.1.dev1}/hyperdd/core/kernels.py +0 -0
- {hyperdd-0.2.0 → hyperdd-0.2.1.dev1}/hyperdd/core/partials_obs.py +0 -0
- {hyperdd-0.2.0 → hyperdd-0.2.1.dev1}/hyperdd/core/partition.py +0 -0
- {hyperdd-0.2.0 → hyperdd-0.2.1.dev1}/hyperdd/core/skip.py +0 -0
- {hyperdd-0.2.0 → hyperdd-0.2.1.dev1}/hyperdd/core/weighting.py +0 -0
- {hyperdd-0.2.0 → hyperdd-0.2.1.dev1}/hyperdd/geodesy/__init__.py +0 -0
- {hyperdd-0.2.0 → hyperdd-0.2.1.dev1}/hyperdd/geodesy/coordinates.py +0 -0
- {hyperdd-0.2.0 → hyperdd-0.2.1.dev1}/hyperdd/geodesy/delaz_vec.py +0 -0
- {hyperdd-0.2.0 → hyperdd-0.2.1.dev1}/hyperdd/hypoDD.py +0 -0
- {hyperdd-0.2.0 → hyperdd-0.2.1.dev1}/hyperdd/io/__init__.py +0 -0
- {hyperdd-0.2.0 → hyperdd-0.2.1.dev1}/hyperdd/io/ph2dt.py +0 -0
- {hyperdd-0.2.0 → hyperdd-0.2.1.dev1}/hyperdd/io/readers.py +0 -0
- {hyperdd-0.2.0 → hyperdd-0.2.1.dev1}/hyperdd/io/readers_csv.py +0 -0
- {hyperdd-0.2.0 → hyperdd-0.2.1.dev1}/hyperdd/io/writers.py +0 -0
- {hyperdd-0.2.0 → hyperdd-0.2.1.dev1}/hyperdd/metrics.py +0 -0
- {hyperdd-0.2.0 → hyperdd-0.2.1.dev1}/hyperdd/models/__init__.py +0 -0
- {hyperdd-0.2.0 → hyperdd-0.2.1.dev1}/hyperdd/models/eikonal.py +0 -0
- {hyperdd-0.2.0 → hyperdd-0.2.1.dev1}/hyperdd/models/velocity.py +0 -0
- {hyperdd-0.2.0 → hyperdd-0.2.1.dev1}/hyperdd/models/velocity_numba.py +0 -0
- {hyperdd-0.2.0 → hyperdd-0.2.1.dev1}/hyperdd/parallel/__init__.py +0 -0
- {hyperdd-0.2.0 → hyperdd-0.2.1.dev1}/hyperdd/parallel/blocks.py +0 -0
- {hyperdd-0.2.0 → hyperdd-0.2.1.dev1}/hyperdd/parallel/cli.py +0 -0
- {hyperdd-0.2.0 → hyperdd-0.2.1.dev1}/hyperdd/parallel/graph.py +0 -0
- {hyperdd-0.2.0 → hyperdd-0.2.1.dev1}/hyperdd/parallel/pairing.py +0 -0
- {hyperdd-0.2.0 → hyperdd-0.2.1.dev1}/hyperdd/solvers/__init__.py +0 -0
- {hyperdd-0.2.0 → hyperdd-0.2.1.dev1}/hyperdd/solvers/_cholmod.py +0 -0
- {hyperdd-0.2.0 → hyperdd-0.2.1.dev1}/hyperdd/solvers/covariance.py +0 -0
- {hyperdd-0.2.0 → hyperdd-0.2.1.dev1}/hyperdd/solvers/lsqr.py +0 -0
- {hyperdd-0.2.0 → hyperdd-0.2.1.dev1}/hyperdd/solvers/schur.py +0 -0
- {hyperdd-0.2.0 → hyperdd-0.2.1.dev1}/hyperdd/solvers/sparse_chol.py +0 -0
- {hyperdd-0.2.0 → hyperdd-0.2.1.dev1}/hyperdd/solvers/stats.py +0 -0
- {hyperdd-0.2.0 → hyperdd-0.2.1.dev1}/hyperdd/solvers/svd.py +0 -0
- {hyperdd-0.2.0 → hyperdd-0.2.1.dev1}/hyperdd.egg-info/SOURCES.txt +0 -0
- {hyperdd-0.2.0 → hyperdd-0.2.1.dev1}/hyperdd.egg-info/dependency_links.txt +0 -0
- {hyperdd-0.2.0 → hyperdd-0.2.1.dev1}/hyperdd.egg-info/entry_points.txt +0 -0
- {hyperdd-0.2.0 → hyperdd-0.2.1.dev1}/hyperdd.egg-info/requires.txt +0 -0
- {hyperdd-0.2.0 → hyperdd-0.2.1.dev1}/hyperdd.egg-info/top_level.txt +0 -0
- {hyperdd-0.2.0 → hyperdd-0.2.1.dev1}/setup.cfg +0 -0
- {hyperdd-0.2.0 → hyperdd-0.2.1.dev1}/tests/test_covariance.py +0 -0
- {hyperdd-0.2.0 → hyperdd-0.2.1.dev1}/tests/test_eikonal.py +0 -0
- {hyperdd-0.2.0 → hyperdd-0.2.1.dev1}/tests/test_native_vs_fortran.py +0 -0
- {hyperdd-0.2.0 → hyperdd-0.2.1.dev1}/tests/test_solvers.py +0 -0
|
@@ -133,9 +133,9 @@ def write_hypodd_inputs(run_dir, events, stations, dt, velocity, damp, iter_sets
|
|
|
133
133
|
for s in iter_sets:
|
|
134
134
|
f.write(" " + " ".join(str(x) for x in tuple(s) + ((damp,) if len(s) == 9 else ())) + "\n")
|
|
135
135
|
if np.ndim(vpvs) == 0: # IMOD 0: one Vp/Vs
|
|
136
|
-
f.write(f"0\n{len(tops)} {vpvs}\n" + " ".join(f"{x:.
|
|
136
|
+
f.write(f"0\n{len(tops)} {vpvs}\n" + " ".join(f"{x:.4f}" for x in tops) + "\n" + " ".join(f"{x:.4f}" for x in vp) + "\n")
|
|
137
137
|
else: # IMOD 1: tops, velocities and Vp/Vs per layer, each line closed by -9
|
|
138
|
-
f.write("1\n" + " ".join(f"{x:.
|
|
138
|
+
f.write("1\n" + " ".join(f"{x:.4f}" for x in tops) + " -9\n" + " ".join(f"{x:.4f}" for x in vp) + " -9\n" + " ".join(f"{x:.4f}" for x in vpvs) + " -9\n")
|
|
139
139
|
f.write(" 0\n") # CID 0: all clusters
|
|
140
140
|
|
|
141
141
|
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "hyperdd"
|
|
7
|
-
version = "0.2.
|
|
7
|
+
version = "0.2.1.dev1"
|
|
8
8
|
description = "Scalable double-difference earthquake relocation with sparse graph optimization"
|
|
9
9
|
requires-python = ">=3.10"
|
|
10
10
|
license = {text = "MIT"}
|
|
@@ -30,3 +30,15 @@ def test_memory_matches_files(tmp_path):
|
|
|
30
30
|
_same(D["stations"], read_stations(tmp_path / "station.sel", imod=0))
|
|
31
31
|
_same(D["ct"], read_ct(tmp_path / "dt.ct"))
|
|
32
32
|
_same(D["cc"], read_cc(tmp_path / "dt.cc"))
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
def test_model_survives_the_control_file(tmp_path):
|
|
36
|
+
"""A model off the 0.1 km and 0.01 km/s grid (a ramp) is read back from hypoDD.inp as it was given."""
|
|
37
|
+
from hyperdd.config import parse_inp
|
|
38
|
+
ev = pd.DataFrame(dict(event_id=[1, 2], time=pd.Timestamp("2020-01-02"), latitude=[35.0, 35.01], longitude=[-117.0, -117.01], depth_km=[5.0, 6.0]))
|
|
39
|
+
st = pd.DataFrame(dict(station=["S1"], latitude=[35.1], longitude=[-117.1], elevation_m=[0.0]))
|
|
40
|
+
dt = pd.DataFrame(dict(id1=[1], id2=[2], station=["S1"], tt1=[2.0], tt2=[2.1], weight=[1.0], phase=["P"]))
|
|
41
|
+
top, vp = np.array([0.0, 4.75, 5.001, 5.25]), np.array([5.5, 5.5196, 5.7764, 6.3])
|
|
42
|
+
write_hypodd_inputs(tmp_path, ev, st, dt, (top, vp, 1.73), -0.1)
|
|
43
|
+
cfg = parse_inp(tmp_path / "hypoDD.inp")
|
|
44
|
+
assert np.allclose(cfg.vel_model.top, top, atol=1e-4) and np.allclose(cfg.vel_model.v, vp, atol=1e-4)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|