From 324be13cf380c069607600a85f87c8d56006b37b Mon Sep 17 00:00:00 2001 From: <> Date: Sun, 18 Aug 2024 01:43:06 +0000 Subject: [PATCH] Deployed 6a40911 with MkDocs version: 1.6.0 --- .nojekyll | 0 404.html | 309 + app/index.html | 1251 +++ assets/2019-07-04T18-02-01.074.png | Bin 0 -> 405220 bytes assets/diagram_gamma_annotated.png | Bin 0 -> 224542 bytes assets/images/favicon.png | Bin 0 -> 1870 bytes assets/javascripts/bundle.fe8b6f2b.min.js | 29 + assets/javascripts/bundle.fe8b6f2b.min.js.map | 7 + assets/javascripts/lunr/min/lunr.ar.min.js | 1 + assets/javascripts/lunr/min/lunr.da.min.js | 18 + assets/javascripts/lunr/min/lunr.de.min.js | 18 + assets/javascripts/lunr/min/lunr.du.min.js | 18 + assets/javascripts/lunr/min/lunr.el.min.js | 1 + assets/javascripts/lunr/min/lunr.es.min.js | 18 + assets/javascripts/lunr/min/lunr.fi.min.js | 18 + assets/javascripts/lunr/min/lunr.fr.min.js | 18 + assets/javascripts/lunr/min/lunr.he.min.js | 1 + assets/javascripts/lunr/min/lunr.hi.min.js | 1 + assets/javascripts/lunr/min/lunr.hu.min.js | 18 + assets/javascripts/lunr/min/lunr.hy.min.js | 1 + assets/javascripts/lunr/min/lunr.it.min.js | 18 + assets/javascripts/lunr/min/lunr.ja.min.js | 1 + assets/javascripts/lunr/min/lunr.jp.min.js | 1 + assets/javascripts/lunr/min/lunr.kn.min.js | 1 + assets/javascripts/lunr/min/lunr.ko.min.js | 1 + assets/javascripts/lunr/min/lunr.multi.min.js | 1 + assets/javascripts/lunr/min/lunr.nl.min.js | 18 + assets/javascripts/lunr/min/lunr.no.min.js | 18 + assets/javascripts/lunr/min/lunr.pt.min.js | 18 + assets/javascripts/lunr/min/lunr.ro.min.js | 18 + assets/javascripts/lunr/min/lunr.ru.min.js | 18 + assets/javascripts/lunr/min/lunr.sa.min.js | 1 + .../lunr/min/lunr.stemmer.support.min.js | 1 + assets/javascripts/lunr/min/lunr.sv.min.js | 18 + assets/javascripts/lunr/min/lunr.ta.min.js | 1 + assets/javascripts/lunr/min/lunr.te.min.js | 1 + assets/javascripts/lunr/min/lunr.th.min.js | 1 + assets/javascripts/lunr/min/lunr.tr.min.js | 18 + assets/javascripts/lunr/min/lunr.vi.min.js | 1 + assets/javascripts/lunr/min/lunr.zh.min.js | 1 + assets/javascripts/lunr/tinyseg.js | 206 + assets/javascripts/lunr/wordcut.js | 6708 +++++++++++++++++ .../workers/search.b8dbb3d2.min.js | 42 + .../workers/search.b8dbb3d2.min.js.map | 7 + assets/result_eq05_err0.0_fp0.0_amp1.png | Bin 0 -> 293953 bytes assets/stylesheets/main.3cba04c6.min.css | 1 + assets/stylesheets/main.3cba04c6.min.css.map | 1 + assets/stylesheets/palette.06af60db.min.css | 1 + .../stylesheets/palette.06af60db.min.css.map | 1 + example_fastapi/index.html | 2702 +++++++ example_phasenet/index.html | 2185 ++++++ example_phasenet_ncedc/index.html | 3177 ++++++++ example_phasenet_ransac/index.html | 4474 +++++++++++ example_seisbench/index.html | 2568 +++++++ example_synthetic/index.html | 1516 ++++ index.html | 488 ++ sitemap.xml | 3 + sitemap.xml.gz | Bin 0 -> 127 bytes 58 files changed, 25963 insertions(+) create mode 100644 .nojekyll create mode 100644 404.html create mode 100644 app/index.html create mode 100644 assets/2019-07-04T18-02-01.074.png create mode 100644 assets/diagram_gamma_annotated.png create mode 100644 assets/images/favicon.png create mode 100644 assets/javascripts/bundle.fe8b6f2b.min.js create mode 100644 assets/javascripts/bundle.fe8b6f2b.min.js.map create mode 100644 assets/javascripts/lunr/min/lunr.ar.min.js create mode 100644 assets/javascripts/lunr/min/lunr.da.min.js create mode 100644 assets/javascripts/lunr/min/lunr.de.min.js create mode 100644 assets/javascripts/lunr/min/lunr.du.min.js create mode 100644 assets/javascripts/lunr/min/lunr.el.min.js create mode 100644 assets/javascripts/lunr/min/lunr.es.min.js create mode 100644 assets/javascripts/lunr/min/lunr.fi.min.js create mode 100644 assets/javascripts/lunr/min/lunr.fr.min.js create mode 100644 assets/javascripts/lunr/min/lunr.he.min.js create mode 100644 assets/javascripts/lunr/min/lunr.hi.min.js create mode 100644 assets/javascripts/lunr/min/lunr.hu.min.js create mode 100644 assets/javascripts/lunr/min/lunr.hy.min.js create mode 100644 assets/javascripts/lunr/min/lunr.it.min.js create mode 100644 assets/javascripts/lunr/min/lunr.ja.min.js create mode 100644 assets/javascripts/lunr/min/lunr.jp.min.js create mode 100644 assets/javascripts/lunr/min/lunr.kn.min.js create mode 100644 assets/javascripts/lunr/min/lunr.ko.min.js create mode 100644 assets/javascripts/lunr/min/lunr.multi.min.js create mode 100644 assets/javascripts/lunr/min/lunr.nl.min.js create mode 100644 assets/javascripts/lunr/min/lunr.no.min.js create mode 100644 assets/javascripts/lunr/min/lunr.pt.min.js create mode 100644 assets/javascripts/lunr/min/lunr.ro.min.js create mode 100644 assets/javascripts/lunr/min/lunr.ru.min.js create mode 100644 assets/javascripts/lunr/min/lunr.sa.min.js create mode 100644 assets/javascripts/lunr/min/lunr.stemmer.support.min.js create mode 100644 assets/javascripts/lunr/min/lunr.sv.min.js create mode 100644 assets/javascripts/lunr/min/lunr.ta.min.js create mode 100644 assets/javascripts/lunr/min/lunr.te.min.js create mode 100644 assets/javascripts/lunr/min/lunr.th.min.js create mode 100644 assets/javascripts/lunr/min/lunr.tr.min.js create mode 100644 assets/javascripts/lunr/min/lunr.vi.min.js create mode 100644 assets/javascripts/lunr/min/lunr.zh.min.js create mode 100644 assets/javascripts/lunr/tinyseg.js create mode 100644 assets/javascripts/lunr/wordcut.js create mode 100644 assets/javascripts/workers/search.b8dbb3d2.min.js create mode 100644 assets/javascripts/workers/search.b8dbb3d2.min.js.map create mode 100644 assets/result_eq05_err0.0_fp0.0_amp1.png create mode 100644 assets/stylesheets/main.3cba04c6.min.css create mode 100644 assets/stylesheets/main.3cba04c6.min.css.map create mode 100644 assets/stylesheets/palette.06af60db.min.css create mode 100644 assets/stylesheets/palette.06af60db.min.css.map create mode 100644 example_fastapi/index.html create mode 100644 example_phasenet/index.html create mode 100644 example_phasenet_ncedc/index.html create mode 100644 example_phasenet_ransac/index.html create mode 100644 example_seisbench/index.html create mode 100644 example_synthetic/index.html create mode 100644 index.html create mode 100644 sitemap.xml create mode 100644 sitemap.xml.gz diff --git a/.nojekyll b/.nojekyll new file mode 100644 index 0000000..e69de29 diff --git a/404.html b/404.html new file mode 100644 index 0000000..6fe8e31 --- /dev/null +++ b/404.html @@ -0,0 +1,309 @@ + + + +
+ + + + + + + + + + + + + + + + + + +import pandas as pd
+from fastapi import FastAPI
+from pyproj import Proj
+
from gamma.utils import association
+
app = FastAPI()
+
@app.get("/")
+def greet_json():
+ return {"message": "Hello, World!"}
+
@app.post("/predict/")
+def predict(picks: dict, stations: dict, config: dict):
+ picks = picks["data"]
+ stations = stations["data"]
+ picks = pd.DataFrame(picks)
+ picks["phase_time"] = pd.to_datetime(picks["phase_time"])
+ stations = pd.DataFrame(stations)
+ events_, picks_ = run_gamma(picks, stations, config)
+ picks_ = picks_.to_dict(orient="records")
+ events_ = events_.to_dict(orient="records")
+
+ return {"picks": picks_, "events": events_}
+
def set_config(region="ridgecrest"):
+
+ config = {
+ "min_picks": 8,
+ "min_picks_ratio": 0.2,
+ "max_residual_time": 1.0,
+ "max_residual_amplitude": 1.0,
+ "min_score": 0.6,
+ "min_s_picks": 2,
+ "min_p_picks": 2,
+ "use_amplitude": False,
+ }
+
+ # ## Domain
+ if region.lower() == "ridgecrest":
+ config.update(
+ {
+ "region": "ridgecrest",
+ "minlongitude": -118.004,
+ "maxlongitude": -117.004,
+ "minlatitude": 35.205,
+ "maxlatitude": 36.205,
+ "mindepth_km": 0.0,
+ "maxdepth_km": 30.0,
+ }
+ )
+
+ lon0 = (config["minlongitude"] + config["maxlongitude"]) / 2
+ lat0 = (config["minlatitude"] + config["maxlatitude"]) / 2
+ proj = Proj(f"+proj=sterea +lon_0={lon0} +lat_0={lat0} +units=km")
+ xmin, ymin = proj(config["minlongitude"], config["minlatitude"])
+ xmax, ymax = proj(config["maxlongitude"], config["maxlatitude"])
+ zmin, zmax = config["mindepth_km"], config["maxdepth_km"]
+ xlim_km = (xmin, xmax)
+ ylim_km = (ymin, ymax)
+ zlim_km = (zmin, zmax)
+
+ config.update(
+ {
+ "xlim_km": xlim_km,
+ "ylim_km": ylim_km,
+ "zlim_km": zlim_km,
+ "proj": proj,
+ }
+ )
+
+ config.update(
+ {
+ "min_picks_per_eq": 5,
+ "min_p_picks_per_eq": 0,
+ "min_s_picks_per_eq": 0,
+ "max_sigma11": 3.0,
+ "max_sigma22": 1.0,
+ "max_sigma12": 1.0,
+ }
+ )
+
+ config["use_dbscan"] = False
+ config["use_amplitude"] = True
+ config["oversample_factor"] = 8.0
+ config["dims"] = ["x(km)", "y(km)", "z(km)"]
+ config["method"] = "BGMM"
+ config["ncpu"] = 1
+ vel = {"p": 6.0, "s": 6.0 / 1.75}
+ config["vel"] = vel
+
+ config["bfgs_bounds"] = (
+ (xlim_km[0] - 1, xlim_km[1] + 1), # x
+ (ylim_km[0] - 1, ylim_km[1] + 1), # y
+ (0, zlim_km[1] + 1), # z
+ (None, None), # t
+ )
+
+ config["event_index"] = 0
+
+ return config
+
config = set_config()
+
def run_gamma(picks, stations, config_):
+
+ # %%
+ config.update(config_)
+
+ proj = config["proj"]
+
+ picks = picks.rename(
+ columns={
+ "station_id": "id",
+ "phase_time": "timestamp",
+ "phase_type": "type",
+ "phase_score": "prob",
+ "phase_amplitude": "amp",
+ }
+ )
+ stations[["x(km)", "y(km)"]] = stations.apply(
+ lambda x: pd.Series(proj(longitude=x.longitude, latitude=x.latitude)), axis=1
+ )
+ stations["z(km)"] = stations["elevation_m"].apply(lambda x: -x / 1e3)
+ stations = stations.rename(columns={"station_id": "id"})
+
+ events, assignments = association(picks, stations, config, 0, config["method"])
+
+ events = pd.DataFrame(events)
+ events[["longitude", "latitude"]] = events.apply(
+ lambda x: pd.Series(proj(longitude=x["x(km)"], latitude=x["y(km)"], inverse=True)), axis=1
+ )
+ events["depth_km"] = events["z(km)"]
+ events.drop(columns=["x(km)", "y(km)", "z(km)"], inplace=True, errors="ignore")
+ picks = picks.rename(
+ columns={
+ "id": "station_id",
+ "timestamp": "phase_time",
+ "type": "phase_type",
+ "prob": "phase_score",
+ "amp": "phase_amplitude",
+ }
+ )
+
+ assignments = pd.DataFrame(assignments, columns=["pick_index", "event_index", "gamma_score"])
+ picks = picks.join(assignments.set_index("pick_index")).fillna(-1).astype({"event_index": int})
+
+ return events, picks
+
K_^kFloovDl-v3pYziXmg)KFd@CpRe%C+-#^+_C%@p}4ckn-|X6
znQMKvke7#JeyO9vA;FWuA-~k%Umj6-^8c;Nz%#-j{?~T|IJj_YIHdpEM&YIWTV?(G
z`ri^E58;1WpsMB}{!bmz_;1_Qebbbe0?p}@wksSQJMG^G-m6H=0}f6c?(;_pH81$%
zRTMux%?!RLz)z-3Wyq*YiZ3Kql^PArT7eoZ9%+hE?zwhYPHQ1;)trgLUt4RzJWZcE
zhJYGbC1)+lH-gRcbAu1ZwB^rd*LMRg;8>a51bb_Xt5!f9(Dzj2W=vq++Vj-^)O9M%
z41ob%DF}fe4-T189R5F5gR8^^DgL3|{|+RBMDmr(q)XsG4g9|y7~x*2o=N{_O8&P4
zCIV(Lr;$_YzfJ)joijb8@_)Pk=gAo18gYigf2;jR7X2N$i@*=--VEcu>K3g|IHaAPGm#Gf1hzDb*B+J;www0e+TXx(=FM*
z3Eh8D^a}o!DhVgQ+<%kzFC9s~cFq4gM+rDlIn%p?y0rgYQeURr@#;Uz&;PI_Na95<
zUSW=@{5x