├── .gitignore
├── .readthedocs.yaml
├── LICENSE
├── README.MD
├── SeisMonitor
├── .bck
│ ├── scanloc
│ │ ├── format.py
│ │ ├── monitor.py
│ │ └── utils.py
│ └── scripts
│ │ ├── extraction.py
│ │ └── time_tracks.pkl
├── __init__.py
├── core
│ ├── __init__.py
│ ├── __pycache__
│ │ ├── client.cpython-37.pyc
│ │ ├── objects.cpython-37.pyc
│ │ ├── objects.cpython-39.pyc
│ │ ├── utils.cpython-37.pyc
│ │ └── utils.cpython-39.pyc
│ ├── client.py
│ ├── objects.py
│ └── utils.py
├── monitor
│ ├── .bck
│ │ ├── _asso_bck
│ │ │ ├── example.ipynb
│ │ │ ├── test.json
│ │ │ ├── test
│ │ │ │ └── gamma_format.py
│ │ │ ├── test_data.zip
│ │ │ ├── test_data
│ │ │ │ ├── catalog_gmma.csv
│ │ │ │ ├── config.pkl
│ │ │ │ ├── events.csv
│ │ │ │ ├── picks.json
│ │ │ │ ├── picks_gmma.csv
│ │ │ │ └── stations.csv
│ │ │ └── utils.py
│ │ └── _locator
│ │ │ ├── seisan.py
│ │ │ ├── seiscomp.py
│ │ │ └── utils.py
│ ├── __init__.py
│ ├── associator
│ │ ├── __init__.py
│ │ ├── ai.py
│ │ └── utils.py
│ ├── downloader
│ │ ├── .bck
│ │ │ └── seismonitor copy.py
│ │ ├── __init__.py
│ │ ├── obspy_mdl.py
│ │ ├── seismonitor.py
│ │ └── utils.py
│ ├── locator
│ │ ├── __init__.py
│ │ ├── __pycache__
│ │ │ └── utils.cpython-37.pyc
│ │ ├── hypoDD
│ │ │ ├── __init__.py
│ │ │ ├── __pycache__
│ │ │ │ ├── core.cpython-37.pyc
│ │ │ │ └── utils.cpython-37.pyc
│ │ │ ├── core.py
│ │ │ ├── hypoDD.inp
│ │ │ ├── ph2dt.inp
│ │ │ └── utils.py
│ │ ├── hypocenter
│ │ │ ├── STATION0.HYP
│ │ │ ├── __init__.py
│ │ │ ├── __pycache__
│ │ │ │ └── utils.cpython-37.pyc
│ │ │ ├── core.py
│ │ │ ├── libgfortran.so.3.0.0
│ │ │ ├── test
│ │ │ │ └── 12-2223-00L.S202106
│ │ │ └── utils.py
│ │ ├── nlloc
│ │ │ ├── .bck
│ │ │ │ └── _utils.py
│ │ │ ├── __init__.py
│ │ │ ├── nlloc.py
│ │ │ └── utils.py
│ │ └── utils.py
│ ├── magnitude
│ │ ├── __init__.py
│ │ ├── __pycache__
│ │ │ ├── __init__.cpython-37.pyc
│ │ │ ├── mag.cpython-37.pyc
│ │ │ └── utils.cpython-37.pyc
│ │ ├── bck
│ │ │ ├── _magnitude.py
│ │ │ └── test_magnitude,xml
│ │ ├── mag.py
│ │ └── utils.py
│ ├── picker
│ │ ├── __init__.py
│ │ ├── ai.py
│ │ └── utils.py
│ └── seismonitor.py
├── plot
│ ├── .bck
│ │ └── picks copy.py
│ ├── __init__.py
│ ├── __pycache__
│ │ ├── picks.cpython-37.pyc
│ │ ├── picks.cpython-39.pyc
│ │ ├── utils.cpython-37.pyc
│ │ └── utils.cpython-39.pyc
│ ├── mpt.png
│ ├── picks.py
│ └── utils.py
├── utils.py
└── utils4examples.py
├── docs
├── Makefile
├── SeisMonitor.core.rst
├── SeisMonitor.examples.rst
├── SeisMonitor.monitor.associator.rst
├── SeisMonitor.monitor.downloader.rst
├── SeisMonitor.monitor.locator.hypoDD.rst
├── SeisMonitor.monitor.locator.hypocenter.rst
├── SeisMonitor.monitor.locator.nlloc.rst
├── SeisMonitor.monitor.locator.rst
├── SeisMonitor.monitor.magnitude.rst
├── SeisMonitor.monitor.picker.rst
├── SeisMonitor.monitor.rst
├── SeisMonitor.plot.rst
├── SeisMonitor.rst
├── _build
│ ├── doctrees
│ │ ├── SeisMonitor.core.doctree
│ │ ├── SeisMonitor.doctree
│ │ ├── SeisMonitor.examples.doctree
│ │ ├── SeisMonitor.monitor.associator.doctree
│ │ ├── SeisMonitor.monitor.doctree
│ │ ├── SeisMonitor.monitor.downloader.doctree
│ │ ├── SeisMonitor.monitor.locator.doctree
│ │ ├── SeisMonitor.monitor.locator.hypoDD.doctree
│ │ ├── SeisMonitor.monitor.locator.hypocenter.doctree
│ │ ├── SeisMonitor.monitor.locator.nlloc.doctree
│ │ ├── SeisMonitor.monitor.magnitude.doctree
│ │ ├── SeisMonitor.monitor.picker.doctree
│ │ ├── SeisMonitor.plot.doctree
│ │ ├── environment.pickle
│ │ ├── index.doctree
│ │ └── modules.doctree
│ └── html
│ │ ├── .buildinfo
│ │ ├── SeisMonitor.core.html
│ │ ├── SeisMonitor.examples.html
│ │ ├── SeisMonitor.html
│ │ ├── SeisMonitor.monitor.associator.html
│ │ ├── SeisMonitor.monitor.downloader.html
│ │ ├── SeisMonitor.monitor.html
│ │ ├── SeisMonitor.monitor.locator.html
│ │ ├── SeisMonitor.monitor.locator.hypoDD.html
│ │ ├── SeisMonitor.monitor.locator.hypocenter.html
│ │ ├── SeisMonitor.monitor.locator.nlloc.html
│ │ ├── SeisMonitor.monitor.magnitude.html
│ │ ├── SeisMonitor.monitor.picker.html
│ │ ├── SeisMonitor.plot.html
│ │ ├── _modules
│ │ ├── SeisMonitor
│ │ │ ├── core
│ │ │ │ ├── client.html
│ │ │ │ ├── objects.html
│ │ │ │ └── utils.html
│ │ │ ├── monitor
│ │ │ │ ├── associator
│ │ │ │ │ ├── ai.html
│ │ │ │ │ └── utils.html
│ │ │ │ ├── downloader
│ │ │ │ │ ├── seismonitor.html
│ │ │ │ │ └── utils.html
│ │ │ │ ├── locator
│ │ │ │ │ ├── hypoDD
│ │ │ │ │ │ ├── core.html
│ │ │ │ │ │ └── utils.html
│ │ │ │ │ ├── hypocenter
│ │ │ │ │ │ ├── core.html
│ │ │ │ │ │ └── utils.html
│ │ │ │ │ ├── nlloc
│ │ │ │ │ │ ├── nlloc.html
│ │ │ │ │ │ └── utils.html
│ │ │ │ │ └── utils.html
│ │ │ │ ├── magnitude
│ │ │ │ │ ├── mag.html
│ │ │ │ │ └── utils.html
│ │ │ │ ├── picker
│ │ │ │ │ ├── ai.html
│ │ │ │ │ └── utils.html
│ │ │ │ └── seismonitor.html
│ │ │ ├── plot
│ │ │ │ ├── picks.html
│ │ │ │ └── utils.html
│ │ │ ├── utils.html
│ │ │ └── utils4examples.html
│ │ └── index.html
│ │ ├── _sources
│ │ ├── SeisMonitor.core.rst.txt
│ │ ├── SeisMonitor.examples.rst.txt
│ │ ├── SeisMonitor.monitor.associator.rst.txt
│ │ ├── SeisMonitor.monitor.downloader.rst.txt
│ │ ├── SeisMonitor.monitor.locator.hypoDD.rst.txt
│ │ ├── SeisMonitor.monitor.locator.hypocenter.rst.txt
│ │ ├── SeisMonitor.monitor.locator.nlloc.rst.txt
│ │ ├── SeisMonitor.monitor.locator.rst.txt
│ │ ├── SeisMonitor.monitor.magnitude.rst.txt
│ │ ├── SeisMonitor.monitor.picker.rst.txt
│ │ ├── SeisMonitor.monitor.rst.txt
│ │ ├── SeisMonitor.plot.rst.txt
│ │ ├── SeisMonitor.rst.txt
│ │ ├── index.rst.txt
│ │ └── modules.rst.txt
│ │ ├── _static
│ │ ├── _sphinx_javascript_frameworks_compat.js
│ │ ├── basic.css
│ │ ├── css
│ │ │ ├── badge_only.css
│ │ │ ├── fonts
│ │ │ │ ├── Roboto-Slab-Bold.woff
│ │ │ │ ├── Roboto-Slab-Bold.woff2
│ │ │ │ ├── Roboto-Slab-Regular.woff
│ │ │ │ ├── Roboto-Slab-Regular.woff2
│ │ │ │ ├── fontawesome-webfont.eot
│ │ │ │ ├── fontawesome-webfont.svg
│ │ │ │ ├── fontawesome-webfont.ttf
│ │ │ │ ├── fontawesome-webfont.woff
│ │ │ │ ├── fontawesome-webfont.woff2
│ │ │ │ ├── lato-bold-italic.woff
│ │ │ │ ├── lato-bold-italic.woff2
│ │ │ │ ├── lato-bold.woff
│ │ │ │ ├── lato-bold.woff2
│ │ │ │ ├── lato-normal-italic.woff
│ │ │ │ ├── lato-normal-italic.woff2
│ │ │ │ ├── lato-normal.woff
│ │ │ │ └── lato-normal.woff2
│ │ │ └── theme.css
│ │ ├── doctools.js
│ │ ├── documentation_options.js
│ │ ├── file.png
│ │ ├── fonts
│ │ │ ├── Lato
│ │ │ │ ├── lato-bold.eot
│ │ │ │ ├── lato-bold.ttf
│ │ │ │ ├── lato-bold.woff
│ │ │ │ ├── lato-bold.woff2
│ │ │ │ ├── lato-bolditalic.eot
│ │ │ │ ├── lato-bolditalic.ttf
│ │ │ │ ├── lato-bolditalic.woff
│ │ │ │ ├── lato-bolditalic.woff2
│ │ │ │ ├── lato-italic.eot
│ │ │ │ ├── lato-italic.ttf
│ │ │ │ ├── lato-italic.woff
│ │ │ │ ├── lato-italic.woff2
│ │ │ │ ├── lato-regular.eot
│ │ │ │ ├── lato-regular.ttf
│ │ │ │ ├── lato-regular.woff
│ │ │ │ └── lato-regular.woff2
│ │ │ └── RobotoSlab
│ │ │ │ ├── roboto-slab-v7-bold.eot
│ │ │ │ ├── roboto-slab-v7-bold.ttf
│ │ │ │ ├── roboto-slab-v7-bold.woff
│ │ │ │ ├── roboto-slab-v7-bold.woff2
│ │ │ │ ├── roboto-slab-v7-regular.eot
│ │ │ │ ├── roboto-slab-v7-regular.ttf
│ │ │ │ ├── roboto-slab-v7-regular.woff
│ │ │ │ └── roboto-slab-v7-regular.woff2
│ │ ├── jquery.js
│ │ ├── js
│ │ │ ├── badge_only.js
│ │ │ ├── theme.js
│ │ │ └── versions.js
│ │ ├── language_data.js
│ │ ├── minus.png
│ │ ├── plus.png
│ │ ├── pygments.css
│ │ ├── searchtools.js
│ │ └── sphinx_highlight.js
│ │ ├── genindex.html
│ │ ├── index.html
│ │ ├── modules.html
│ │ ├── objects.inv
│ │ ├── py-modindex.html
│ │ ├── search.html
│ │ └── searchindex.js
├── conf.py
├── figures
│ ├── f1-1.png
│ ├── f1.pdf
│ ├── f7.pdf
│ ├── f8-1.png
│ ├── f8.pdf
│ ├── f9-1.png
│ └── seismonitor.PNG
├── index.rst
├── make.bat
├── modules.rst
└── requirements.txt
├── examples
├── 1.downloader.ipynb
├── 2.picker.ipynb
├── 3.associator.ipynb
├── 4.locator.ipynb
├── 5.magnitude.ipynb
├── XO_project
│ ├── 0.downloader.py
│ ├── 1.picker.py
│ ├── 2.associator.py
│ ├── 3.prepare_locator.py
│ ├── 4.locator.py
│ ├── 5.magnitude.py
│ ├── 6.plot.py
│ └── vel_model.csv
├── eqt_test.py
├── monitor.ipynb
└── pnet_test.py
├── requirements.txt
├── setup.py
└── test
├── clone.py
├── step_by_step
├── 1_download_with_archive.py
├── 1_download_with_fdsn.py
├── 2_pick_with_eqtransformer.py
├── 2_pick_with_phasenet.py
├── 3_asso_with_gamma.py
├── 4_loc_with_nlloc.py
└── 5_mag_with_ml.py
└── test_seismonitor.py
/.gitignore:
--------------------------------------------------------------------------------
1 | models/
2 | out/
3 | 6m/*
4 | picking_models/
5 | others/
6 | test/*
7 | seismonitor_dataset/
8 | **/hypocenter/core
9 | **/__pycache__
10 | **/hypoDD/core
11 | **/nlloc/core
12 | **/nlloc/test*
13 | **/nlloc/TEST*
14 | **/NLLoc_grid/*
15 | **/EQTransformer/*
16 | **/PhaseNet/*
17 | **/OUTPUT
18 | build/
19 | dist/
20 | SeisMonitor.egg-info/
21 | ./time_tracks*
22 | x.input
23 | analisis/
24 | test/out/*
25 | seismonitor.egg-info
--------------------------------------------------------------------------------
/.readthedocs.yaml:
--------------------------------------------------------------------------------
1 | # Read the Docs configuration file
2 | # See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
3 |
4 | # Required
5 | version: 2
6 |
7 | # Set the OS, Python version, and other tools you might need
8 | build:
9 | os: ubuntu-24.04
10 | tools:
11 | python: "3.10"
12 |
13 | # Build documentation in the "docs/" directory with Sphinx
14 | sphinx:
15 | configuration: docs/conf.py
16 |
17 | # Optionally, but recommended,
18 | # declare the Python requirements required to build your documentation
19 | # See https://docs.readthedocs.io/en/stable/guides/reproducible-builds.html
20 | python:
21 | install:
22 | - requirements: docs/requirements.txt
--------------------------------------------------------------------------------
/README.MD:
--------------------------------------------------------------------------------
1 | 
2 | 
3 | 
4 | # A package for seismological monitoring.
5 | #### [Downloader->Picker->Associator->Locator->Magnitude]
6 | For now only supported for linux
7 |
8 | # Documentation (In progress)
9 |
10 | [Documentation](https://seismonitor.readthedocs.io/en/latest/)
11 |
12 | # Installation
13 |
14 | ## pip
15 | ```bash
16 | pip install SeisMonitor
17 | pip install git+https://github.com/ecastillot/EQTransformer.git@master
18 | pip install git+https://github.com/wayneweiqiang/GaMMA.git
19 | ```
20 | ## conda
21 | ```bash
22 | conda create --name seismonitor python=3.10
23 | conda activate seismonitor
24 | pip install SeisMonitor
25 | pip install git+https://github.com/ecastillot/EQTransformer.git@master
26 | pip install git+https://github.com/wayneweiqiang/GaMMA.git
27 | ```
28 |
29 | # Colombian Catalog
30 |
31 | Castillo, E., Prieto, G.A., Siervo, D. (2024). Colombian seismic monitoring using advanced machine-learning algorithms. Seism. Res. Lett. [PDF](https://gaprieto.com/wp-content/uploads/2024/05/gprieto_24c.pdf)
32 |
33 | | Data | |
34 | |---|---|
35 | | EQTransformer-picks| [Open](https://drive.google.com/file/d/1e3044OJBtFjg4HrrbawEJ-3GfqjN-Cbf/view?usp=sharing) |
36 | | GaMMA-catalog| [Open](https://drive.google.com/file/d/1OnMDNe4NZK98mNLjdrFhZNy14dJHZXhX/view?usp=drive_link) |
37 | | GaMMA-picks| [Open](https://drive.google.com/file/d/1qJhRHIYpFh8_TyWV0KyOvq9nj4y_zz5T/view?usp=drive_link) |
38 | | SeisMonitor-catalog| [Open](https://drive.google.com/file/d/1ZphhiOkZkeOZBwBVPmXmVsXp7WL0ZjEL/view?usp=sharing) |
39 | | SeisMonitor-picks| [Open](https://drive.google.com/file/d/1SS1OysOSk-9l-gFRpuCORRgXvwTKeniG/view?usp=sharing) |
40 |
41 | 
42 | 
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
56 |
--------------------------------------------------------------------------------
/SeisMonitor/.bck/scanloc/format.py:
--------------------------------------------------------------------------------
1 | import pandas as pd
2 | from obspy.core.event.resourceid import ResourceIdentifier
3 | from obspy.core.event.event import Event
4 |
5 | date_FMT = "%Y%m%d %H:%M:%S.%f"
6 |
7 | eqt_FMT = ["file_name","network","station","instrument_type",
8 | "station_lat","station_lon","station_elv",
9 | "event_start_time","event_end_time","detection_probability",
10 | "detection_uncertainty","p_arrival_time","p_probability",
11 | "p_uncertainty","p_snr","s_arrival_time","s_probability",
12 | "s_uncertainty","s_snr"]
13 |
14 | eqt_DATE_FORMAT = ["event_start_time","event_end_time","p_arrival_time","s_arrival_time"]
15 | P_eqt_FMT = [ x for x in eqt_FMT if x not in ["s_arrival_time","s_probability","s_uncertainty","s_snr"]]
16 | S_eqt_FMT = [ x for x in eqt_FMT if x not in ["p_arrival_time","p_probability","p_uncertainty","p_snr"]]
17 |
18 | def make_resource_id_column(picktime,network,
19 | station,channel):
20 |
21 | picktime_fmt = picktime.strftime("%Y-%m-%d %H:%M:%S.%f")
22 | id_name = f"{picktime_fmt}.{network}.{station}.{channel}"
23 |
24 | prefix = f"SeisMonitor:pick"
25 |
26 | return ResourceIdentifier(id =id_name,prefix=prefix)
27 |
28 | def split_eqt_phases(df,sortby="arrival_time"):
29 | p_df = df[P_eqt_FMT]
30 | s_df = df[S_eqt_FMT]
31 |
32 | dfs = []
33 | for phasehint,onedf in [("p",p_df),("s",s_df)]:
34 | keys = [f"{phasehint.lower()}_arrival_time",f"{phasehint.lower()}_probability",
35 | f"{phasehint.lower()}_uncertainty",f"{phasehint.lower()}_snr"]
36 | removing_phasehint = lambda x:x.split(f"{phasehint.lower()}_")[-1]
37 | new_keys = list(map(removing_phasehint,keys))
38 | columns = dict(zip(keys, new_keys))
39 | onedf = onedf.rename(columns=columns)
40 | onedf = onedf.dropna(subset=["arrival_time"])
41 | onedf["phasehint"] = phasehint.upper()
42 | onedf["event_box_id"] = df["network"] + "_" +df["station"] +\
43 | "_" + df["event_start_time"].astype(str) + \
44 | "_" + df["event_end_time"].astype(str)
45 | dfs.append(onedf)
46 |
47 | df = pd.concat(dfs)
48 | df = df.sort_values(sortby,ignore_index=True)
49 | return df
50 |
51 |
52 |
53 | def eqt2seismonitor(csv):
54 | df = pd.read_csv(csv)
55 |
56 | df[eqt_DATE_FORMAT] = df[eqt_DATE_FORMAT].apply(pd.to_datetime)
57 | df = split_eqt_phases(df)
58 |
59 |
60 | print(df)
61 |
62 | # df[eqt_DATE_FORMAT] = df[eqt_DATE_FORMAT].apply(.dt.tz_localize)
63 |
64 | # print(df)
65 |
66 | # print(df)
67 |
68 | if __name__ == "__main__":
69 | csv = "/home/emmanuel/Tesis/auto/aipicker/picks/picks_1d/csv/CM/CM_eqt_picks__20191201__20210101.csv"
70 |
71 | eqt2seismonitor(csv)
72 | # df = pd.read_csv(csv)
73 |
74 | # print(df)
--------------------------------------------------------------------------------
/SeisMonitor/.bck/scripts/extraction.py:
--------------------------------------------------------------------------------
1 | # /**
2 | # * @author [Emmanuel Castillo]
3 | # * @email [excastillot@unal.edu.co]
4 | # * @create date 2021-12-21 12:03:16
5 | # * @modify date 2021-12-21 12:03:16
6 | # * @desc [description]
7 | # */
8 |
9 | from obspy.clients.filesystem.sds import Client as SDS_Client
10 | from obspy.core.utcdatetime import UTCDateTime
11 | import argparse
12 |
13 | DEFAULT_args = {'sds':"/home/emmanuel/archive/sds"}
14 |
15 | def read_args():
16 | """
17 | read arguments from console
18 | """
19 |
20 | prefix = "+"
21 |
22 | parser = argparse.ArgumentParser("get seismic stream. ",
23 | prefix_chars=prefix,
24 | usage=f'get seismic stream.')
25 |
26 | parser.add_argument(prefix+"net",prefix*2+"network",
27 | type=str,
28 | metavar='',
29 | help= "network | examples: 'EY'",
30 | required = True)
31 |
32 | parser.add_argument(prefix+"sta",prefix*2+"station",
33 | type=str,
34 | metavar='',
35 | help= "station | examples: 'CA01A'",
36 | required = True)
37 |
38 | parser.add_argument(prefix+"loc",prefix*2+"location",
39 | type=str,
40 | metavar='',
41 | help= "location | examples: '00'",
42 | required = True)
43 |
44 | parser.add_argument(prefix+"cha",prefix*2+"channel",
45 | type=str,
46 | metavar='',
47 | help= "channel | examples: 'HHZ'",
48 | required = True)
49 |
50 | parser.add_argument(prefix+"sds",prefix*2+"sds",
51 | default=DEFAULT_args['sds'],
52 | type=str,
53 | metavar='',
54 | help= "Root path of the seiscomp data structure",
55 | )
56 |
57 | parser.add_argument(prefix+"f",prefix*2+"filter",
58 | action="store_true",
59 | help= "Filter the data of all traces in the Stream.",
60 | )
61 |
62 | parser.add_argument(prefix+"n",prefix*2+"normalize",
63 | action="store_true",
64 | help= "Normalize all Traces in the Stream.",
65 | )
66 |
67 | parser.add_argument(prefix+"d",prefix*2+"detrend",
68 | action="store_true",
69 | help= "Remove a trend from the trace",
70 | )
71 |
72 | parser.add_argument(prefix+"p",prefix*2+"plot",
73 | action="store_true",
74 | help= "plot traces",
75 | )
76 |
77 | parser.add_argument(prefix+"st",prefix*2+"starttime",
78 | type=str,
79 | metavar='',
80 | help="date | format: 'yyyymmddThhmmss'",
81 | required = True)
82 |
83 | parser.add_argument(prefix+"et",prefix*2+"endtime",
84 | type=str,
85 | metavar='',
86 | help="date | format: 'yyyymmddThhmmss'",
87 | required = True)
88 |
89 | args = parser.parse_args()
90 | args.starttime = UTCDateTime(args.starttime)
91 | args.endtime = UTCDateTime(args.endtime)
92 | vars_args = vars(args)
93 | return vars_args
94 |
95 |
96 | def extraction(args):
97 | """
98 | args: dict
99 | -------example-------
100 | {'network': 'EY',
101 | 'station': 'CA05A',
102 | 'location': '00',
103 | 'channel': 'HHZ',
104 | 'sds': '/home/emmanuel/archive/sds',
105 | 'filter': True,
106 | 'normalize': True,
107 | 'detrend': True,
108 | 'plot': True,
109 | 'starttime': UTCDateTime(2020, 11, 1, 3, 1, 58),
110 | 'endtime': UTCDateTime(2020, 11, 1, 3, 3)}
111 |
112 | returns: st
113 | Obspy stream
114 | """
115 | client = SDS_Client(args["sds"],
116 | sds_type='D',
117 | format='MSEED')
118 | wav_args = args.copy()
119 | if ('sds' in wav_args) or\
120 | ('detrend' in wav_args) or\
121 | ('filter' in wav_args) or\
122 | ('plot' in wav_args) or\
123 | ('normalize' in wav_args):
124 | del wav_args['sds']
125 | del wav_args['detrend']
126 | del wav_args['filter']
127 | del wav_args['normalize' ]
128 | del wav_args['plot' ]
129 |
130 | st = client.get_waveforms(**wav_args)
131 | print(st)
132 |
133 | if args['detrend'] != False:
134 | st.detrend('demean')
135 | if args['filter'] != False:
136 | st.filter(type='bandpass', freqmin = 5.0,
137 | freqmax = 45, corners=2,
138 | zerophase=True)
139 | if args['normalize'] != False:
140 | st.normalize()
141 | if args['plot'] != False:
142 | st.plot()
143 | return st
144 |
145 |
146 |
147 | if __name__ == "__main__":
148 | args = read_args()
149 | print(args)
150 | extraction(args)
--------------------------------------------------------------------------------
/SeisMonitor/.bck/scripts/time_tracks.pkl:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ecastillot/SeisMonitor/fa5acfd767f93b5d3a6010822127936319ddd6c0/SeisMonitor/.bck/scripts/time_tracks.pkl
--------------------------------------------------------------------------------
/SeisMonitor/__init__.py:
--------------------------------------------------------------------------------
1 | name='SeisMonitor'
2 | __version__ = "0.0.58"
3 |
--------------------------------------------------------------------------------
/SeisMonitor/core/__init__.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ecastillot/SeisMonitor/fa5acfd767f93b5d3a6010822127936319ddd6c0/SeisMonitor/core/__init__.py
--------------------------------------------------------------------------------
/SeisMonitor/core/__pycache__/client.cpython-37.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ecastillot/SeisMonitor/fa5acfd767f93b5d3a6010822127936319ddd6c0/SeisMonitor/core/__pycache__/client.cpython-37.pyc
--------------------------------------------------------------------------------
/SeisMonitor/core/__pycache__/objects.cpython-37.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ecastillot/SeisMonitor/fa5acfd767f93b5d3a6010822127936319ddd6c0/SeisMonitor/core/__pycache__/objects.cpython-37.pyc
--------------------------------------------------------------------------------
/SeisMonitor/core/__pycache__/objects.cpython-39.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ecastillot/SeisMonitor/fa5acfd767f93b5d3a6010822127936319ddd6c0/SeisMonitor/core/__pycache__/objects.cpython-39.pyc
--------------------------------------------------------------------------------
/SeisMonitor/core/__pycache__/utils.cpython-37.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ecastillot/SeisMonitor/fa5acfd767f93b5d3a6010822127936319ddd6c0/SeisMonitor/core/__pycache__/utils.cpython-37.pyc
--------------------------------------------------------------------------------
/SeisMonitor/core/__pycache__/utils.cpython-39.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ecastillot/SeisMonitor/fa5acfd767f93b5d3a6010822127936319ddd6c0/SeisMonitor/core/__pycache__/utils.cpython-39.pyc
--------------------------------------------------------------------------------
/SeisMonitor/core/client.py:
--------------------------------------------------------------------------------
1 | import os
2 | import glob
3 | from datetime import timedelta
4 | from obspy.clients.filesystem.sds import Client
5 | from obspy.core.util.misc import BAND_CODE
6 |
7 | class LocalClient(Client):
8 |
9 | def __init__(self, root, fmt, **kwargs):
10 | """
11 | Parameters:
12 | -----------
13 | root: str
14 | Path where is located the Local structure
15 |
16 | fmt: str
17 | The parameter should name the corresponding keys of the stats object, e.g. "{year}-{month:02d}/{year}-{month:02d}-{day:02d}/{network}.{station}.{location}.{channel}.{year}.{julday:03d}"
18 |
19 | kwargs:
20 | SDS client additional args
21 | """
22 | self.root = root
23 | self.fmt = fmt
24 | super().__init__(root,**kwargs)
25 |
26 | def _get_filenames(self, network, station, location, channel, starttime,
27 | endtime, sds_type=None):
28 | """
29 | Get a list of filenames for a given waveform and time span.
30 |
31 | Parameters
32 | ----------
33 | network: str
34 | Network code of requested data (e.g., "IU").
35 |
36 | station: str
37 | Station code of requested data (e.g., "ANMO").
38 |
39 | location: str
40 | Location code of requested data (e.g., "").
41 |
42 | channel: str
43 | Channel code of requested data (e.g., "HHZ").
44 |
45 | time: obspy.core.utcdatetime.UTCDateTime
46 | Time of interest.
47 |
48 | sds_type: str
49 | SDS type (description not provided).
50 | """
51 | sds_type = sds_type or self.sds_type
52 | # SDS has data sometimes in adjacent days, so also try to read the
53 | # requested data from those files. Usually this is only a few seconds
54 | # of data after midnight, but for now we play safe here to catch all
55 | # requested data (and with MiniSEED - the usual SDS file format - we
56 | # can use starttime/endtime kwargs anyway to read only desired parts).
57 | year_doy = set()
58 | # determine how far before starttime/after endtime we should check
59 | # other dayfiles for the data
60 | t_buffer = self.fileborder_samples / BAND_CODE.get(channel[:1], 20.0)
61 | t_buffer = max(t_buffer, self.fileborder_seconds)
62 | t = starttime - t_buffer
63 | t_max = endtime + t_buffer
64 | # make a list of year/doy combinations that covers the whole requested
65 | # time window (plus day before and day after)
66 | while t < t_max:
67 | year_doy.add((t.year,t.month,t.day, t.julday))
68 | t += timedelta(days=1)
69 | year_doy.add((t_max.year,t_max.month,t_max.day, t_max.julday))
70 |
71 | full_paths = set()
72 | for year,month,day,doy in year_doy:
73 | filename = self.fmt.format(
74 | network=network, station=station, location=location,
75 | channel=channel, year=year, month=month,
76 | day=day, julday=doy,sds_type=sds_type)
77 | full_path = os.path.join(self.sds_root, filename)
78 | full_paths = full_paths.union(glob.glob(full_path))
79 |
80 | return full_paths
81 |
82 | def _get_filename(self, network, station, location, channel, time, sds_type=None):
83 | """
84 | Get the filename for a given waveform.
85 |
86 | Parameters
87 | ----------
88 | network: str
89 | Network code of requested data (e.g., "IU").
90 |
91 | station: str
92 | Station code of requested data (e.g., "ANMO").
93 |
94 | location: str
95 | Location code of requested data (e.g., "").
96 |
97 | channel: str
98 | Channel code of requested data (e.g., "HHZ").
99 |
100 | time: obspy.core.utcdatetime.UTCDateTime
101 | Time of interest.
102 |
103 | Returns
104 | -------
105 | str
106 | The filename corresponding to the given parameters.
107 | """
108 | sds_type = sds_type or self.sds_type
109 | filename = self.fmt.format(
110 | network=network, station=station, location=location,
111 | channel=channel, year=time.year, month=time.month,
112 | day=time.day, doy=time.julday,sds_type=sds_type)
113 | return os.path.join(self.sds_root, filename)
114 |
--------------------------------------------------------------------------------
/SeisMonitor/monitor/.bck/_asso_bck/test.json:
--------------------------------------------------------------------------------
1 | {"AGCC": {"network": "CM", "channels": ["HHZ", "HHN", "HHE"], "coords": [8.5121, -73.585, 457.0], "sampling_rate": [100.0, 100.0, 100.0]}, "EZNC": {"network": "CM", "channels": ["HHZ", "HHN", "HHE"], "coords": [7.6257, -73.3171, 479.0], "sampling_rate": [100.0, 100.0, 100.0]}, "BAR2": {"network": "CM", "channels": ["HHZ", "HHN", "HHE", "HNZ", "HNN", "EHZ", "HNE"], "coords": [6.592, -73.182, 1864.0], "sampling_rate": [100.0, 100.0, 100.0, 200.0, 200.0, 100.0, 200.0]}, "URMC": {"network": "CM", "channels": ["HHZ", "HHN", "HHE", "HNZ", "HNN", "HNE"], "coords": [3.24719, -74.37879, 725.0], "sampling_rate": [100.0, 100.0, 100.0, 200.0, 200.0, 200.0]}, "YOT": {"network": "CM", "channels": ["HHZ", "BHN", "BHE", "HHN", "HHE", "HNZ", "HNN", "HNE", "BHZ"], "coords": [3.9835, -76.345, 1040.0], "sampling_rate": [100.0, 20.0, 20.0, 100.0, 100.0, 200.0, 200.0, 200.0, 20.0]}, "PDSC": {"network": "CM", "channels": ["HNE", "HNN", "HNZ"], "coords": [6.992025, -73.06426, 958.0], "sampling_rate": [200.0, 200.0, 200.0]}}
--------------------------------------------------------------------------------
/SeisMonitor/monitor/.bck/_asso_bck/test/gamma_format.py:
--------------------------------------------------------------------------------
1 | import numpy as np
2 |
3 |
--------------------------------------------------------------------------------
/SeisMonitor/monitor/.bck/_asso_bck/test_data.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ecastillot/SeisMonitor/fa5acfd767f93b5d3a6010822127936319ddd6c0/SeisMonitor/monitor/.bck/_asso_bck/test_data.zip
--------------------------------------------------------------------------------
/SeisMonitor/monitor/.bck/_asso_bck/test_data/config.pkl:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ecastillot/SeisMonitor/fa5acfd767f93b5d3a6010822127936319ddd6c0/SeisMonitor/monitor/.bck/_asso_bck/test_data/config.pkl
--------------------------------------------------------------------------------
/SeisMonitor/monitor/.bck/_asso_bck/test_data/stations.csv:
--------------------------------------------------------------------------------
1 | station longitude latitude elevation(m) unit component response
2 | CI.CCC..BH -117.365 35.525 670.000 m/s E,N,Z 627368000.00,627368000.00,627368000.00
3 | CI.CCC..HH -117.365 35.525 670.000 m/s E,N,Z 627368000.00,627368000.00,627368000.00
4 | CI.CCC..HN -117.365 35.525 670.000 m/s**2 E,N,Z 213979.00,214322.00,213808.00
5 | CI.CLC..BH -117.598 35.816 775.000 m/s E,N,Z 627368000.00,627368000.00,627368000.00
6 | CI.CLC..HH -117.598 35.816 775.000 m/s E,N,Z 627368000.00,627368000.00,627368000.00
7 | CI.CLC..HN -117.598 35.816 775.000 m/s**2 E,N,Z 213945.00,213808.00,213740.00
8 | CI.DTP..BH -117.846 35.267 908.000 m/s E,N,Z 627368000.00,627368000.00,627368000.00
9 | CI.DTP..HH -117.846 35.267 908.000 m/s E,N,Z 627368000.00,627368000.00,627368000.00
10 | CI.DTP..HN -117.846 35.267 908.000 m/s**2 E,N,Z 214399.00,213971.00,214484.00
11 | CI.JRC2..BH -117.809 35.982 1469.000 m/s E,N,Z 784866000.00,784866000.00,790478000.00
12 | CI.JRC2..HH -117.809 35.982 1469.000 m/s E,N,Z 784866000.00,784866000.00,790478000.00
13 | CI.JRC2..HN -117.809 35.982 1469.000 m/s**2 E,N,Z 213808.00,213945.00,214185.00
14 | CI.LRL..BH -117.682 35.480 1340.000 m/s E,N,Z 628306000.00,629984000.00,627467000.00
15 | CI.LRL..HH -117.682 35.480 1340.000 m/s E,N,Z 628306000.00,629984000.00,627467000.00
16 | CI.LRL..HN -117.682 35.480 1340.000 m/s**2 E,N,Z 213757.00,213671.00,213201.00
17 | CI.LRL.2C.HN -117.682 35.480 1340.000 m/s**2 E,N,Z 213757.00,213671.00,213201.00
18 | CI.MPM..BH -117.489 36.058 1839.000 m/s E,N,Z 627368000.00,627368000.00,627368000.00
19 | CI.MPM..HH -117.489 36.058 1839.000 m/s E,N,Z 627368000.00,627368000.00,627368000.00
20 | CI.MPM..HN -117.489 36.058 1839.000 m/s**2 E,N,Z 213911.00,214219.00,213911.00
21 | CI.Q0072.01.HN -117.667 35.610 695.000 m/s**2 E,N,Z 256354.00,256354.00,256354.00
22 | CI.SLA..BH -117.283 35.891 1174.000 m/s E,N,Z 622338000.00,618992000.00,616482000.00
23 | CI.SLA..HH -117.283 35.891 1174.000 m/s E,N,Z 622338000.00,618992000.00,616482000.00
24 | CI.SLA..HN -117.283 35.891 1174.000 m/s**2 E,N,Z 214253.00,213671.00,213979.00
25 | CI.SRT..BH -117.751 35.692 667.000 m/s E,N,Z 629145000.00,629145000.00,629145000.00
26 | CI.SRT..HH -117.751 35.692 667.000 m/s E,N,Z 629145000.00,629145000.00,629145000.00
27 | CI.SRT..HN -117.751 35.692 667.000 m/s**2 E,N,Z 214056.00,213628.00,213842.00
28 | CI.TOW2..BH -117.765 35.809 685.000 m/s E,N,Z 626910000.00,626910000.00,626838000.00
29 | CI.TOW2..HH -117.765 35.809 685.000 m/s E,N,Z 626910000.00,626910000.00,626838000.00
30 | CI.TOW2..HN -117.765 35.809 685.000 m/s**2 E,N,Z 213800.00,214142.00,214356.00
31 | CI.WBM..BH -117.890 35.608 892.000 m/s E,N,Z 314573000.00,314573000.00,314573000.00
32 | CI.WBM..HH -117.890 35.608 892.000 m/s E,N,Z 314573000.00,314573000.00,314573000.00
33 | CI.WBM..HN -117.890 35.608 892.000 m/s**2 E,N,Z 213550.00,214064.00,213550.00
34 | CI.WBM.2C.HN -117.890 35.608 892.000 m/s**2 E,N,Z 213550.00,214064.00,213550.00
35 | CI.WCS2..BH -117.765 36.025 1143.000 m/s E,N,Z 626910000.00,626910000.00,626838000.00
36 | CI.WCS2..HH -117.765 36.025 1143.000 m/s E,N,Z 626910000.00,626910000.00,626838000.00
37 | CI.WCS2..HN -117.765 36.025 1143.000 m/s**2 E,N,Z 213757.00,213329.00,213415.00
38 | CI.WMF..BH -117.855 36.118 1537.400 m/s E,N,Z 625790000.00,627467000.00,625790000.00
39 | CI.WMF..HH -117.855 36.118 1537.400 m/s E,N,Z 625790000.00,627467000.00,625790000.00
40 | CI.WMF..HN -117.855 36.118 1537.400 m/s**2 E,N,Z 213842.00,213842.00,213842.00
41 | CI.WMF.2C.HN -117.855 36.118 1537.400 m/s**2 E,N,Z 213842.00,213842.00,213842.00
42 | CI.WNM..EH -117.906 35.842 974.300 m/s Z 69328700.00
43 | CI.WNM..HN -117.906 35.842 974.300 m/s**2 E,N,Z 214021.00,213892.00,214021.00
44 | CI.WNM.2C.HN -117.906 35.842 974.300 m/s**2 E,N,Z 214039.00,213911.00,214039.00
45 | CI.WRC2..BH -117.650 35.948 943.000 m/s E,N,Z 629145000.00,629145000.00,629145000.00
46 | CI.WRC2..HH -117.650 35.948 943.000 m/s E,N,Z 629145000.00,629145000.00,629145000.00
47 | CI.WRC2..HN -117.650 35.948 943.000 m/s**2 E,N,Z 214227.00,213970.00,214056.00
48 | CI.WRV2..EH -117.890 36.008 1070.000 m/s Z 71450700.00
49 | CI.WRV2..HN -117.890 36.008 1070.000 m/s**2 E,N,Z 213850.00,235188.00,235102.00
50 | CI.WRV2.2C.HN -117.890 36.008 1070.000 m/s**2 E,N,Z 213868.00,235208.00,235122.00
51 | CI.WVP2..EH -117.818 35.949 1465.000 m/s Z 68041300.00
52 | CI.WVP2..HN -117.818 35.949 1465.000 m/s**2 E,N,Z 213764.00,213550.00,213721.00
53 | CI.WVP2.2C.HN -117.818 35.949 1465.000 m/s**2 E,N,Z 213782.00,213569.00,213740.00
54 | NP.1809..HN -117.957 36.110 1092.000 m/s**2 E,N,Z 429497.00,429497.00,426141.00
55 | NP.5419..HN -117.662 35.649 689.000 m/s**2 E,N,Z 426141.00,429497.00,429497.00
56 | PB.B916..EH -117.668 36.193 1859.900 m/s 1,2,Z 781398000.00,781398000.00,781398000.00
57 | PB.B917..EH -117.259 35.405 1192.000 m/s 1,2,Z 781398000.00,781398000.00,781398000.00
58 | PB.B918..EH -117.602 35.936 1042.600 m/s 1,2,Z 781398000.00,781398000.00,781398000.00
59 | PB.B921..EH -117.462 35.587 694.500 m/s 1,2,Z 781398000.00,781398000.00,781398000.00
60 |
--------------------------------------------------------------------------------
/SeisMonitor/monitor/.bck/_asso_bck/utils.py:
--------------------------------------------------------------------------------
1 | import os
2 | import datetime as dt
3 | import pandas as pd
4 | from SeisMonitor.utils import printlog,isfile
5 | import warnings
6 | warnings.filterwarnings('ignore')
7 | ### EQTransformer util associator
8 |
9 | def link(p_row,s_df,tt,st=2,et=4):
10 | p_time = p_row.arrival_time
11 | s_minus_p = (s_df["arrival_time"]-p_time).dt.total_seconds()
12 | s_df["tt"] = s_df["arrival_time"][abs(s_minus_p) <= tt]
13 | s_df = s_df.dropna(subset=['tt'])
14 |
15 | s_df = s_df.sort_values(by=["tt"],ignore_index=True)
16 | # print(s_df["tt"])
17 | if len(s_df) >= 1:
18 | p_row["s_arrival_time"] = s_df["tt"][0]
19 | p_row["s_probability"] = s_df["probability"][0]
20 | p_row["s_pick_id"] = s_df["pick_id"][0]
21 |
22 | p_row['event_start_time'] = p_time-dt.timedelta(seconds=st)
23 | p_row['event_end_time'] = p_time+dt.timedelta(seconds=et)
24 | p_row['detection_probability'] = (p_row["probability"] + p_row["s_probability"])/2
25 |
26 | else:
27 | p_row["s_arrival_time"] = None
28 | p_row["s_probability"] = None
29 | p_row["s_pick_id"] = None
30 |
31 | p_row['event_start_time'] = p_time-dt.timedelta(seconds=st)
32 | p_row['event_end_time'] = p_time+dt.timedelta(seconds=et*1)
33 | p_row['detection_probability'] = p_row["probability"]/2
34 | p_row['file_name'] = p_row.mseed_name
35 | p_row['station_lat'] = p_row.station_lat
36 | p_row['station_lon'] = p_row.station_lon
37 | p_row['station_elv'] = p_row.station_elv
38 | return p_row
39 |
40 | def make_eqt_dirs(eqt_df,folder):
41 | dfbystation = eqt_df.groupby(by=["station"])
42 |
43 | for name,df in dfbystation.__iter__():
44 | dirname = name + "_outputs"
45 | dirpath = os.path.join(folder,dirname)
46 |
47 | if not os.path.isdir(dirpath):
48 | os.makedirs(dirpath)
49 |
50 | filepath = os.path.join(dirpath,"X_prediction_results.csv")
51 | df.to_csv(filepath,index=False)
52 |
53 | def link_seismonitor_phases(df,tt=30,st=2,et=4):
54 | """
55 | For each P pick, it searchs the corresponding S pick
56 | according tt parameter.
57 | Parameters:
58 | -----------
59 | df: pd.DataFrame
60 | seismonitor dataframe
61 | tt: float
62 | Each P pick search S picks in a tt-second radius.
63 | If there are more than one S pick, it chooses the closest.
64 | st: float
65 | Seconds before the P pick. It is used to set up
66 | the event start time
67 | et: float
68 | Seconds after the S pick. It is used to set up
69 | the event end time. If there isn't P pick, the event
70 | end time is configured et*2-seconds adfter the P phase time.
71 | Returns:
72 | --------
73 | df: pd.DataFrame
74 | P and S phases are linked by
75 | """
76 | columns = ["pick_id","arrival_time","probability",'phasehint','network',
77 | 'station', 'location','instrument_type','author',
78 | "station_lat","station_lon","station_elv",
79 | 'creation_time',"mseed_name"]
80 |
81 | df = df [columns]
82 | df["arrival_time"] = pd.to_datetime(df["arrival_time"])
83 | dfbystation = df.groupby(by=["station"])
84 |
85 | eqt_df = pd.DataFrame()
86 | for i,df in dfbystation.__iter__():
87 |
88 | p_df = df[df["phasehint"] == "P"]
89 | s_df = df[df["phasehint"] == "S"]
90 |
91 | for j,row in p_df.iterrows():
92 | p_row = link(row,s_df,tt,st,et)
93 | eqt_df = eqt_df.append(p_row,ignore_index=True)
94 |
95 | eqt_df["p_snr"] = None
96 | eqt_df["p_uncertainty"] = None
97 | eqt_df["s_snr"] = None
98 | eqt_df["s_uncertainty"] = None
99 | eqt_df["detection_uncertainty"] = None
100 |
101 | eqt_df = eqt_df.rename(columns={"arrival_time":"p_arrival_time",
102 | "probability":"p_probability"
103 | })
104 | eqt_columns = ["file_name","network",'station',
105 | 'instrument_type','station_lat','station_lon','station_elv',
106 | 'event_start_time','event_end_time','detection_probability',
107 | 'detection_uncertainty','p_arrival_time','p_probability',
108 | 'p_uncertainty','p_snr','s_arrival_time',
109 | 's_probability','s_uncertainty','s_snr']
110 |
111 | eqt_df = eqt_df[eqt_columns]
112 | return eqt_df
113 |
114 | def seismonitor_picks_to_eqt_fmt(seismonitor_picks,eqt_folder,
115 | tt=30,st=2,et=4):
116 |
117 | df = pd.read_csv(seismonitor_picks)
118 | date_cols = ["arrival_time","creation_time",
119 | "event_start_time","event_end_time",
120 | "mseed_start_time","mseed_end_time"]
121 | df[date_cols] = df[date_cols].apply(pd.to_datetime)
122 |
123 | eqt = link_seismonitor_phases(df,tt,st,et)
124 | printlog('info','link_phasenet_phases',
125 | f'ok')
126 |
127 | make_eqt_dirs(eqt,eqt_folder)
128 | printlog('info','pnet_to_eqt_fmt',
129 | f'ok')
--------------------------------------------------------------------------------
/SeisMonitor/monitor/__init__.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ecastillot/SeisMonitor/fa5acfd767f93b5d3a6010822127936319ddd6c0/SeisMonitor/monitor/__init__.py
--------------------------------------------------------------------------------
/SeisMonitor/monitor/associator/__init__.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ecastillot/SeisMonitor/fa5acfd767f93b5d3a6010822127936319ddd6c0/SeisMonitor/monitor/associator/__init__.py
--------------------------------------------------------------------------------
/SeisMonitor/monitor/downloader/__init__.py:
--------------------------------------------------------------------------------
1 | from .seismonitor import MseedDownloader
--------------------------------------------------------------------------------
/SeisMonitor/monitor/locator/__init__.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ecastillot/SeisMonitor/fa5acfd767f93b5d3a6010822127936319ddd6c0/SeisMonitor/monitor/locator/__init__.py
--------------------------------------------------------------------------------
/SeisMonitor/monitor/locator/__pycache__/utils.cpython-37.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ecastillot/SeisMonitor/fa5acfd767f93b5d3a6010822127936319ddd6c0/SeisMonitor/monitor/locator/__pycache__/utils.cpython-37.pyc
--------------------------------------------------------------------------------
/SeisMonitor/monitor/locator/hypoDD/__init__.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ecastillot/SeisMonitor/fa5acfd767f93b5d3a6010822127936319ddd6c0/SeisMonitor/monitor/locator/hypoDD/__init__.py
--------------------------------------------------------------------------------
/SeisMonitor/monitor/locator/hypoDD/__pycache__/core.cpython-37.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ecastillot/SeisMonitor/fa5acfd767f93b5d3a6010822127936319ddd6c0/SeisMonitor/monitor/locator/hypoDD/__pycache__/core.cpython-37.pyc
--------------------------------------------------------------------------------
/SeisMonitor/monitor/locator/hypoDD/__pycache__/utils.cpython-37.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ecastillot/SeisMonitor/fa5acfd767f93b5d3a6010822127936319ddd6c0/SeisMonitor/monitor/locator/hypoDD/__pycache__/utils.cpython-37.pyc
--------------------------------------------------------------------------------
/SeisMonitor/monitor/locator/hypoDD/core.py:
--------------------------------------------------------------------------------
1 | import os
2 | import pandas as pd
3 | from obspy.core.event.catalog import Catalog, read_events
4 | from SeisMonitor.utils import printlog, isfile
5 | from . import utils as ut
6 |
7 | class HypoDD:
8 | """
9 | A class to handle HypoDD earthquake relocation.
10 |
11 | Attributes:
12 | catalog (Catalog): ObsPy Catalog object containing earthquake events.
13 | xml_path (str): Path to the station metadata file in XML format.
14 | vel_path (str): Path to the velocity model file (CSV format).
15 | out_dir (str): Directory where output files will be stored.
16 | out_file (str): Path to the final relocated earthquake catalog.
17 | paths (str): Directory for HypoDD-related intermediate files.
18 | pha (str): Path to the phase file for HypoDD.
19 | vel_df (DataFrame): Pandas DataFrame containing velocity model information.
20 | """
21 |
22 | def __init__(self, catalog, xml_path, vel_path, out_dir):
23 | """
24 | Initializes the HypoDD class with the necessary input files and directories.
25 |
26 | Args:
27 | catalog (str or Catalog): Path to an earthquake catalog file or an ObsPy Catalog object.
28 | xml_path (str): Path to the station metadata XML file.
29 | vel_path (str): Path to the CSV file containing the velocity model.
30 | out_dir (str): Directory where output files will be stored.
31 | """
32 |
33 | # Load catalog from file if not already a Catalog object
34 | if isinstance(catalog, Catalog):
35 | self.catalog = catalog
36 | else:
37 | self.catalog = read_events(catalog)
38 |
39 | self.xml_path = xml_path
40 | self.vel_path = vel_path
41 | self.out_dir = out_dir
42 |
43 | # Define paths for output files
44 | self.out_file = os.path.join(self.out_dir, "hypodd", "hypodd_events.xml")
45 | self.paths = os.path.join(self.out_dir, "hypodd", "hypodd_paths")
46 |
47 | # Create output directory if it doesn't exist
48 | if not os.path.isdir(self.paths):
49 | os.makedirs(self.paths)
50 |
51 | # Define paths for phase file and velocity model DataFrame
52 | self.pha = os.path.join(self.paths, "hypoDD.pha")
53 | self.vel_df = pd.read_csv(vel_path)
54 |
55 | def locate(self, vp_vs_ratio=1.84, out_format="QUAKEML", rm_not_locatable=True):
56 | """
57 | Runs the HypoDD relocation process.
58 |
59 | Args:
60 | vp_vs_ratio (float, optional): The Vp/Vs ratio used in velocity modeling. Default is 1.84.
61 | out_format (str, optional): Output format for the relocated catalog (e.g., "QUAKEML"). Default is "QUAKEML".
62 | rm_not_locatable (bool, optional): Whether to remove events that cannot be relocated. Default is True.
63 | """
64 |
65 | # Convert XML station metadata to a DataFrame
66 | df = ut.resp2df(self.xml_path)
67 |
68 | # Write station information required for HypoDD
69 | ut.write_hypoDDstation(df, self.paths)
70 |
71 | # Write phase file from event catalog
72 | ut.write_pha(self.catalog, self.pha)
73 |
74 | # Write phase-to-difference time input file for HypoDD
75 | ut.write_ph2dt_inp_file(self.paths)
76 |
77 | # Extract velocity layers from the velocity model
78 | vel_layers = ut.get_vel_layers(self.vel_df)
79 |
80 | # Setup velocity model for HypoDD
81 | vel_model = ut.setup_velocity_model(
82 | "layered_p_velocity_with_constant_vp_vs_ratio",
83 | vp_vs_ratio=vp_vs_ratio,
84 | layer_tops=vel_layers
85 | )
86 |
87 | # Write HypoDD input file
88 | ut.write_hypoDD_inp_file(vel_model, self.paths)
89 |
90 | # Define paths for HypoDD binaries
91 | hypodd_root = "/home/emmanuel/QuakeFlow/HypoDD"
92 | ph2dt_path = os.path.join(hypodd_root, "HYPODD", "src", "ph2dt", "ph2dt")
93 | hypodd_path = os.path.join(hypodd_root, "HYPODD", "src", "hypoDD", "hypoDD")
94 |
95 | # Define paths for input files
96 | ph2dt_inp_path = os.path.join(self.paths, "ph2dt.inp")
97 | hypodd_inp_path = os.path.join(self.paths, "hypoDD.inp")
98 |
99 | # Define shell commands for running HypoDD steps
100 | PH2DT_CMD = f"cd {self.paths} && {ph2dt_path} ph2dt.inp"
101 | HYPODD_CMD = f"cd {self.paths} && {hypodd_path} hypoDD.inp"
102 |
103 | # Execute phase-to-difference time conversion
104 | if os.system(PH2DT_CMD) != 0:
105 | raise RuntimeError(f"{PH2DT_CMD} failed!")
106 |
107 | # Execute HypoDD relocation
108 | if os.system(HYPODD_CMD) != 0:
109 | raise RuntimeError(f"{HYPODD_CMD} failed!")
110 | printlog("HypoDD relocation completed successfully.")
--------------------------------------------------------------------------------
/SeisMonitor/monitor/locator/hypoDD/hypoDD.inp:
--------------------------------------------------------------------------------
1 | *--- INPUT file selection
2 | * cross correlation diff times:
3 |
4 | *catalog P diff times
5 | dt.ct
6 | * event file:
7 | event.sel
8 | * station file:
9 | stations_hypoDD.dat
10 | *--- OUTPUT file selection
11 | * original locations:
12 | hypoDD.loc
13 | * relocations:
14 | hypoDD.reloc
15 | * station information:
16 | hypoDD.sta
17 | * residual information:
18 | hypoDD.res
19 | * source paramater information:
20 | hypoDD.src
21 | *--- DATA type selection
22 | * IDAT: 0 = synthetics; 1= cross corr; 2= catalog; 3= cross & cat
23 | * IPHA: 1= P; 2= S; 3= P&S
24 | * DIST:max dist [km] between cluster centroid and station
25 | * IDAT IPHA DIST
26 | 2 3 120
27 | *--- event clustering:
28 | * OBSCC: min # of obs/pair for crosstime data (0= no clustering)
29 | * OBSCT: min # of obs/pair for network data (0= no clustering)
30 | * OBSCC OBSCT
31 | 0 8
32 | *--- solution control:
33 | * ISTART: 1 = from single source; 2 = from network sources
34 | * ISOLV: 1 = SVD, 2=lsqr
35 | * NSET: number of sets of iteration with specifications following
36 | * ISTART ISOLV NSET
37 | 2 2 4
38 | *--- data weighting and re-weighting:
39 | * NITER: last iteration to used the following weights
40 | * WTCCP, WTCCS: weight cross P, S
41 | * WTCTP, WTCTS: weight catalog P, S
42 | * WRCC, WRCT: residual threshold in sec for cross, catalog data
43 | * WDCC, WDCT: max dist [km] between cross, catalog linked pairs
44 | * DAMP: damping (for lsqr only)
45 | * --- CROSS DATA ----- ----CATALOG DATA ----
46 | * NITER WTCCP WTCCS WRCC WDCC WTCTP WTCTS WRCT WDCT DAMP
47 | 4 -9 -9 -9 -9 1 1 8 -9 70
48 | 4 -9 -9 -9 -9 1 1 6 4 70
49 | 4 -9 -9 -9 -9 1 0.8 4 2 70
50 | 4 -9 -9 -9 -9 1 0.8 3 2 70
51 | *--- 1D model:
52 | * NLAY: number of model layers
53 | * RATIO: vp/vs ratio
54 | * TOP: depths of top of layer (km)
55 | * VEL: layer velocities (km/s)
56 | 7 1.82
57 | 0.0 4.0 25.0 32.0 40.0 100.0 200.0
58 | 4.8 6.6 7.0 8.0 8.1 8.2 8.3
59 | *--- event selection:
60 | * CID: cluster to be relocated (0 = all)
61 | * ID: cuspids of event to be relocated (8 per line)
62 | * CID
63 | 0
64 | * ID
65 |
--------------------------------------------------------------------------------
/SeisMonitor/monitor/locator/hypoDD/ph2dt.inp:
--------------------------------------------------------------------------------
1 | * ph2dt.inp - input control file for program ph2dt
2 | * Input station file:
3 | stations_hypoDD.dat
4 | * Input phase file:
5 | hypoDD.pha
6 | *MINWGHT: min. pick weight allowed [0]
7 | *MAXDIST: max. distance in km between event pair and stations [200]
8 | *MAXSEP: max. hypocentral separation in km [10]
9 | *MAXNGH: max. number of neighbors per event [10]
10 | *MINLNK: min. number of links required to define a neighbor [8]
11 | *MINOBS: min. number of links per pair saved [8]
12 | *MAXOBS: max. number of links per pair saved [20]
13 | *MINWGHT MAXDIST MAXSEP MAXNGH MINLNK MINOBS MAXOBS
14 | 0.0 120.0 10.0 50.0 8.0 8.0 100
--------------------------------------------------------------------------------
/SeisMonitor/monitor/locator/hypocenter/STATION0.HYP:
--------------------------------------------------------------------------------
1 | RESET TEST(02)=500.0
2 | RESET TEST(11)=99.0
3 | RESET TEST(13)=1.0
4 | RESET TEST(41)=20000.0
5 | RESET TEST(43)=5.0
6 | RESET TEST(56)=1.0
7 | RESET TEST(85)=0.1
8 |
9 | ACH1 356.53N 7340.27W 491
10 | ACH2 356.67N 7342.19W 502
11 | ACH3 355.20N 7340.85W 466
12 | ACH4 357.90N 7339.73W 438
13 | ACH5 353.87N 7334.76W 362
14 | ACH6 353.84N 7346.87W 566
15 | ACH7 4 2.42N 7341.97W 483
16 | AGCC 830.73N 7335.10W 457
17 | APAC 754.00N 7634.81W 103
18 | APTC 754.03N 7634.83W 209
19 | ARAMC 320.95N 7356.60W 665
20 | ARGC 951.46N 7414.75W 187
21 | ARMEC 433.36N 7539.60W1554
22 | BAR2 635.52N 7310.92W1864
23 | BBAC 2 1.29N 7714.81W1713
24 | BELO 3 2.93N 7548.61W2518
25 | BET 243.35N 7525.07W 540
26 | BOG 438.46N 74 4.80W2584
27 | BRJC 658.39N 7344.65W 108
28 | BRR 7 6.43N 7342.72W 137
29 | CAP2 838.67N 7721.62W 221
30 | CAQC 424.13N 7359.17W2041
31 | CBETA 242.35N 7527.91W 559
32 | CBOC 551.86N 76 0.73W1401
33 | CCALA 430.54N 7537.66W1795
34 | CGARZ 211.42N 7536.30W 988
35 | CHI 437.77N 7344.23W3140
36 | CIBA3 425.91N 7511.29W1082
37 | CLBC 322.66N 7448.07W 785
38 | CLEJA 332.18N 74 2.49W 749
39 | CMOC1 111.68N 7638.39W 721
40 | CMOC2 1 9.34N 7638.61W 586
41 | CMOC3 1 8.22N 7638.70W 649
42 | CMOC4 1 8.64N 7639.96W 717
43 | CMOC5 1 9.43N 7639.10W 645
44 | CMOC6 1 8.36N 7639.23W 668
45 | CNEIV 256.35N 7516.39W 514
46 | COBO 219.66N 7623.82W4294
47 | CONO 219.66N 7623.82W4294
48 | CPER3 448.44N 7544.28W1318
49 | CPLAT 223.09N 7554.42W1111
50 | CPOP2 227.44N 7635.50W1764
51 | CPRAD 345.31N 7453.43W 390
52 | CQUET 419.71N 7351.67W1436
53 | CREAC 438.02N 74 5.28W2575
54 | CRJC11 1.20N 7252.90W 827
55 | CRU 134.08N 7657.06W2761
56 | CSAGU 242.35N 7526.11W1598
57 | CSAL1 256.44N 7642.32W1164
58 | CTRUJ 413.14N 7619.32W1388
59 | CUFI 113.56N 7720.70W3653
60 | CUIBA 426.99N 7512.01W1130
61 | CUM 056.46N 7749.50W3420
62 | CVER 431.27N 74 4.43W3604
63 | CVIL1 410.62N 7332.20W 462
64 | DBB 7 1.08N 7612.60W 756
65 | DORAC 343.79N 7351.17W 824
66 | DRL01 942.53N 7339.90W 68
67 | DRL02 944.12N 7316.23W 140
68 | DRL03 923.50N 7328.50W 86
69 | DRL04 936.44N 7331.41W 81
70 | DRL05 937.47N 7328.60W 89
71 | DRL06 934.62N 7328.36W 81
72 | DRL07 936.44N 7331.41W 81
73 | EZNC 737.54N 7319.03W 479
74 | FLO2 134.96N 7539.16W 365
75 | FOM 428.50N 7351.56W2383
76 | GARC 211.20N 7529.59W1999
77 | GR1C 3 0.18N 7810.02W 39
78 | GRPC 258.05N 7810.37W 13
79 | GUA 232.70N 7237.62W 217
80 | GUY2C 513.45N 7521.88W3605
81 | HEL 611.45N 7531.74W2857
82 | HI1C 7 7.99N 7539.53W 595
83 | HI2C 7 7.86N 7539.41W 764
84 | HI3C 7 8.19N 7539.15W 453
85 | HI4C 7 8.03N 7538.79W 479
86 | HI5C 7 9.16N 7539.50W 840
87 | HI6C 7 8.05N 7539.95W 496
88 | HI7C 7 7.58N 7540.11W 505
89 | HI8C 7 7.53N 7540.81W 902
90 | IBA1C 426.82N 7514.10W1289
91 | JAMC 312.89N 7640.41W1760
92 | LCBC 851.43N 7622.06W 75
93 | LL1C 936.46N 7331.40W 49
94 | LL5C 944.98N 7343.27W 32
95 | LL6C 944.12N 7316.23W 158
96 | LL7C 920.37N 7326.23W 140
97 | LL8C 920.35N 7347.81W 58
98 | MACC 2 8.71N 7350.86W 283
99 | MAL 4 0.60N 7719.91W 112
100 | MAN1C 5 4.29N 7531.46W2199
101 | MAP 4 0.22N 8136.36W 137
102 | MARO 250.55N 7557.27W2207
103 | MEDEC 616.56N 7535.36W1552
104 | MON 846.71N 7539.90W 109
105 | MORC 816.73N 7358.51W 576
106 | MTTC 712.74N 7625.48W 234
107 | NIZA 5 3.47N 7528.24W2240
108 | NOR 533.81N 7452.15W 536
109 | OCA 814.33N 7319.16W1264
110 | OCNC 0 0.00N 7319.16W 0
111 | ORTC 354.54N 7514.76W 446
112 | PAL 454.30N 7616.98W 675
113 | PAM 720.37N 7241.97W3676
114 | PAS1 111.34N 7719.92W3227
115 | PAS2 113.26N 7715.06W2641
116 | PDSC 659.53N 73 3.85W 958
117 | PDSC 659.52N 73 3.86W 958
118 | PERC1 448.56N 7543.40W1354
119 | PERC2 448.50N 7543.42W1323
120 | PERC3 448.23N 7543.47W1300
121 | PGA1 344.67N 7134.29W 186
122 | PGA1B 346.09N 7134.39W 218
123 | PGA3 353.90N 7133.94W 191
124 | PGA4 351.82N 7125.28W 189
125 | PGA5 356.77N 7118.90W 204
126 | PGA5B 355.16N 7121.80W 198
127 | PGA6 346.52N 7119.84W 177
128 | PIRM 454.18N 7516.98W4473
129 | PIZC 457.92N 7721.58W 38
130 | PLNC 311.67N 7538.74W1229
131 | POP2 232.41N 7640.55W1869
132 | PRA 342.83N 7453.17W 457
133 | PRV1322.57N 8121.81W 38
134 | PTA 7 8.83N 7748.50W 78
135 | PTB 632.37N 7427.38W 260
136 | PTGC 411.94N 72 8.03W 170
137 | PTLC 010.23N 7447.80W 240
138 | QUBC 544.93N 7631.15W 92
139 | QUET 422.83N 7352.99W2196
140 | RAC2C 322.34N 7631.77W 988
141 | RECRC 457.62N 7521.15W4136
142 | RGSC 422.09N 7411.18W3276
143 | RNCC1334.42N 80 5.51W 3
144 | ROSC 450.69N 7419.27W2987
145 | RUS 553.55N 73 4.99W3697
146 | SAIC1232.23N 8142.72W 31
147 | SBTC 428.65N 7417.24W2710
148 | SERC1417.18N 8021.89W 0
149 | SJC 953.80N 7510.77W 596
150 | SMAR11 9.83N 7413.47W 122
151 | SML 848.06N 74 4.28W 116
152 | SML1C 851.75N 7359.54W 36
153 | SMORC 434.47N 7410.20W2822
154 | SNPBC 737.39N 74 2.73W 149
155 | SOL 613.59N 7724.52W 38
156 | SOTO 2 8.10N 7636.48W3795
157 | SPBC 539.13N 74 4.34W 783
158 | TABC 5 0.68N 7412.26W3500
159 | TAM 626.13N 7147.48W 462
160 | TAPM 427.18N 7520.09W2229
161 | TOL 435.12N 7519.21W2531
162 | TOL 435.12N 7519.22W2577
163 | TUM 149.42N 7843.60W 50
164 | TUM3C 149.44N 7844.70W 14
165 | TVCAC 443.07N 74 5.08W2685
166 | URE 745.10N 7531.96W 251
167 | URI1142.12N 7159.58W 68
168 | URMC 314.83N 7422.73W 725
169 | VALLC1030.48N 7315.48W 354
170 | VIL 4 6.72N 7341.61W1109
171 | VMM05 754.41N 7333.42W 86
172 | VMM07 721.61N 7351.11W 91
173 | VMM09 7 7.61N 7317.39W1079
174 | VMM10 646.02N 7343.50W 165
175 | VMM11 726.28N 7334.24W 84
176 | VMM12 8 5.19N 7353.32W 66
177 | YOT 359.01N 7620.70W1040
178 | YPLC 523.81N 7222.81W 696
179 | ZAR 729.54N 7451.48W 205
180 |
181 | 4.800 0.000
182 | 6.600 4.000
183 | 7.000 25.000B
184 | 8.000 32.000N
185 | 8.100 40.000
186 | 8.200100.000
187 | 8.300200.000
188 |
189 | 2 100 800 1.78
190 | TES
--------------------------------------------------------------------------------
/SeisMonitor/monitor/locator/hypocenter/__init__.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ecastillot/SeisMonitor/fa5acfd767f93b5d3a6010822127936319ddd6c0/SeisMonitor/monitor/locator/hypocenter/__init__.py
--------------------------------------------------------------------------------
/SeisMonitor/monitor/locator/hypocenter/__pycache__/utils.cpython-37.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ecastillot/SeisMonitor/fa5acfd767f93b5d3a6010822127936319ddd6c0/SeisMonitor/monitor/locator/hypocenter/__pycache__/utils.cpython-37.pyc
--------------------------------------------------------------------------------
/SeisMonitor/monitor/locator/hypocenter/core.py:
--------------------------------------------------------------------------------
1 | import os
2 | from obspy.core.event.catalog import Catalog, read_events
3 | from SeisMonitor.utils import printlog, isfile
4 | from . import utils as ut
5 |
6 | class Hypocenter:
7 | """
8 | A class for handling hypocenter localization using SEISAN format.
9 |
10 | Attributes:
11 | catalog (Catalog): ObsPy Catalog object containing earthquake events.
12 | xml_path (str): Path to the station metadata XML file.
13 | vel_path (str): Path to the velocity model CSV file.
14 | out_dir (str): Directory where output files will be stored.
15 | out_file (str): Path to the final relocated earthquake catalog.
16 | paths (str): Directory for Hypocenter-related intermediate files.
17 | sta0 (str): Path to the STATION0.HYP file used by SEISAN.
18 | """
19 | def __init__(self, catalog: str, xml_path: str, vel_path: str, out_dir: str):
20 | """
21 | Initializes the Hypocenter class with the necessary input files and directories.
22 |
23 | Args:
24 | catalog (str or Catalog): Path to an earthquake catalog file or an ObsPy Catalog object.
25 | xml_path (str): Path to the station metadata XML file.
26 | vel_path (str): Path to the CSV file containing the velocity model.
27 | out_dir (str): Directory where output files will be stored.
28 | """
29 | if isinstance(catalog, Catalog):
30 | self.catalog = catalog
31 | else:
32 | self.catalog = read_events(catalog)
33 |
34 | self.xml_path = xml_path
35 | self.vel_path = vel_path
36 | self.out_dir = out_dir
37 |
38 | # Define paths for output files
39 | self.out_file = os.path.join(self.out_dir, "hypocenter", "hypocenter_events.xml")
40 | self.paths = os.path.join(self.out_dir, "hypocenter", "hypocenter_paths")
41 | self.sta0 = os.path.join(self.paths, "STATION0.HYP")
42 |
43 | def locate(self, sfilename: str = "catalog.sfile", out_format: str = "QUAKEML", rm_not_locatable: bool = True) -> Catalog:
44 | """
45 | Runs the hypocenter localization process.
46 |
47 | Args:
48 | sfilename (str, optional): Name of the S-file to be used. Defaults to "catalog.sfile".
49 | out_format (str, optional): Output format for the relocated catalog. Defaults to "QUAKEML".
50 | rm_not_locatable (bool, optional): Whether to remove events that cannot be relocated. Defaults to True.
51 |
52 | Returns:
53 | Catalog: The relocated earthquake catalog.
54 | """
55 | # Define the path for the S-file
56 | sfile = os.path.join(self.paths, sfilename)
57 | isfile(sfile)
58 |
59 | # Write the event catalog to S-file format
60 | self.catalog.write(sfile, format="NORDIC")
61 |
62 | # Generate the STATION0 file
63 | sta0 = ut.STATION0(self.xml_path, self.vel_path)
64 | sta0.write(self.sta0)
65 |
66 | # Run hypocenter tools
67 | hyp = ut.HypocenterTools(self.paths, sfilename)
68 | hyp.split()
69 | hyp.remodl_and_setbrn()
70 | hyp.update()
71 |
72 | # Check the integrity of the S-files
73 | ut.check_sfile_integrity(self.paths, rm_not_locatable)
74 |
75 | # Collect relocated events into a new catalog
76 | catalog = hyp.collect()
77 |
78 | # Write the output catalog if an output file path is specified
79 | if self.out_file is not None:
80 | print("Writing output file...")
81 | isfile(self.out_file)
82 | catalog.write(self.out_file, out_format)
83 |
84 | return catalog
85 |
--------------------------------------------------------------------------------
/SeisMonitor/monitor/locator/hypocenter/libgfortran.so.3.0.0:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ecastillot/SeisMonitor/fa5acfd767f93b5d3a6010822127936319ddd6c0/SeisMonitor/monitor/locator/hypocenter/libgfortran.so.3.0.0
--------------------------------------------------------------------------------
/SeisMonitor/monitor/locator/hypocenter/test/12-2223-00L.S202106:
--------------------------------------------------------------------------------
1 | 2021 612 2222 46.9 L 4.657 -72.403 1.9 CSE 6 3.7 1
2 | OLDACT:UPD 22-01-31 08:21 OP:ed STATUS: ID:20210612222300 3
3 | OLDACT:REG 15-11-17 19:58 OP:xxx STATUS: ID:20210612222300 3
4 | GAP=355 CSE 9.47 999.9 999.9999.9 -0.7720E+09 -0.9853E+08 0.1385E+09E
5 | ACTION:UPD 22-06-15 06:57 OP:usr STATUS: ID:20210612222300 I
6 | STAT SP IPHASW D HRMM SECON CODA AMPLIT PERI AZIMU VELO AIN AR TRES W DIS CAZ7
7 | STA1 EZ EP 2223 7.42 18 -2.6310 115 145
8 | STA1 EZ ES 2223 22.27 10 -9.2410 115 145
9 | STA6 EZ EP 2223 10.43 18 -0.5310 122 146
10 | STA6 EZ ES 2223 31.31 10 -1.8310 122 146
11 | STA5 EZ EP 2223 10.78 18 -0.2410 123 147
12 | STA5 EZ ES 2223 32.37 10 -0.8710 123 147
13 | STA4 EZ EP 2223 12.07 18 0.6110 126 145
14 | STA4 EZ ES 2223 36.22 10 2.1910 126 145
15 | STA2 EZ EP 2223 12.59 18 1.0210 127 142
16 | STA2 EZ ES 2223 37.78 10 3.5610 127 142
17 | STA3 EZ EP 2223 13.86 18 1.8810 131 147
18 | STA3 EZ ES 2223 41.59 10 6.6410 131 147
19 |
20 |
--------------------------------------------------------------------------------
/SeisMonitor/monitor/locator/nlloc/__init__.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ecastillot/SeisMonitor/fa5acfd767f93b5d3a6010822127936319ddd6c0/SeisMonitor/monitor/locator/nlloc/__init__.py
--------------------------------------------------------------------------------
/SeisMonitor/monitor/magnitude/__init__.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ecastillot/SeisMonitor/fa5acfd767f93b5d3a6010822127936319ddd6c0/SeisMonitor/monitor/magnitude/__init__.py
--------------------------------------------------------------------------------
/SeisMonitor/monitor/magnitude/__pycache__/__init__.cpython-37.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ecastillot/SeisMonitor/fa5acfd767f93b5d3a6010822127936319ddd6c0/SeisMonitor/monitor/magnitude/__pycache__/__init__.cpython-37.pyc
--------------------------------------------------------------------------------
/SeisMonitor/monitor/magnitude/__pycache__/mag.cpython-37.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ecastillot/SeisMonitor/fa5acfd767f93b5d3a6010822127936319ddd6c0/SeisMonitor/monitor/magnitude/__pycache__/mag.cpython-37.pyc
--------------------------------------------------------------------------------
/SeisMonitor/monitor/magnitude/__pycache__/utils.cpython-37.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ecastillot/SeisMonitor/fa5acfd767f93b5d3a6010822127936319ddd6c0/SeisMonitor/monitor/magnitude/__pycache__/utils.cpython-37.pyc
--------------------------------------------------------------------------------
/SeisMonitor/monitor/picker/__init__.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ecastillot/SeisMonitor/fa5acfd767f93b5d3a6010822127936319ddd6c0/SeisMonitor/monitor/picker/__init__.py
--------------------------------------------------------------------------------
/SeisMonitor/plot/.bck/picks copy.py:
--------------------------------------------------------------------------------
1 | from obspy.clients.fdsn import Client
2 | from obspy.core.utcdatetime import UTCDateTime
3 | from obspy.realtime.signal import scale
4 | # from obspy.core.stream import Stream
5 |
6 | import matplotlib.pyplot as plt
7 | import matplotlib.cm as cm
8 | import datetime as dt
9 | import pandas as pd
10 | import numpy as np
11 | from mpl_toolkits.axes_grid1 import make_axes_locatable
12 | import matplotlib.gridspec as gs
13 | import matplotlib.dates as mdates
14 | from . import utils as ut
15 |
16 | def get_multiple_picker_figure():
17 | fig = plt.figure(figsize=(12,12))
18 | gs1 = gs.GridSpec(1, 1, figure=fig)
19 | gs1.update(left=0.05, right=0.9, wspace=0.05)
20 |
21 | gss = gs.GridSpecFromSubplotSpec(4, 1,subplot_spec=gs1[0], hspace=0.0,height_ratios=[4,0.6,0.6,0.6])
22 | ax0 = fig.add_subplot(gss[0])
23 | ax0.tick_params(axis="x", labelbottom=0)
24 | ax0.set_yticks([])
25 | ax1 = fig.add_subplot(gss[1], sharex=ax0)
26 | ax1.tick_params(axis="x", labelbottom=0)
27 | ax1.set_yticks([])
28 | ax2 = fig.add_subplot(gss[2], sharex=ax0)
29 | ax2.tick_params(axis="x", labelbottom=0)
30 | ax2.set_yticks([])
31 | ax3 = fig.add_subplot(gss[3], sharex=ax0)
32 | ax3.set_yticks([])
33 | fig.autofmt_xdate()
34 |
35 | gs2 = gs.GridSpec(1, 1)
36 | gs2.update(left=0.92, right=0.96, hspace=0.2)
37 | gss2 = gs.GridSpecFromSubplotSpec(1, 2,subplot_spec=gs2[0], hspace=0.5,width_ratios=[1,1])
38 | ax4 = fig.add_subplot(gss2[0])
39 | ax4.set_yticks([])
40 | ax4.set_xticks([])
41 | ax5 = fig.add_subplot(gss2[1],sharey=ax4)
42 | # ax4 = plt.subplot(gs2[:, 0])
43 | # ax5 = plt.subplot(gs2[:, 1])
44 | ax5.set_yticks([])
45 | ax5.set_xticks([])
46 | ax5.text(1.1,0.5,"Probability", size=10,
47 | verticalalignment='center', rotation=270)
48 |
49 | return fig, [ax0,ax1,ax2,ax3,ax4,ax5]
50 |
51 | def plot_multiple_picker(st,info):
52 |
53 | fig,ax = get_multiple_picker_figure()
54 |
55 | st.merge(fill_value=0)
56 | st.detrend('demean')
57 | st.taper(max_percentage=0.001, type='cosine', max_length=2)
58 | st.filter(type='bandpass', freqmin = 1.0, freqmax = 45, corners=2, zerophase=True)
59 | st.trim(min([tr.stats.starttime for tr in st]), max([tr.stats.endtime for tr in st]), pad=True, fill_value=0)
60 |
61 | tr = st[0]
62 |
63 | starttime = tr.stats.starttime
64 | endtime = tr.stats.endtime
65 | xlabel_date = starttime.strftime("%Y/%m/%d %H:%M:%S")
66 | STARTTIME = mdates.date2num(starttime.datetime)
67 |
68 | # tr.data = scale(tr,factor=1)
69 | x = tr.times("matplotlib")-STARTTIME
70 | ax[0].plot(x, tr.data, "k-")
71 | # ax[0].plot(tr.times("matplotlib"), tr.data, "k-")
72 | ax[0].xaxis_date()
73 | # ax[0].xaxis.set_major_formatter(mdates.DateFormatter('%M'))
74 | ax[0].xaxis.set_major_formatter(mdates.DateFormatter('%S'))
75 | ax[0].set_xlim([min(x),max(x)])
76 | ax[3].set_xlabel(f"Seconds from {xlabel_date}", size=20)
77 | # ax[3].set_xlabel(f"Minutes from {xlabel_date}", size=20)
78 | ymin, ymax = ax[0].get_ylim()
79 |
80 |
81 | # print(df)
82 | # https://stackoverflow.com/questions/8342549/matplotlib-add-colorbar-to-a-sequence-of-line-plots
83 | Pcmap = cm.winter.reversed()
84 | Scmap = cm.autumn.reversed()
85 | for i,(picker,csv) in enumerate(info.items(),1):
86 | df = ut.get_picks(csv,starttime,endtime,
87 | station_list=[tr.stats.station])
88 | for j, (_, row) in enumerate(df.iterrows()):
89 | pick = mdates.date2num(row['arrival_time'])-STARTTIME
90 | # pick = row['arrival_time']
91 | if row['phasehint'].upper() == 'P':
92 | color = Pcmap(row['probability']-0.001) # -0.001 por un bug en Cbar
93 | elif row['phasehint'].upper() == 'S':
94 | color = Scmap(row['probability']-0.001)
95 |
96 | print(row['probability'])
97 | ax[i].vlines(pick, ymin, ymax, color=color,
98 | linewidth=0.5,
99 | label=row['phasehint'])
100 | ax[i].set_facecolor('lightgray')
101 | ax[i].set_yticks([])
102 | ax[i].set_ylabel(picker,rotation=0,labelpad=10,fontsize=8)
103 |
104 | # # fig.autofmt_xdate()
105 |
106 |
107 | Pclb = fig.colorbar(cm.ScalarMappable(cmap=Pcmap), cax=ax[4],orientation="vertical")
108 | Pclb.ax.tick_params(labelsize=0.7)
109 | Pclb.ax.set_title('P',fontsize=20)
110 | Sclb = fig.colorbar(cm.ScalarMappable(cmap=Scmap), cax=ax[5],orientation="vertical")
111 | Sclb.ax.set_title('S',fontsize=20)
112 | # Sclb.ax.set_title('Probability',fontsize=10)
113 |
114 | fig.autofmt_xdate()
115 | plt.show()
116 |
--------------------------------------------------------------------------------
/SeisMonitor/plot/__init__.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ecastillot/SeisMonitor/fa5acfd767f93b5d3a6010822127936319ddd6c0/SeisMonitor/plot/__init__.py
--------------------------------------------------------------------------------
/SeisMonitor/plot/__pycache__/picks.cpython-37.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ecastillot/SeisMonitor/fa5acfd767f93b5d3a6010822127936319ddd6c0/SeisMonitor/plot/__pycache__/picks.cpython-37.pyc
--------------------------------------------------------------------------------
/SeisMonitor/plot/__pycache__/picks.cpython-39.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ecastillot/SeisMonitor/fa5acfd767f93b5d3a6010822127936319ddd6c0/SeisMonitor/plot/__pycache__/picks.cpython-39.pyc
--------------------------------------------------------------------------------
/SeisMonitor/plot/__pycache__/utils.cpython-37.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ecastillot/SeisMonitor/fa5acfd767f93b5d3a6010822127936319ddd6c0/SeisMonitor/plot/__pycache__/utils.cpython-37.pyc
--------------------------------------------------------------------------------
/SeisMonitor/plot/__pycache__/utils.cpython-39.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ecastillot/SeisMonitor/fa5acfd767f93b5d3a6010822127936319ddd6c0/SeisMonitor/plot/__pycache__/utils.cpython-39.pyc
--------------------------------------------------------------------------------
/SeisMonitor/plot/mpt.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ecastillot/SeisMonitor/fa5acfd767f93b5d3a6010822127936319ddd6c0/SeisMonitor/plot/mpt.png
--------------------------------------------------------------------------------
/SeisMonitor/plot/picks.py:
--------------------------------------------------------------------------------
1 | from obspy.clients.fdsn import Client
2 | from obspy.core.utcdatetime import UTCDateTime
3 | from obspy.realtime.signal import scale
4 | # from obspy.core.stream import Stream
5 |
6 | import matplotlib.pyplot as plt
7 | import matplotlib.cm as cm
8 | import datetime as dt
9 | import pandas as pd
10 | import numpy as np
11 | import json
12 | from mpl_toolkits.axes_grid1 import make_axes_locatable
13 | import matplotlib.gridspec as gs
14 | import matplotlib.dates as mdates
15 | from . import utils as ut
16 | # import utils as ut
17 | from matplotlib.dates import DateFormatter
18 | from matplotlib.transforms import blended_transform_factory
19 |
20 | class Tracer():
21 | def __init__(self,provider,picks):
22 | self.provider = provider
23 | self.picks = picks
24 |
25 | def plot(self,show=True):
26 | waveform_restrictions = self.provider.waveform_restrictions
27 | processing = self.provider.processing
28 | st = self.provider.client.get_waveforms(waveform_restrictions.network,
29 | waveform_restrictions.station,
30 | waveform_restrictions.location,
31 | waveform_restrictions.channel,
32 | waveform_restrictions.starttime,
33 | waveform_restrictions.endtime)
34 | fig = ut.plot_multiple_picker(st,self.picks,processing )
35 | if show:
36 | plt.show()
37 | return fig
38 |
39 | class Streamer():
40 | def __init__(self,providers,picks):
41 | self.providers = providers
42 | self.picks = picks
43 |
44 | def plot(self,picker,starttime,endtime,
45 | order,
46 | fontsize=6,
47 | show=True):
48 |
49 | picker_csv = self.picks[picker]
50 | streams = ut.get_ordered_streams(self.providers,order,
51 | starttime,endtime)
52 | fig = ut.get_streamer_plot(streams,picker_csv,
53 | starttime,endtime,
54 | fontsize,show)
55 | return fig
56 |
57 | def plot_by_station(self,picker,netsta,n_picks=50,
58 | align="S",
59 | phase_second = 2,
60 | window = 15,
61 | show=True):
62 |
63 | picker_csv = self.picks[picker]
64 | df = ut.get_picks(picker_csv,
65 | select_networks=[netsta[0]],
66 | select_stations=[netsta[1]])
67 | fig = ut.get_plot_by_station(self.providers,netsta,
68 | df,n_picks,align,phase_second,
69 | window,
70 | show)
71 | return fig
72 |
73 | if __name__ == "__main__":
74 | client = Client(base_url='http://sismo.sgc.gov.co:8080/')
75 |
76 | eqt_csv = "/home/emmanuel/EDCT/test/picks/eqt/seismonitor_picks.csv"
77 | sgc_csv = "/home/emmanuel/EDCT/test/picks/eqt/seismonitor_picks.csv"
78 | phasenet_csv = "/home/emmanuel/EDCT/test/picks/eqt/seismonitor_picks.csv"
79 | picks = {"EQT":eqt_csv,"PNET":phasenet_csv,"SGC":sgc_csv}
80 |
81 | # Trace(client,picks)
82 | # # client = Client(base_url='http://10.100.100.232:8091')
83 | # # starttime = UTCDateTime("20191224T185959")
84 | # starttime = UTCDateTime("20191224T190600")
85 | # endtime = UTCDateTime("20191224T191359")
86 | # st = client.get_waveforms(network="CM",station="URMC",
87 | # location="*",
88 | # channel="HHZ",
89 | # starttime=starttime,
90 | # endtime=endtime)
91 |
92 | # # csvs = [eqt_csv,sgc_csv,phasenet_csv]
93 |
94 | # # df = get_picks(phasenet_csv,starttime,endtime)
95 | # # print(df)
96 | # fig = plot_multiple_picker(st,csvs)
97 | # fig.savefig("/home/emmanuel/EDCT/SeisMonitor/SeisMonitor/plot/mpt.png",dpi=300)
98 | # # plt.show()
--------------------------------------------------------------------------------
/SeisMonitor/utils.py:
--------------------------------------------------------------------------------
1 | # /**
2 | # * @author [Emmanuel Castillo]
3 | # * @email [excastillot@unal.edu.co]
4 | # * @create date 2021-12-22 09:38:11
5 | # * @modify date 2021-12-22 09:38:11
6 | # * @desc [description]
7 | # */
8 |
9 | """
10 | Utils functions used in the SeisMonitor Module
11 | """
12 |
13 | import logging
14 | import os
15 | import sys
16 |
17 | # logging.basicConfig(level=logging.INFO,
18 | # format='%(asctime)s [%(levelname)s] [%(name)s] %(message)s',
19 | # datefmt='%m-%d %H:%M')
20 |
21 | logger = logging.getLogger("SeisMonitor")
22 | logger.setLevel(logging.INFO)
23 | # Prevent propagating to higher loggers.
24 | logger.propagate = 0
25 | # Console log handler.
26 | ch = logging.StreamHandler()
27 | ch.setLevel(logging.INFO)
28 | # Add formatter
29 | formatter = logging.Formatter(
30 | '%(asctime)s [%(levelname)s] [%(name)s] %(message)s',
31 | '%m-%d %H:%M')
32 | ch.setFormatter(formatter)
33 | logger.addHandler(ch)
34 |
35 | def validate(func, locals):
36 | """
37 | Validates the types of arguments in a function according to the annotations defined in the function.
38 |
39 | Parameters
40 | ----------
41 | func : function
42 | The function whose arguments are being validated.
43 |
44 | locals : dict
45 | A dictionary of the local variables (arguments) to be validated, typically passed using `locals()`.
46 |
47 | Returns
48 | -------
49 | None
50 | This function does not return a value. It raises an AssertionError if an argument does not match its expected type.
51 |
52 | Raises
53 | ------
54 | AssertionError
55 | If any argument does not match the expected type as defined in the function's annotations.
56 |
57 | Notes
58 | -----
59 | The function compares the actual argument values in `locals` with the expected types defined in the `__annotations__` attribute of `func`.
60 | If the type check fails, an error message is raised indicating which argument failed and the expected type(s).
61 | """
62 | for var, test in func.__annotations__.items():
63 | try:
64 | test = test.__args__
65 | _test_msg = " or ".join(map(str,test))
66 | except:
67 | test = test
68 | _test_msg = test
69 |
70 | if var == "return":
71 | continue
72 | value = locals[var]
73 | msg = f"Error in {func}: {var} argument must be {_test_msg}"
74 | assert isinstance(value,test),msg
75 |
76 | def printlog(levelname,name,msg,configure_logging=True):
77 | """
78 | Parameters:
79 | -----------
80 | levelname: str
81 | logger levelname
82 | available: "info","warning,"error"
83 | name: str
84 | Subject
85 | msg: str
86 | Message that you want to print
87 |
88 | """
89 | new_logger = logger.getChild(name)
90 | if levelname in ("info","information","INFO","Info","INFORMATION"):
91 | new_logger.info(msg)
92 | elif levelname in ("debug","DEBUG","Debug"):
93 | new_logger.debug(msg)
94 | elif levelname in ("warning","Warning","WARNING"):
95 | new_logger.warning(msg)
96 | elif levelname in ("error","ERROR"):
97 | new_logger.error(msg)
98 |
99 | def isfile(filepath,overwrite=False):
100 | """
101 | Parameters:
102 | filepath: file path will be saved
103 | Returns:
104 | Make the directories needed to save the file.
105 | If the file is already exist, then ask to the user if want to replace it.
106 | """
107 |
108 |
109 | dirpath = os.path.dirname(filepath)
110 | if os.path.isdir(dirpath ) == False:
111 | os.makedirs(dirpath)
112 | else:
113 | pass
114 | if overwrite:
115 | return True
116 |
117 | if os.path.isfile(filepath) == True:
118 | while True:
119 | inp = input(f"{filepath} is already created. Dou you want to replace it? (y or n)")
120 | if inp.upper() == "Y":
121 | os.remove(filepath)
122 | return False
123 | elif inp.upper() == "N":
124 | return True
125 | else:
126 | pass
127 | else:
128 | return False
129 |
130 |
--------------------------------------------------------------------------------
/SeisMonitor/utils4examples.py:
--------------------------------------------------------------------------------
1 | import os
2 | import shutil
3 | from git import Repo
4 | from obspy.core.utcdatetime import UTCDateTime
5 | from obspy.clients.fdsn import Client as FDSNClient
6 | from SeisMonitor.core.objects import WaveformRestrictions,Provider
7 | from SeisMonitor.monitor.downloader.seismonitor import MseedDownloader
8 |
9 | def clone_seismonitor_data(output_folder,branch):
10 | """
11 | Clones the SeisMonitor repository from GitHub into a specified folder.
12 |
13 | Parameters
14 | ----------
15 | output_folder : str
16 | The path to the folder where the repository will be cloned.
17 | branch : str
18 | The branch of the repository to clone.
19 |
20 | Returns
21 | -------
22 | bool
23 | Returns True if the cloning operation was successful.
24 |
25 | Notes
26 | -----
27 | If the target folder already exists, it will be removed before cloning the repository.
28 | """
29 | git_url = "https://github.com/ecastillot/SeisMonitor.git"
30 |
31 | if os.path.isdir(output_folder):
32 | shutil.rmtree(output_folder)
33 |
34 | Repo.clone_from(git_url, output_folder,branch=branch)
35 | return True
36 |
37 |
38 | def quick_download(out_download_folder):
39 | """
40 | Downloads waveform data from the Colombian Seismological Network (SGC) for a predefined time period and location range.
41 |
42 | Parameters
43 | ----------
44 | out_download_folder : str
45 | The path to the folder where the downloaded data will be stored.
46 |
47 | Returns
48 | -------
49 | None
50 | This function does not return any values but saves the downloaded data in the specified folder.
51 |
52 | Notes
53 | -----
54 | This function defines a specific time window (from 2019-12-24T19:00 to 2019-12-25T01:00) and a set of stations.
55 | The data is downloaded in MiniSEED format, and metadata is also saved as a JSON file.
56 |
57 | Side Effects
58 | ------------
59 | Downloads waveform data into the given folder, including creating directories if needed.
60 | """
61 |
62 | sgc_rest = WaveformRestrictions(network="CM",
63 | station="URMC,VILL,PRA,ORTC,GARC,FLO2,CHI,YOT",
64 | location="*",
65 | channel="*",
66 | starttime=UTCDateTime("2019-12-24T19:00:00.000000Z"),
67 | endtime=UTCDateTime("2019-12-25T01:00:00.000000Z"),
68 | location_preferences=["","00","20","10","40"],
69 | channel_preferences=["HH","BH","EH","HN","HL"],
70 | filter_networks=[],
71 | filter_stations=[],
72 | filter_domain= [-83.101,-64.549,-2.229,14.945],
73 | )
74 | sgc_client = FDSNClient('http://sismo.sgc.gov.co:8080')
75 | sgc_provider = Provider(sgc_client,sgc_rest)
76 | md = MseedDownloader(providers=[sgc_provider])
77 | json_path = os.path.join(out_download_folder,"stations")
78 | inv,json = md.make_inv_and_json(json_path)
79 | mseed_storage = os.path.join(out_download_folder,"archive","{station}/{network}.{station}.{location}.{channel}__{starttime}__{endtime}.mseed")
80 | md.download(mseed_storage,
81 | picker_args={"batch_size":100,"overlap":0.3,"length":60},
82 | chunklength_in_sec=7200,n_processor=None)
83 |
84 | if __name__ == "__main__":
85 | clone_seismonitor_data("/home/emmanuel/EDCT/seismonitor_dataset")
--------------------------------------------------------------------------------
/docs/Makefile:
--------------------------------------------------------------------------------
1 | # Minimal makefile for Sphinx documentation
2 | #
3 |
4 | # You can set these variables from the command line, and also
5 | # from the environment for the first two.
6 | SPHINXOPTS ?=
7 | SPHINXBUILD ?= sphinx-build
8 | SOURCEDIR = .
9 | BUILDDIR = _build
10 |
11 | # Put it first so that "make" without argument is like "make help".
12 | help:
13 | @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
14 |
15 | .PHONY: help Makefile
16 |
17 | # Catch-all target: route all unknown targets to Sphinx using the new
18 | # "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
19 | %: Makefile
20 | @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
21 |
--------------------------------------------------------------------------------
/docs/SeisMonitor.core.rst:
--------------------------------------------------------------------------------
1 | Core
2 | ========================
3 |
4 | client
5 | ------------------------------
6 |
7 | .. automodule:: SeisMonitor.core.client
8 | :members:
9 | :undoc-members:
10 | :show-inheritance:
11 |
12 |
13 |
14 | Example
15 | -------
16 |
17 | Let's say that the data structure is organized as follows:
18 |
19 | ``{root_path}/{field_name}/seedfiles/{year}-{month:02d}/{year}-{month:02d}-{day:02d}/{network}.{station}.{location}.{channel}.{year}.{julianday:03d}``
20 |
21 | ``LocalClient`` is designed to upload local data.
22 |
23 | .. code:: python
24 |
25 | root_path = "/home/emmanuel/myarchive"
26 | client = LocalClient(root_path, "/seedfiles/{year}-{month:02d}/{year}-{month:02d}-{day:02d}/{network}.{station}.{location}.{channel}.{year}.{julianday:03d}")
27 | st = client.get_waveforms("YY", "XXXX", "00",
28 | channel="HHZ", starttime=UTCDateTime("20220102T000100"),
29 | endtime=UTCDateTime("20220102T000200"))
30 |
31 | It inherits the SDS client functionalities.
32 |
33 | objects
34 | -------------------------------
35 |
36 | .. automodule:: SeisMonitor.core.objects
37 | :members:
38 | :undoc-members:
39 | :show-inheritance:
40 |
41 | utils
42 | -----------------------------
43 |
44 | .. automodule:: SeisMonitor.core.utils
45 | :members:
46 | :undoc-members:
47 | :show-inheritance:
48 |
49 |
--------------------------------------------------------------------------------
/docs/SeisMonitor.monitor.associator.rst:
--------------------------------------------------------------------------------
1 | Associator
2 | ==========
3 |
4 | ai
5 | ----------------------------------------
6 |
7 | .. automodule:: SeisMonitor.monitor.associator.ai
8 | :members:
9 | :undoc-members:
10 | :show-inheritance:
11 |
12 | utils
13 | -------------------------------------------
14 |
15 | .. automodule:: SeisMonitor.monitor.associator.utils
16 | :members:
17 | :undoc-members:
18 | :show-inheritance:
19 |
20 |
21 |
--------------------------------------------------------------------------------
/docs/SeisMonitor.monitor.downloader.rst:
--------------------------------------------------------------------------------
1 | Downloader
2 | ======================================
3 |
4 | seismonitor
5 | -------------------------------------------------
6 |
7 | .. automodule:: SeisMonitor.monitor.downloader.seismonitor
8 | :members:
9 | :undoc-members:
10 | :show-inheritance:
11 |
12 | utils
13 | -------------------------------------------
14 |
15 | .. automodule:: SeisMonitor.monitor.downloader.utils
16 | :members:
17 | :undoc-members:
18 | :show-inheritance:
19 |
20 |
--------------------------------------------------------------------------------
/docs/SeisMonitor.monitor.locator.hypoDD.rst:
--------------------------------------------------------------------------------
1 | HypoDD
2 | ==========================================
3 |
4 | core
5 | ----------------------------------------------
6 |
7 | .. automodule:: SeisMonitor.monitor.locator.hypoDD.core
8 | :members:
9 | :undoc-members:
10 | :show-inheritance:
11 |
12 | utils
13 | -----------------------------------------------
14 |
15 | .. automodule:: SeisMonitor.monitor.locator.hypoDD.utils
16 | :members:
17 | :undoc-members:
18 | :show-inheritance:
19 |
20 |
21 |
--------------------------------------------------------------------------------
/docs/SeisMonitor.monitor.locator.hypocenter.rst:
--------------------------------------------------------------------------------
1 | Hypocenter
2 | ==============================================
3 |
4 | core
5 | --------------------------------------------------
6 |
7 | .. automodule:: SeisMonitor.monitor.locator.hypocenter.core
8 | :members:
9 | :undoc-members:
10 | :show-inheritance:
11 |
12 | utils
13 | ---------------------------------------------------
14 |
15 | .. automodule:: SeisMonitor.monitor.locator.hypocenter.utils
16 | :members:
17 | :undoc-members:
18 | :show-inheritance:
19 |
--------------------------------------------------------------------------------
/docs/SeisMonitor.monitor.locator.nlloc.rst:
--------------------------------------------------------------------------------
1 | Nlloc
2 | =========================================
3 |
4 | Submodules
5 | ----------
6 |
7 | nlloc
8 | ----------------------------------------------
9 |
10 | .. automodule:: SeisMonitor.monitor.locator.nlloc.nlloc
11 | :members:
12 | :undoc-members:
13 | :show-inheritance:
14 |
15 | utils
16 | ----------------------------------------------
17 |
18 | .. automodule:: SeisMonitor.monitor.locator.nlloc.utils
19 | :members:
20 | :undoc-members:
21 | :show-inheritance:
22 |
23 |
24 |
--------------------------------------------------------------------------------
/docs/SeisMonitor.monitor.locator.rst:
--------------------------------------------------------------------------------
1 | Locator
2 | =======
3 |
4 | .. toctree::
5 | :maxdepth: 4
6 |
7 | SeisMonitor.monitor.locator.hypoDD
8 | SeisMonitor.monitor.locator.hypocenter
9 | SeisMonitor.monitor.locator.nlloc
10 |
11 | utils
12 | ----------------------------------------
13 |
14 | .. automodule:: SeisMonitor.monitor.locator.utils
15 | :members:
16 | :undoc-members:
17 | :show-inheritance:
18 |
19 |
--------------------------------------------------------------------------------
/docs/SeisMonitor.monitor.magnitude.rst:
--------------------------------------------------------------------------------
1 | Magnitude
2 | =========
3 |
4 | SeisMonitor.monitor.magnitude.mag module
5 | ----------------------------------------
6 |
7 | .. automodule:: SeisMonitor.monitor.magnitude.mag
8 | :members:
9 | :undoc-members:
10 | :show-inheritance:
11 |
12 | SeisMonitor.monitor.magnitude.utils module
13 | ------------------------------------------
14 |
15 | .. automodule:: SeisMonitor.monitor.magnitude.utils
16 | :members:
17 | :undoc-members:
18 | :show-inheritance:
19 |
--------------------------------------------------------------------------------
/docs/SeisMonitor.monitor.picker.rst:
--------------------------------------------------------------------------------
1 | Picker
2 | ==================================
3 |
4 | ai
5 | ------------------------------------
6 |
7 | .. automodule:: SeisMonitor.monitor.picker.ai
8 | :members:
9 | :undoc-members:
10 | :show-inheritance:
11 |
12 | utils
13 | ---------------------------------------
14 |
15 | .. automodule:: SeisMonitor.monitor.picker.utils
16 | :members:
17 | :undoc-members:
18 | :show-inheritance:
19 |
20 |
--------------------------------------------------------------------------------
/docs/SeisMonitor.monitor.rst:
--------------------------------------------------------------------------------
1 | Monitor
2 | ===========================
3 |
4 | .. toctree::
5 | :maxdepth: 4
6 |
7 | SeisMonitor.monitor.downloader
8 | SeisMonitor.monitor.picker
9 | SeisMonitor.monitor.associator
10 | SeisMonitor.monitor.locator
11 | SeisMonitor.monitor.magnitude
12 |
13 |
14 |
15 | SeisMonitor (All in one)
16 | --------------------------------------
17 |
18 | .. automodule:: SeisMonitor.monitor.seismonitor
19 | :members:
20 | :undoc-members:
21 | :show-inheritance:
22 |
23 |
--------------------------------------------------------------------------------
/docs/SeisMonitor.plot.rst:
--------------------------------------------------------------------------------
1 | Plot
2 | ========================
3 |
4 | Picks (In progress)
5 | -----------------------------
6 |
7 | .. automodule:: SeisMonitor.plot.picks
8 | :members:
9 | :undoc-members:
10 | :show-inheritance:
11 |
12 | utils
13 | -----------------------------
14 |
15 | .. automodule:: SeisMonitor.plot.utils
16 | :members:
17 | :undoc-members:
18 | :show-inheritance:
19 |
20 |
21 |
--------------------------------------------------------------------------------
/docs/SeisMonitor.rst:
--------------------------------------------------------------------------------
1 | SeisMonitor package
2 | ===================
3 |
4 | Subpackages
5 | -----------
6 |
7 | .. toctree::
8 | :maxdepth: 4
9 |
10 | SeisMonitor.core
11 | SeisMonitor.monitor
12 | SeisMonitor.plot
13 |
14 | Submodules
15 | ----------
16 |
17 | SeisMonitor.utils module
18 | ------------------------
19 |
20 | .. automodule:: SeisMonitor.utils
21 | :members:
22 | :undoc-members:
23 | :show-inheritance:
24 |
25 | SeisMonitor.utils4examples module
26 | ---------------------------------
27 |
28 | .. automodule:: SeisMonitor.utils4examples
29 | :members:
30 | :undoc-members:
31 | :show-inheritance:
32 |
33 | Module contents
34 | ---------------
35 |
36 | .. automodule:: SeisMonitor
37 | :members:
38 | :undoc-members:
39 | :show-inheritance:
40 |
--------------------------------------------------------------------------------
/docs/_build/doctrees/SeisMonitor.core.doctree:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ecastillot/SeisMonitor/fa5acfd767f93b5d3a6010822127936319ddd6c0/docs/_build/doctrees/SeisMonitor.core.doctree
--------------------------------------------------------------------------------
/docs/_build/doctrees/SeisMonitor.doctree:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ecastillot/SeisMonitor/fa5acfd767f93b5d3a6010822127936319ddd6c0/docs/_build/doctrees/SeisMonitor.doctree
--------------------------------------------------------------------------------
/docs/_build/doctrees/SeisMonitor.examples.doctree:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ecastillot/SeisMonitor/fa5acfd767f93b5d3a6010822127936319ddd6c0/docs/_build/doctrees/SeisMonitor.examples.doctree
--------------------------------------------------------------------------------
/docs/_build/doctrees/SeisMonitor.monitor.associator.doctree:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ecastillot/SeisMonitor/fa5acfd767f93b5d3a6010822127936319ddd6c0/docs/_build/doctrees/SeisMonitor.monitor.associator.doctree
--------------------------------------------------------------------------------
/docs/_build/doctrees/SeisMonitor.monitor.doctree:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ecastillot/SeisMonitor/fa5acfd767f93b5d3a6010822127936319ddd6c0/docs/_build/doctrees/SeisMonitor.monitor.doctree
--------------------------------------------------------------------------------
/docs/_build/doctrees/SeisMonitor.monitor.downloader.doctree:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ecastillot/SeisMonitor/fa5acfd767f93b5d3a6010822127936319ddd6c0/docs/_build/doctrees/SeisMonitor.monitor.downloader.doctree
--------------------------------------------------------------------------------
/docs/_build/doctrees/SeisMonitor.monitor.locator.doctree:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ecastillot/SeisMonitor/fa5acfd767f93b5d3a6010822127936319ddd6c0/docs/_build/doctrees/SeisMonitor.monitor.locator.doctree
--------------------------------------------------------------------------------
/docs/_build/doctrees/SeisMonitor.monitor.locator.hypoDD.doctree:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ecastillot/SeisMonitor/fa5acfd767f93b5d3a6010822127936319ddd6c0/docs/_build/doctrees/SeisMonitor.monitor.locator.hypoDD.doctree
--------------------------------------------------------------------------------
/docs/_build/doctrees/SeisMonitor.monitor.locator.hypocenter.doctree:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ecastillot/SeisMonitor/fa5acfd767f93b5d3a6010822127936319ddd6c0/docs/_build/doctrees/SeisMonitor.monitor.locator.hypocenter.doctree
--------------------------------------------------------------------------------
/docs/_build/doctrees/SeisMonitor.monitor.locator.nlloc.doctree:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ecastillot/SeisMonitor/fa5acfd767f93b5d3a6010822127936319ddd6c0/docs/_build/doctrees/SeisMonitor.monitor.locator.nlloc.doctree
--------------------------------------------------------------------------------
/docs/_build/doctrees/SeisMonitor.monitor.magnitude.doctree:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ecastillot/SeisMonitor/fa5acfd767f93b5d3a6010822127936319ddd6c0/docs/_build/doctrees/SeisMonitor.monitor.magnitude.doctree
--------------------------------------------------------------------------------
/docs/_build/doctrees/SeisMonitor.monitor.picker.doctree:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ecastillot/SeisMonitor/fa5acfd767f93b5d3a6010822127936319ddd6c0/docs/_build/doctrees/SeisMonitor.monitor.picker.doctree
--------------------------------------------------------------------------------
/docs/_build/doctrees/SeisMonitor.plot.doctree:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ecastillot/SeisMonitor/fa5acfd767f93b5d3a6010822127936319ddd6c0/docs/_build/doctrees/SeisMonitor.plot.doctree
--------------------------------------------------------------------------------
/docs/_build/doctrees/environment.pickle:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ecastillot/SeisMonitor/fa5acfd767f93b5d3a6010822127936319ddd6c0/docs/_build/doctrees/environment.pickle
--------------------------------------------------------------------------------
/docs/_build/doctrees/index.doctree:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ecastillot/SeisMonitor/fa5acfd767f93b5d3a6010822127936319ddd6c0/docs/_build/doctrees/index.doctree
--------------------------------------------------------------------------------
/docs/_build/doctrees/modules.doctree:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ecastillot/SeisMonitor/fa5acfd767f93b5d3a6010822127936319ddd6c0/docs/_build/doctrees/modules.doctree
--------------------------------------------------------------------------------
/docs/_build/html/.buildinfo:
--------------------------------------------------------------------------------
1 | # Sphinx build info version 1
2 | # This file records the configuration used when building these files. When it is not found, a full rebuild will be done.
3 | config: 5e24e732fd46bf550278b1a8e576f3f4
4 | tags: 645f666f9bcd5a90fca523b33c5a78b7
5 |
--------------------------------------------------------------------------------
/docs/_build/html/_modules/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 | Overview: module code — SeisMonitor 0.0.57 documentation
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
52 |
53 |
57 |
58 |
59 |
60 |
61 |
62 |
63 | - Overview: module code
64 | -
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
All modules for which code is available
73 |
97 |
98 |
99 |
100 |
114 |
115 |
116 |
117 |
118 |
123 |
124 |
125 |
--------------------------------------------------------------------------------
/docs/_build/html/_sources/SeisMonitor.core.rst.txt:
--------------------------------------------------------------------------------
1 | Core
2 | ========================
3 |
4 | client
5 | ------------------------------
6 |
7 | .. automodule:: SeisMonitor.core.client
8 | :members:
9 | :undoc-members:
10 | :show-inheritance:
11 |
12 |
13 |
14 | Example
15 | -------
16 |
17 | Let's say that the data structure is organized as follows:
18 |
19 | ``{root_path}/{field_name}/seedfiles/{year}-{month:02d}/{year}-{month:02d}-{day:02d}/{network}.{station}.{location}.{channel}.{year}.{julianday:03d}``
20 |
21 | ``LocalClient`` is designed to upload local data.
22 |
23 | .. code:: python
24 |
25 | root_path = "/home/emmanuel/myarchive"
26 | client = LocalClient(root_path, "/seedfiles/{year}-{month:02d}/{year}-{month:02d}-{day:02d}/{network}.{station}.{location}.{channel}.{year}.{julianday:03d}")
27 | st = client.get_waveforms("YY", "XXXX", "00",
28 | channel="HHZ", starttime=UTCDateTime("20220102T000100"),
29 | endtime=UTCDateTime("20220102T000200"))
30 |
31 | It inherits the SDS client functionalities.
32 |
33 | objects
34 | -------------------------------
35 |
36 | .. automodule:: SeisMonitor.core.objects
37 | :members:
38 | :undoc-members:
39 | :show-inheritance:
40 |
41 | utils
42 | -----------------------------
43 |
44 | .. automodule:: SeisMonitor.core.utils
45 | :members:
46 | :undoc-members:
47 | :show-inheritance:
48 |
49 |
--------------------------------------------------------------------------------
/docs/_build/html/_sources/SeisMonitor.monitor.associator.rst.txt:
--------------------------------------------------------------------------------
1 | Associator
2 | ==========
3 |
4 | ai
5 | ----------------------------------------
6 |
7 | .. automodule:: SeisMonitor.monitor.associator.ai
8 | :members:
9 | :undoc-members:
10 | :show-inheritance:
11 |
12 | utils
13 | -------------------------------------------
14 |
15 | .. automodule:: SeisMonitor.monitor.associator.utils
16 | :members:
17 | :undoc-members:
18 | :show-inheritance:
19 |
20 |
21 |
--------------------------------------------------------------------------------
/docs/_build/html/_sources/SeisMonitor.monitor.downloader.rst.txt:
--------------------------------------------------------------------------------
1 | Downloader
2 | ======================================
3 |
4 | seismonitor
5 | -------------------------------------------------
6 |
7 | .. automodule:: SeisMonitor.monitor.downloader.seismonitor
8 | :members:
9 | :undoc-members:
10 | :show-inheritance:
11 |
12 | utils
13 | -------------------------------------------
14 |
15 | .. automodule:: SeisMonitor.monitor.downloader.utils
16 | :members:
17 | :undoc-members:
18 | :show-inheritance:
19 |
20 |
--------------------------------------------------------------------------------
/docs/_build/html/_sources/SeisMonitor.monitor.locator.hypoDD.rst.txt:
--------------------------------------------------------------------------------
1 | HypoDD
2 | ==========================================
3 |
4 | core
5 | ----------------------------------------------
6 |
7 | .. automodule:: SeisMonitor.monitor.locator.hypoDD.core
8 | :members:
9 | :undoc-members:
10 | :show-inheritance:
11 |
12 | utils
13 | -----------------------------------------------
14 |
15 | .. automodule:: SeisMonitor.monitor.locator.hypoDD.utils
16 | :members:
17 | :undoc-members:
18 | :show-inheritance:
19 |
20 |
21 |
--------------------------------------------------------------------------------
/docs/_build/html/_sources/SeisMonitor.monitor.locator.hypocenter.rst.txt:
--------------------------------------------------------------------------------
1 | Hypocenter
2 | ==============================================
3 |
4 | core
5 | --------------------------------------------------
6 |
7 | .. automodule:: SeisMonitor.monitor.locator.hypocenter.core
8 | :members:
9 | :undoc-members:
10 | :show-inheritance:
11 |
12 | utils
13 | ---------------------------------------------------
14 |
15 | .. automodule:: SeisMonitor.monitor.locator.hypocenter.utils
16 | :members:
17 | :undoc-members:
18 | :show-inheritance:
19 |
--------------------------------------------------------------------------------
/docs/_build/html/_sources/SeisMonitor.monitor.locator.nlloc.rst.txt:
--------------------------------------------------------------------------------
1 | Nlloc
2 | =========================================
3 |
4 | Submodules
5 | ----------
6 |
7 | nlloc
8 | ----------------------------------------------
9 |
10 | .. automodule:: SeisMonitor.monitor.locator.nlloc.nlloc
11 | :members:
12 | :undoc-members:
13 | :show-inheritance:
14 |
15 | utils
16 | ----------------------------------------------
17 |
18 | .. automodule:: SeisMonitor.monitor.locator.nlloc.utils
19 | :members:
20 | :undoc-members:
21 | :show-inheritance:
22 |
23 |
24 |
--------------------------------------------------------------------------------
/docs/_build/html/_sources/SeisMonitor.monitor.locator.rst.txt:
--------------------------------------------------------------------------------
1 | Locator
2 | =======
3 |
4 | .. toctree::
5 | :maxdepth: 4
6 |
7 | SeisMonitor.monitor.locator.hypoDD
8 | SeisMonitor.monitor.locator.hypocenter
9 | SeisMonitor.monitor.locator.nlloc
10 |
11 | utils
12 | ----------------------------------------
13 |
14 | .. automodule:: SeisMonitor.monitor.locator.utils
15 | :members:
16 | :undoc-members:
17 | :show-inheritance:
18 |
19 |
--------------------------------------------------------------------------------
/docs/_build/html/_sources/SeisMonitor.monitor.magnitude.rst.txt:
--------------------------------------------------------------------------------
1 | Magnitude
2 | =========
3 |
4 | SeisMonitor.monitor.magnitude.mag module
5 | ----------------------------------------
6 |
7 | .. automodule:: SeisMonitor.monitor.magnitude.mag
8 | :members:
9 | :undoc-members:
10 | :show-inheritance:
11 |
12 | SeisMonitor.monitor.magnitude.utils module
13 | ------------------------------------------
14 |
15 | .. automodule:: SeisMonitor.monitor.magnitude.utils
16 | :members:
17 | :undoc-members:
18 | :show-inheritance:
19 |
--------------------------------------------------------------------------------
/docs/_build/html/_sources/SeisMonitor.monitor.picker.rst.txt:
--------------------------------------------------------------------------------
1 | Picker
2 | ==================================
3 |
4 | ai
5 | ------------------------------------
6 |
7 | .. automodule:: SeisMonitor.monitor.picker.ai
8 | :members:
9 | :undoc-members:
10 | :show-inheritance:
11 |
12 | utils
13 | ---------------------------------------
14 |
15 | .. automodule:: SeisMonitor.monitor.picker.utils
16 | :members:
17 | :undoc-members:
18 | :show-inheritance:
19 |
20 |
--------------------------------------------------------------------------------
/docs/_build/html/_sources/SeisMonitor.monitor.rst.txt:
--------------------------------------------------------------------------------
1 | Monitor
2 | ===========================
3 |
4 | .. toctree::
5 | :maxdepth: 4
6 |
7 | SeisMonitor.monitor.downloader
8 | SeisMonitor.monitor.picker
9 | SeisMonitor.monitor.associator
10 | SeisMonitor.monitor.locator
11 | SeisMonitor.monitor.magnitude
12 |
13 |
14 |
15 | SeisMonitor (All in one)
16 | --------------------------------------
17 |
18 | .. automodule:: SeisMonitor.monitor.seismonitor
19 | :members:
20 | :undoc-members:
21 | :show-inheritance:
22 |
23 |
--------------------------------------------------------------------------------
/docs/_build/html/_sources/SeisMonitor.plot.rst.txt:
--------------------------------------------------------------------------------
1 | Plot
2 | ========================
3 |
4 | Picks (In progress)
5 | -----------------------------
6 |
7 | .. automodule:: SeisMonitor.plot.picks
8 | :members:
9 | :undoc-members:
10 | :show-inheritance:
11 |
12 | utils
13 | -----------------------------
14 |
15 | .. automodule:: SeisMonitor.plot.utils
16 | :members:
17 | :undoc-members:
18 | :show-inheritance:
19 |
20 |
21 |
--------------------------------------------------------------------------------
/docs/_build/html/_sources/SeisMonitor.rst.txt:
--------------------------------------------------------------------------------
1 | SeisMonitor package
2 | ===================
3 |
4 | Subpackages
5 | -----------
6 |
7 | .. toctree::
8 | :maxdepth: 4
9 |
10 | SeisMonitor.core
11 | SeisMonitor.monitor
12 | SeisMonitor.plot
13 |
14 | Submodules
15 | ----------
16 |
17 | SeisMonitor.utils module
18 | ------------------------
19 |
20 | .. automodule:: SeisMonitor.utils
21 | :members:
22 | :undoc-members:
23 | :show-inheritance:
24 |
25 | SeisMonitor.utils4examples module
26 | ---------------------------------
27 |
28 | .. automodule:: SeisMonitor.utils4examples
29 | :members:
30 | :undoc-members:
31 | :show-inheritance:
32 |
33 | Module contents
34 | ---------------
35 |
36 | .. automodule:: SeisMonitor
37 | :members:
38 | :undoc-members:
39 | :show-inheritance:
40 |
--------------------------------------------------------------------------------
/docs/_build/html/_sources/index.rst.txt:
--------------------------------------------------------------------------------
1 | .. SeisMonitor documentation master file, created by
2 | sphinx-quickstart on Sun Mar 30 13:51:08 2025.
3 | You can adapt this file completely to your liking, but it should at least
4 | contain the root `toctree` directive.
5 |
6 | SeisMonitor documentation
7 | =========================
8 |
9 | .. toctree::
10 | :maxdepth: 2
11 | :caption: Contents:
12 |
13 | SeisMonitor.examples
14 | SeisMonitor.core
15 | SeisMonitor.monitor
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/docs/_build/html/_sources/modules.rst.txt:
--------------------------------------------------------------------------------
1 | SeisMonitor
2 | ===========
3 |
4 | .. toctree::
5 | :maxdepth: 2
6 |
7 | SeisMonitor.monitor.downloader
8 |
9 |
--------------------------------------------------------------------------------
/docs/_build/html/_static/_sphinx_javascript_frameworks_compat.js:
--------------------------------------------------------------------------------
1 | /* Compatability shim for jQuery and underscores.js.
2 | *
3 | * Copyright Sphinx contributors
4 | * Released under the two clause BSD licence
5 | */
6 |
7 | /**
8 | * small helper function to urldecode strings
9 | *
10 | * See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/decodeURIComponent#Decoding_query_parameters_from_a_URL
11 | */
12 | jQuery.urldecode = function(x) {
13 | if (!x) {
14 | return x
15 | }
16 | return decodeURIComponent(x.replace(/\+/g, ' '));
17 | };
18 |
19 | /**
20 | * small helper function to urlencode strings
21 | */
22 | jQuery.urlencode = encodeURIComponent;
23 |
24 | /**
25 | * This function returns the parsed url parameters of the
26 | * current request. Multiple values per key are supported,
27 | * it will always return arrays of strings for the value parts.
28 | */
29 | jQuery.getQueryParameters = function(s) {
30 | if (typeof s === 'undefined')
31 | s = document.location.search;
32 | var parts = s.substr(s.indexOf('?') + 1).split('&');
33 | var result = {};
34 | for (var i = 0; i < parts.length; i++) {
35 | var tmp = parts[i].split('=', 2);
36 | var key = jQuery.urldecode(tmp[0]);
37 | var value = jQuery.urldecode(tmp[1]);
38 | if (key in result)
39 | result[key].push(value);
40 | else
41 | result[key] = [value];
42 | }
43 | return result;
44 | };
45 |
46 | /**
47 | * highlight a given string on a jquery object by wrapping it in
48 | * span elements with the given class name.
49 | */
50 | jQuery.fn.highlightText = function(text, className) {
51 | function highlight(node, addItems) {
52 | if (node.nodeType === 3) {
53 | var val = node.nodeValue;
54 | var pos = val.toLowerCase().indexOf(text);
55 | if (pos >= 0 &&
56 | !jQuery(node.parentNode).hasClass(className) &&
57 | !jQuery(node.parentNode).hasClass("nohighlight")) {
58 | var span;
59 | var isInSVG = jQuery(node).closest("body, svg, foreignObject").is("svg");
60 | if (isInSVG) {
61 | span = document.createElementNS("http://www.w3.org/2000/svg", "tspan");
62 | } else {
63 | span = document.createElement("span");
64 | span.className = className;
65 | }
66 | span.appendChild(document.createTextNode(val.substr(pos, text.length)));
67 | node.parentNode.insertBefore(span, node.parentNode.insertBefore(
68 | document.createTextNode(val.substr(pos + text.length)),
69 | node.nextSibling));
70 | node.nodeValue = val.substr(0, pos);
71 | if (isInSVG) {
72 | var rect = document.createElementNS("http://www.w3.org/2000/svg", "rect");
73 | var bbox = node.parentElement.getBBox();
74 | rect.x.baseVal.value = bbox.x;
75 | rect.y.baseVal.value = bbox.y;
76 | rect.width.baseVal.value = bbox.width;
77 | rect.height.baseVal.value = bbox.height;
78 | rect.setAttribute('class', className);
79 | addItems.push({
80 | "parent": node.parentNode,
81 | "target": rect});
82 | }
83 | }
84 | }
85 | else if (!jQuery(node).is("button, select, textarea")) {
86 | jQuery.each(node.childNodes, function() {
87 | highlight(this, addItems);
88 | });
89 | }
90 | }
91 | var addItems = [];
92 | var result = this.each(function() {
93 | highlight(this, addItems);
94 | });
95 | for (var i = 0; i < addItems.length; ++i) {
96 | jQuery(addItems[i].parent).before(addItems[i].target);
97 | }
98 | return result;
99 | };
100 |
101 | /*
102 | * backward compatibility for jQuery.browser
103 | * This will be supported until firefox bug is fixed.
104 | */
105 | if (!jQuery.browser) {
106 | jQuery.uaMatch = function(ua) {
107 | ua = ua.toLowerCase();
108 |
109 | var match = /(chrome)[ \/]([\w.]+)/.exec(ua) ||
110 | /(webkit)[ \/]([\w.]+)/.exec(ua) ||
111 | /(opera)(?:.*version|)[ \/]([\w.]+)/.exec(ua) ||
112 | /(msie) ([\w.]+)/.exec(ua) ||
113 | ua.indexOf("compatible") < 0 && /(mozilla)(?:.*? rv:([\w.]+)|)/.exec(ua) ||
114 | [];
115 |
116 | return {
117 | browser: match[ 1 ] || "",
118 | version: match[ 2 ] || "0"
119 | };
120 | };
121 | jQuery.browser = {};
122 | jQuery.browser[jQuery.uaMatch(navigator.userAgent).browser] = true;
123 | }
124 |
--------------------------------------------------------------------------------
/docs/_build/html/_static/css/badge_only.css:
--------------------------------------------------------------------------------
1 | .clearfix{*zoom:1}.clearfix:after,.clearfix:before{display:table;content:""}.clearfix:after{clear:both}@font-face{font-family:FontAwesome;font-style:normal;font-weight:400;src:url(fonts/fontawesome-webfont.eot?674f50d287a8c48dc19ba404d20fe713?#iefix) format("embedded-opentype"),url(fonts/fontawesome-webfont.woff2?af7ae505a9eed503f8b8e6982036873e) format("woff2"),url(fonts/fontawesome-webfont.woff?fee66e712a8a08eef5805a46892932ad) format("woff"),url(fonts/fontawesome-webfont.ttf?b06871f281fee6b241d60582ae9369b9) format("truetype"),url(fonts/fontawesome-webfont.svg?912ec66d7572ff821749319396470bde#FontAwesome) format("svg")}.fa:before{font-family:FontAwesome;font-style:normal;font-weight:400;line-height:1}.fa:before,a .fa{text-decoration:inherit}.fa:before,a .fa,li .fa{display:inline-block}li .fa-large:before{width:1.875em}ul.fas{list-style-type:none;margin-left:2em;text-indent:-.8em}ul.fas li .fa{width:.8em}ul.fas li .fa-large:before{vertical-align:baseline}.fa-book:before,.icon-book:before{content:"\f02d"}.fa-caret-down:before,.icon-caret-down:before{content:"\f0d7"}.fa-caret-up:before,.icon-caret-up:before{content:"\f0d8"}.fa-caret-left:before,.icon-caret-left:before{content:"\f0d9"}.fa-caret-right:before,.icon-caret-right:before{content:"\f0da"}.rst-versions{position:fixed;bottom:0;left:0;width:300px;color:#fcfcfc;background:#1f1d1d;font-family:Lato,proxima-nova,Helvetica Neue,Arial,sans-serif;z-index:400}.rst-versions a{color:#2980b9;text-decoration:none}.rst-versions .rst-badge-small{display:none}.rst-versions .rst-current-version{padding:12px;background-color:#272525;display:block;text-align:right;font-size:90%;cursor:pointer;color:#27ae60}.rst-versions .rst-current-version:after{clear:both;content:"";display:block}.rst-versions .rst-current-version .fa{color:#fcfcfc}.rst-versions .rst-current-version .fa-book,.rst-versions .rst-current-version .icon-book{float:left}.rst-versions .rst-current-version.rst-out-of-date{background-color:#e74c3c;color:#fff}.rst-versions .rst-current-version.rst-active-old-version{background-color:#f1c40f;color:#000}.rst-versions.shift-up{height:auto;max-height:100%;overflow-y:scroll}.rst-versions.shift-up .rst-other-versions{display:block}.rst-versions .rst-other-versions{font-size:90%;padding:12px;color:grey;display:none}.rst-versions .rst-other-versions hr{display:block;height:1px;border:0;margin:20px 0;padding:0;border-top:1px solid #413d3d}.rst-versions .rst-other-versions dd{display:inline-block;margin:0}.rst-versions .rst-other-versions dd a{display:inline-block;padding:6px;color:#fcfcfc}.rst-versions .rst-other-versions .rtd-current-item{font-weight:700}.rst-versions.rst-badge{width:auto;bottom:20px;right:20px;left:auto;border:none;max-width:300px;max-height:90%}.rst-versions.rst-badge .fa-book,.rst-versions.rst-badge .icon-book{float:none;line-height:30px}.rst-versions.rst-badge.shift-up .rst-current-version{text-align:right}.rst-versions.rst-badge.shift-up .rst-current-version .fa-book,.rst-versions.rst-badge.shift-up .rst-current-version .icon-book{float:left}.rst-versions.rst-badge>.rst-current-version{width:auto;height:30px;line-height:30px;padding:0 6px;display:block;text-align:center}@media screen and (max-width:768px){.rst-versions{width:85%;display:none}.rst-versions.shift{display:block}}#flyout-search-form{padding:6px}
--------------------------------------------------------------------------------
/docs/_build/html/_static/css/fonts/Roboto-Slab-Bold.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ecastillot/SeisMonitor/fa5acfd767f93b5d3a6010822127936319ddd6c0/docs/_build/html/_static/css/fonts/Roboto-Slab-Bold.woff
--------------------------------------------------------------------------------
/docs/_build/html/_static/css/fonts/Roboto-Slab-Bold.woff2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ecastillot/SeisMonitor/fa5acfd767f93b5d3a6010822127936319ddd6c0/docs/_build/html/_static/css/fonts/Roboto-Slab-Bold.woff2
--------------------------------------------------------------------------------
/docs/_build/html/_static/css/fonts/Roboto-Slab-Regular.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ecastillot/SeisMonitor/fa5acfd767f93b5d3a6010822127936319ddd6c0/docs/_build/html/_static/css/fonts/Roboto-Slab-Regular.woff
--------------------------------------------------------------------------------
/docs/_build/html/_static/css/fonts/Roboto-Slab-Regular.woff2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ecastillot/SeisMonitor/fa5acfd767f93b5d3a6010822127936319ddd6c0/docs/_build/html/_static/css/fonts/Roboto-Slab-Regular.woff2
--------------------------------------------------------------------------------
/docs/_build/html/_static/css/fonts/fontawesome-webfont.eot:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ecastillot/SeisMonitor/fa5acfd767f93b5d3a6010822127936319ddd6c0/docs/_build/html/_static/css/fonts/fontawesome-webfont.eot
--------------------------------------------------------------------------------
/docs/_build/html/_static/css/fonts/fontawesome-webfont.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ecastillot/SeisMonitor/fa5acfd767f93b5d3a6010822127936319ddd6c0/docs/_build/html/_static/css/fonts/fontawesome-webfont.ttf
--------------------------------------------------------------------------------
/docs/_build/html/_static/css/fonts/fontawesome-webfont.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ecastillot/SeisMonitor/fa5acfd767f93b5d3a6010822127936319ddd6c0/docs/_build/html/_static/css/fonts/fontawesome-webfont.woff
--------------------------------------------------------------------------------
/docs/_build/html/_static/css/fonts/fontawesome-webfont.woff2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ecastillot/SeisMonitor/fa5acfd767f93b5d3a6010822127936319ddd6c0/docs/_build/html/_static/css/fonts/fontawesome-webfont.woff2
--------------------------------------------------------------------------------
/docs/_build/html/_static/css/fonts/lato-bold-italic.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ecastillot/SeisMonitor/fa5acfd767f93b5d3a6010822127936319ddd6c0/docs/_build/html/_static/css/fonts/lato-bold-italic.woff
--------------------------------------------------------------------------------
/docs/_build/html/_static/css/fonts/lato-bold-italic.woff2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ecastillot/SeisMonitor/fa5acfd767f93b5d3a6010822127936319ddd6c0/docs/_build/html/_static/css/fonts/lato-bold-italic.woff2
--------------------------------------------------------------------------------
/docs/_build/html/_static/css/fonts/lato-bold.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ecastillot/SeisMonitor/fa5acfd767f93b5d3a6010822127936319ddd6c0/docs/_build/html/_static/css/fonts/lato-bold.woff
--------------------------------------------------------------------------------
/docs/_build/html/_static/css/fonts/lato-bold.woff2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ecastillot/SeisMonitor/fa5acfd767f93b5d3a6010822127936319ddd6c0/docs/_build/html/_static/css/fonts/lato-bold.woff2
--------------------------------------------------------------------------------
/docs/_build/html/_static/css/fonts/lato-normal-italic.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ecastillot/SeisMonitor/fa5acfd767f93b5d3a6010822127936319ddd6c0/docs/_build/html/_static/css/fonts/lato-normal-italic.woff
--------------------------------------------------------------------------------
/docs/_build/html/_static/css/fonts/lato-normal-italic.woff2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ecastillot/SeisMonitor/fa5acfd767f93b5d3a6010822127936319ddd6c0/docs/_build/html/_static/css/fonts/lato-normal-italic.woff2
--------------------------------------------------------------------------------
/docs/_build/html/_static/css/fonts/lato-normal.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ecastillot/SeisMonitor/fa5acfd767f93b5d3a6010822127936319ddd6c0/docs/_build/html/_static/css/fonts/lato-normal.woff
--------------------------------------------------------------------------------
/docs/_build/html/_static/css/fonts/lato-normal.woff2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ecastillot/SeisMonitor/fa5acfd767f93b5d3a6010822127936319ddd6c0/docs/_build/html/_static/css/fonts/lato-normal.woff2
--------------------------------------------------------------------------------
/docs/_build/html/_static/doctools.js:
--------------------------------------------------------------------------------
1 | /*
2 | * Base JavaScript utilities for all Sphinx HTML documentation.
3 | */
4 | "use strict";
5 |
6 | const BLACKLISTED_KEY_CONTROL_ELEMENTS = new Set([
7 | "TEXTAREA",
8 | "INPUT",
9 | "SELECT",
10 | "BUTTON",
11 | ]);
12 |
13 | const _ready = (callback) => {
14 | if (document.readyState !== "loading") {
15 | callback();
16 | } else {
17 | document.addEventListener("DOMContentLoaded", callback);
18 | }
19 | };
20 |
21 | /**
22 | * Small JavaScript module for the documentation.
23 | */
24 | const Documentation = {
25 | init: () => {
26 | Documentation.initDomainIndexTable();
27 | Documentation.initOnKeyListeners();
28 | },
29 |
30 | /**
31 | * i18n support
32 | */
33 | TRANSLATIONS: {},
34 | PLURAL_EXPR: (n) => (n === 1 ? 0 : 1),
35 | LOCALE: "unknown",
36 |
37 | // gettext and ngettext don't access this so that the functions
38 | // can safely bound to a different name (_ = Documentation.gettext)
39 | gettext: (string) => {
40 | const translated = Documentation.TRANSLATIONS[string];
41 | switch (typeof translated) {
42 | case "undefined":
43 | return string; // no translation
44 | case "string":
45 | return translated; // translation exists
46 | default:
47 | return translated[0]; // (singular, plural) translation tuple exists
48 | }
49 | },
50 |
51 | ngettext: (singular, plural, n) => {
52 | const translated = Documentation.TRANSLATIONS[singular];
53 | if (typeof translated !== "undefined")
54 | return translated[Documentation.PLURAL_EXPR(n)];
55 | return n === 1 ? singular : plural;
56 | },
57 |
58 | addTranslations: (catalog) => {
59 | Object.assign(Documentation.TRANSLATIONS, catalog.messages);
60 | Documentation.PLURAL_EXPR = new Function(
61 | "n",
62 | `return (${catalog.plural_expr})`
63 | );
64 | Documentation.LOCALE = catalog.locale;
65 | },
66 |
67 | /**
68 | * helper function to focus on search bar
69 | */
70 | focusSearchBar: () => {
71 | document.querySelectorAll("input[name=q]")[0]?.focus();
72 | },
73 |
74 | /**
75 | * Initialise the domain index toggle buttons
76 | */
77 | initDomainIndexTable: () => {
78 | const toggler = (el) => {
79 | const idNumber = el.id.substr(7);
80 | const toggledRows = document.querySelectorAll(`tr.cg-${idNumber}`);
81 | if (el.src.substr(-9) === "minus.png") {
82 | el.src = `${el.src.substr(0, el.src.length - 9)}plus.png`;
83 | toggledRows.forEach((el) => (el.style.display = "none"));
84 | } else {
85 | el.src = `${el.src.substr(0, el.src.length - 8)}minus.png`;
86 | toggledRows.forEach((el) => (el.style.display = ""));
87 | }
88 | };
89 |
90 | const togglerElements = document.querySelectorAll("img.toggler");
91 | togglerElements.forEach((el) =>
92 | el.addEventListener("click", (event) => toggler(event.currentTarget))
93 | );
94 | togglerElements.forEach((el) => (el.style.display = ""));
95 | if (DOCUMENTATION_OPTIONS.COLLAPSE_INDEX) togglerElements.forEach(toggler);
96 | },
97 |
98 | initOnKeyListeners: () => {
99 | // only install a listener if it is really needed
100 | if (
101 | !DOCUMENTATION_OPTIONS.NAVIGATION_WITH_KEYS &&
102 | !DOCUMENTATION_OPTIONS.ENABLE_SEARCH_SHORTCUTS
103 | )
104 | return;
105 |
106 | document.addEventListener("keydown", (event) => {
107 | // bail for input elements
108 | if (BLACKLISTED_KEY_CONTROL_ELEMENTS.has(document.activeElement.tagName)) return;
109 | // bail with special keys
110 | if (event.altKey || event.ctrlKey || event.metaKey) return;
111 |
112 | if (!event.shiftKey) {
113 | switch (event.key) {
114 | case "ArrowLeft":
115 | if (!DOCUMENTATION_OPTIONS.NAVIGATION_WITH_KEYS) break;
116 |
117 | const prevLink = document.querySelector('link[rel="prev"]');
118 | if (prevLink && prevLink.href) {
119 | window.location.href = prevLink.href;
120 | event.preventDefault();
121 | }
122 | break;
123 | case "ArrowRight":
124 | if (!DOCUMENTATION_OPTIONS.NAVIGATION_WITH_KEYS) break;
125 |
126 | const nextLink = document.querySelector('link[rel="next"]');
127 | if (nextLink && nextLink.href) {
128 | window.location.href = nextLink.href;
129 | event.preventDefault();
130 | }
131 | break;
132 | }
133 | }
134 |
135 | // some keyboard layouts may need Shift to get /
136 | switch (event.key) {
137 | case "/":
138 | if (!DOCUMENTATION_OPTIONS.ENABLE_SEARCH_SHORTCUTS) break;
139 | Documentation.focusSearchBar();
140 | event.preventDefault();
141 | }
142 | });
143 | },
144 | };
145 |
146 | // quick alias for translations
147 | const _ = Documentation.gettext;
148 |
149 | _ready(Documentation.init);
150 |
--------------------------------------------------------------------------------
/docs/_build/html/_static/documentation_options.js:
--------------------------------------------------------------------------------
1 | const DOCUMENTATION_OPTIONS = {
2 | VERSION: '0.0.57',
3 | LANGUAGE: 'en',
4 | COLLAPSE_INDEX: false,
5 | BUILDER: 'html',
6 | FILE_SUFFIX: '.html',
7 | LINK_SUFFIX: '.html',
8 | HAS_SOURCE: true,
9 | SOURCELINK_SUFFIX: '.txt',
10 | NAVIGATION_WITH_KEYS: false,
11 | SHOW_SEARCH_SUMMARY: true,
12 | ENABLE_SEARCH_SHORTCUTS: true,
13 | };
--------------------------------------------------------------------------------
/docs/_build/html/_static/file.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ecastillot/SeisMonitor/fa5acfd767f93b5d3a6010822127936319ddd6c0/docs/_build/html/_static/file.png
--------------------------------------------------------------------------------
/docs/_build/html/_static/fonts/Lato/lato-bold.eot:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ecastillot/SeisMonitor/fa5acfd767f93b5d3a6010822127936319ddd6c0/docs/_build/html/_static/fonts/Lato/lato-bold.eot
--------------------------------------------------------------------------------
/docs/_build/html/_static/fonts/Lato/lato-bold.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ecastillot/SeisMonitor/fa5acfd767f93b5d3a6010822127936319ddd6c0/docs/_build/html/_static/fonts/Lato/lato-bold.ttf
--------------------------------------------------------------------------------
/docs/_build/html/_static/fonts/Lato/lato-bold.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ecastillot/SeisMonitor/fa5acfd767f93b5d3a6010822127936319ddd6c0/docs/_build/html/_static/fonts/Lato/lato-bold.woff
--------------------------------------------------------------------------------
/docs/_build/html/_static/fonts/Lato/lato-bold.woff2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ecastillot/SeisMonitor/fa5acfd767f93b5d3a6010822127936319ddd6c0/docs/_build/html/_static/fonts/Lato/lato-bold.woff2
--------------------------------------------------------------------------------
/docs/_build/html/_static/fonts/Lato/lato-bolditalic.eot:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ecastillot/SeisMonitor/fa5acfd767f93b5d3a6010822127936319ddd6c0/docs/_build/html/_static/fonts/Lato/lato-bolditalic.eot
--------------------------------------------------------------------------------
/docs/_build/html/_static/fonts/Lato/lato-bolditalic.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ecastillot/SeisMonitor/fa5acfd767f93b5d3a6010822127936319ddd6c0/docs/_build/html/_static/fonts/Lato/lato-bolditalic.ttf
--------------------------------------------------------------------------------
/docs/_build/html/_static/fonts/Lato/lato-bolditalic.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ecastillot/SeisMonitor/fa5acfd767f93b5d3a6010822127936319ddd6c0/docs/_build/html/_static/fonts/Lato/lato-bolditalic.woff
--------------------------------------------------------------------------------
/docs/_build/html/_static/fonts/Lato/lato-bolditalic.woff2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ecastillot/SeisMonitor/fa5acfd767f93b5d3a6010822127936319ddd6c0/docs/_build/html/_static/fonts/Lato/lato-bolditalic.woff2
--------------------------------------------------------------------------------
/docs/_build/html/_static/fonts/Lato/lato-italic.eot:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ecastillot/SeisMonitor/fa5acfd767f93b5d3a6010822127936319ddd6c0/docs/_build/html/_static/fonts/Lato/lato-italic.eot
--------------------------------------------------------------------------------
/docs/_build/html/_static/fonts/Lato/lato-italic.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ecastillot/SeisMonitor/fa5acfd767f93b5d3a6010822127936319ddd6c0/docs/_build/html/_static/fonts/Lato/lato-italic.ttf
--------------------------------------------------------------------------------
/docs/_build/html/_static/fonts/Lato/lato-italic.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ecastillot/SeisMonitor/fa5acfd767f93b5d3a6010822127936319ddd6c0/docs/_build/html/_static/fonts/Lato/lato-italic.woff
--------------------------------------------------------------------------------
/docs/_build/html/_static/fonts/Lato/lato-italic.woff2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ecastillot/SeisMonitor/fa5acfd767f93b5d3a6010822127936319ddd6c0/docs/_build/html/_static/fonts/Lato/lato-italic.woff2
--------------------------------------------------------------------------------
/docs/_build/html/_static/fonts/Lato/lato-regular.eot:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ecastillot/SeisMonitor/fa5acfd767f93b5d3a6010822127936319ddd6c0/docs/_build/html/_static/fonts/Lato/lato-regular.eot
--------------------------------------------------------------------------------
/docs/_build/html/_static/fonts/Lato/lato-regular.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ecastillot/SeisMonitor/fa5acfd767f93b5d3a6010822127936319ddd6c0/docs/_build/html/_static/fonts/Lato/lato-regular.ttf
--------------------------------------------------------------------------------
/docs/_build/html/_static/fonts/Lato/lato-regular.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ecastillot/SeisMonitor/fa5acfd767f93b5d3a6010822127936319ddd6c0/docs/_build/html/_static/fonts/Lato/lato-regular.woff
--------------------------------------------------------------------------------
/docs/_build/html/_static/fonts/Lato/lato-regular.woff2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ecastillot/SeisMonitor/fa5acfd767f93b5d3a6010822127936319ddd6c0/docs/_build/html/_static/fonts/Lato/lato-regular.woff2
--------------------------------------------------------------------------------
/docs/_build/html/_static/fonts/RobotoSlab/roboto-slab-v7-bold.eot:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ecastillot/SeisMonitor/fa5acfd767f93b5d3a6010822127936319ddd6c0/docs/_build/html/_static/fonts/RobotoSlab/roboto-slab-v7-bold.eot
--------------------------------------------------------------------------------
/docs/_build/html/_static/fonts/RobotoSlab/roboto-slab-v7-bold.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ecastillot/SeisMonitor/fa5acfd767f93b5d3a6010822127936319ddd6c0/docs/_build/html/_static/fonts/RobotoSlab/roboto-slab-v7-bold.ttf
--------------------------------------------------------------------------------
/docs/_build/html/_static/fonts/RobotoSlab/roboto-slab-v7-bold.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ecastillot/SeisMonitor/fa5acfd767f93b5d3a6010822127936319ddd6c0/docs/_build/html/_static/fonts/RobotoSlab/roboto-slab-v7-bold.woff
--------------------------------------------------------------------------------
/docs/_build/html/_static/fonts/RobotoSlab/roboto-slab-v7-bold.woff2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ecastillot/SeisMonitor/fa5acfd767f93b5d3a6010822127936319ddd6c0/docs/_build/html/_static/fonts/RobotoSlab/roboto-slab-v7-bold.woff2
--------------------------------------------------------------------------------
/docs/_build/html/_static/fonts/RobotoSlab/roboto-slab-v7-regular.eot:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ecastillot/SeisMonitor/fa5acfd767f93b5d3a6010822127936319ddd6c0/docs/_build/html/_static/fonts/RobotoSlab/roboto-slab-v7-regular.eot
--------------------------------------------------------------------------------
/docs/_build/html/_static/fonts/RobotoSlab/roboto-slab-v7-regular.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ecastillot/SeisMonitor/fa5acfd767f93b5d3a6010822127936319ddd6c0/docs/_build/html/_static/fonts/RobotoSlab/roboto-slab-v7-regular.ttf
--------------------------------------------------------------------------------
/docs/_build/html/_static/fonts/RobotoSlab/roboto-slab-v7-regular.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ecastillot/SeisMonitor/fa5acfd767f93b5d3a6010822127936319ddd6c0/docs/_build/html/_static/fonts/RobotoSlab/roboto-slab-v7-regular.woff
--------------------------------------------------------------------------------
/docs/_build/html/_static/fonts/RobotoSlab/roboto-slab-v7-regular.woff2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ecastillot/SeisMonitor/fa5acfd767f93b5d3a6010822127936319ddd6c0/docs/_build/html/_static/fonts/RobotoSlab/roboto-slab-v7-regular.woff2
--------------------------------------------------------------------------------
/docs/_build/html/_static/js/badge_only.js:
--------------------------------------------------------------------------------
1 | !function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=4)}({4:function(e,t,r){}});
--------------------------------------------------------------------------------
/docs/_build/html/_static/js/theme.js:
--------------------------------------------------------------------------------
1 | !function(n){var e={};function t(i){if(e[i])return e[i].exports;var o=e[i]={i:i,l:!1,exports:{}};return n[i].call(o.exports,o,o.exports,t),o.l=!0,o.exports}t.m=n,t.c=e,t.d=function(n,e,i){t.o(n,e)||Object.defineProperty(n,e,{enumerable:!0,get:i})},t.r=function(n){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(n,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(n,"__esModule",{value:!0})},t.t=function(n,e){if(1&e&&(n=t(n)),8&e)return n;if(4&e&&"object"==typeof n&&n&&n.__esModule)return n;var i=Object.create(null);if(t.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:n}),2&e&&"string"!=typeof n)for(var o in n)t.d(i,o,function(e){return n[e]}.bind(null,o));return i},t.n=function(n){var e=n&&n.__esModule?function(){return n.default}:function(){return n};return t.d(e,"a",e),e},t.o=function(n,e){return Object.prototype.hasOwnProperty.call(n,e)},t.p="",t(t.s=0)}([function(n,e,t){t(1),n.exports=t(3)},function(n,e,t){(function(){var e="undefined"!=typeof window?window.jQuery:t(2);n.exports.ThemeNav={navBar:null,win:null,winScroll:!1,winResize:!1,linkScroll:!1,winPosition:0,winHeight:null,docHeight:null,isRunning:!1,enable:function(n){var t=this;void 0===n&&(n=!0),t.isRunning||(t.isRunning=!0,e((function(e){t.init(e),t.reset(),t.win.on("hashchange",t.reset),n&&t.win.on("scroll",(function(){t.linkScroll||t.winScroll||(t.winScroll=!0,requestAnimationFrame((function(){t.onScroll()})))})),t.win.on("resize",(function(){t.winResize||(t.winResize=!0,requestAnimationFrame((function(){t.onResize()})))})),t.onResize()})))},enableSticky:function(){this.enable(!0)},init:function(n){n(document);var e=this;this.navBar=n("div.wy-side-scroll:first"),this.win=n(window),n(document).on("click","[data-toggle='wy-nav-top']",(function(){n("[data-toggle='wy-nav-shift']").toggleClass("shift"),n("[data-toggle='rst-versions']").toggleClass("shift")})).on("click",".wy-menu-vertical .current ul li a",(function(){var t=n(this);n("[data-toggle='wy-nav-shift']").removeClass("shift"),n("[data-toggle='rst-versions']").toggleClass("shift"),e.toggleCurrent(t),e.hashChange()})).on("click","[data-toggle='rst-current-version']",(function(){n("[data-toggle='rst-versions']").toggleClass("shift-up")})),n("table.docutils:not(.field-list,.footnote,.citation)").wrap(""),n("table.docutils.footnote").wrap(""),n("table.docutils.citation").wrap(""),n(".wy-menu-vertical ul").not(".simple").siblings("a").each((function(){var t=n(this);expand=n(''),expand.on("click",(function(n){return e.toggleCurrent(t),n.stopPropagation(),!1})),t.prepend(expand)}))},reset:function(){var n=encodeURI(window.location.hash)||"#";try{var e=$(".wy-menu-vertical"),t=e.find('[href="'+n+'"]');if(0===t.length){var i=$('.document [id="'+n.substring(1)+'"]').closest("div.section");0===(t=e.find('[href="#'+i.attr("id")+'"]')).length&&(t=e.find('[href="#"]'))}if(t.length>0){$(".wy-menu-vertical .current").removeClass("current").attr("aria-expanded","false"),t.addClass("current").attr("aria-expanded","true"),t.closest("li.toctree-l1").parent().addClass("current").attr("aria-expanded","true");for(let n=1;n<=10;n++)t.closest("li.toctree-l"+n).addClass("current").attr("aria-expanded","true");t[0].scrollIntoView()}}catch(n){console.log("Error expanding nav for anchor",n)}},onScroll:function(){this.winScroll=!1;var n=this.win.scrollTop(),e=n+this.winHeight,t=this.navBar.scrollTop()+(n-this.winPosition);n<0||e>this.docHeight||(this.navBar.scrollTop(t),this.winPosition=n)},onResize:function(){this.winResize=!1,this.winHeight=this.win.height(),this.docHeight=$(document).height()},hashChange:function(){this.linkScroll=!0,this.win.one("hashchange",(function(){this.linkScroll=!1}))},toggleCurrent:function(n){var e=n.closest("li");e.siblings("li.current").removeClass("current").attr("aria-expanded","false"),e.siblings().find("li.current").removeClass("current").attr("aria-expanded","false");var t=e.find("> ul li");t.length&&(t.removeClass("current").attr("aria-expanded","false"),e.toggleClass("current").attr("aria-expanded",(function(n,e){return"true"==e?"false":"true"})))}},"undefined"!=typeof window&&(window.SphinxRtdTheme={Navigation:n.exports.ThemeNav,StickyNav:n.exports.ThemeNav}),function(){for(var n=0,e=["ms","moz","webkit","o"],t=0;t0
56 | var meq1 = "^(" + C + ")?" + V + C + "(" + V + ")?$"; // [C]VC[V] is m=1
57 | var mgr1 = "^(" + C + ")?" + V + C + V + C; // [C]VCVC... is m>1
58 | var s_v = "^(" + C + ")?" + v; // vowel in stem
59 |
60 | this.stemWord = function (w) {
61 | var stem;
62 | var suffix;
63 | var firstch;
64 | var origword = w;
65 |
66 | if (w.length < 3)
67 | return w;
68 |
69 | var re;
70 | var re2;
71 | var re3;
72 | var re4;
73 |
74 | firstch = w.substr(0,1);
75 | if (firstch == "y")
76 | w = firstch.toUpperCase() + w.substr(1);
77 |
78 | // Step 1a
79 | re = /^(.+?)(ss|i)es$/;
80 | re2 = /^(.+?)([^s])s$/;
81 |
82 | if (re.test(w))
83 | w = w.replace(re,"$1$2");
84 | else if (re2.test(w))
85 | w = w.replace(re2,"$1$2");
86 |
87 | // Step 1b
88 | re = /^(.+?)eed$/;
89 | re2 = /^(.+?)(ed|ing)$/;
90 | if (re.test(w)) {
91 | var fp = re.exec(w);
92 | re = new RegExp(mgr0);
93 | if (re.test(fp[1])) {
94 | re = /.$/;
95 | w = w.replace(re,"");
96 | }
97 | }
98 | else if (re2.test(w)) {
99 | var fp = re2.exec(w);
100 | stem = fp[1];
101 | re2 = new RegExp(s_v);
102 | if (re2.test(stem)) {
103 | w = stem;
104 | re2 = /(at|bl|iz)$/;
105 | re3 = new RegExp("([^aeiouylsz])\\1$");
106 | re4 = new RegExp("^" + C + v + "[^aeiouwxy]$");
107 | if (re2.test(w))
108 | w = w + "e";
109 | else if (re3.test(w)) {
110 | re = /.$/;
111 | w = w.replace(re,"");
112 | }
113 | else if (re4.test(w))
114 | w = w + "e";
115 | }
116 | }
117 |
118 | // Step 1c
119 | re = /^(.+?)y$/;
120 | if (re.test(w)) {
121 | var fp = re.exec(w);
122 | stem = fp[1];
123 | re = new RegExp(s_v);
124 | if (re.test(stem))
125 | w = stem + "i";
126 | }
127 |
128 | // Step 2
129 | re = /^(.+?)(ational|tional|enci|anci|izer|bli|alli|entli|eli|ousli|ization|ation|ator|alism|iveness|fulness|ousness|aliti|iviti|biliti|logi)$/;
130 | if (re.test(w)) {
131 | var fp = re.exec(w);
132 | stem = fp[1];
133 | suffix = fp[2];
134 | re = new RegExp(mgr0);
135 | if (re.test(stem))
136 | w = stem + step2list[suffix];
137 | }
138 |
139 | // Step 3
140 | re = /^(.+?)(icate|ative|alize|iciti|ical|ful|ness)$/;
141 | if (re.test(w)) {
142 | var fp = re.exec(w);
143 | stem = fp[1];
144 | suffix = fp[2];
145 | re = new RegExp(mgr0);
146 | if (re.test(stem))
147 | w = stem + step3list[suffix];
148 | }
149 |
150 | // Step 4
151 | re = /^(.+?)(al|ance|ence|er|ic|able|ible|ant|ement|ment|ent|ou|ism|ate|iti|ous|ive|ize)$/;
152 | re2 = /^(.+?)(s|t)(ion)$/;
153 | if (re.test(w)) {
154 | var fp = re.exec(w);
155 | stem = fp[1];
156 | re = new RegExp(mgr1);
157 | if (re.test(stem))
158 | w = stem;
159 | }
160 | else if (re2.test(w)) {
161 | var fp = re2.exec(w);
162 | stem = fp[1] + fp[2];
163 | re2 = new RegExp(mgr1);
164 | if (re2.test(stem))
165 | w = stem;
166 | }
167 |
168 | // Step 5
169 | re = /^(.+?)e$/;
170 | if (re.test(w)) {
171 | var fp = re.exec(w);
172 | stem = fp[1];
173 | re = new RegExp(mgr1);
174 | re2 = new RegExp(meq1);
175 | re3 = new RegExp("^" + C + v + "[^aeiouwxy]$");
176 | if (re.test(stem) || (re2.test(stem) && !(re3.test(stem))))
177 | w = stem;
178 | }
179 | re = /ll$/;
180 | re2 = new RegExp(mgr1);
181 | if (re.test(w) && re2.test(w)) {
182 | re = /.$/;
183 | w = w.replace(re,"");
184 | }
185 |
186 | // and turn initial Y back to y
187 | if (firstch == "y")
188 | w = firstch.toLowerCase() + w.substr(1);
189 | return w;
190 | }
191 | }
192 |
193 |
--------------------------------------------------------------------------------
/docs/_build/html/_static/minus.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ecastillot/SeisMonitor/fa5acfd767f93b5d3a6010822127936319ddd6c0/docs/_build/html/_static/minus.png
--------------------------------------------------------------------------------
/docs/_build/html/_static/plus.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ecastillot/SeisMonitor/fa5acfd767f93b5d3a6010822127936319ddd6c0/docs/_build/html/_static/plus.png
--------------------------------------------------------------------------------
/docs/_build/html/_static/pygments.css:
--------------------------------------------------------------------------------
1 | pre { line-height: 125%; }
2 | td.linenos .normal { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; }
3 | span.linenos { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; }
4 | td.linenos .special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; }
5 | span.linenos.special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; }
6 | .highlight .hll { background-color: #ffffcc }
7 | .highlight { background: #f8f8f8; }
8 | .highlight .c { color: #3D7B7B; font-style: italic } /* Comment */
9 | .highlight .err { border: 1px solid #F00 } /* Error */
10 | .highlight .k { color: #008000; font-weight: bold } /* Keyword */
11 | .highlight .o { color: #666 } /* Operator */
12 | .highlight .ch { color: #3D7B7B; font-style: italic } /* Comment.Hashbang */
13 | .highlight .cm { color: #3D7B7B; font-style: italic } /* Comment.Multiline */
14 | .highlight .cp { color: #9C6500 } /* Comment.Preproc */
15 | .highlight .cpf { color: #3D7B7B; font-style: italic } /* Comment.PreprocFile */
16 | .highlight .c1 { color: #3D7B7B; font-style: italic } /* Comment.Single */
17 | .highlight .cs { color: #3D7B7B; font-style: italic } /* Comment.Special */
18 | .highlight .gd { color: #A00000 } /* Generic.Deleted */
19 | .highlight .ge { font-style: italic } /* Generic.Emph */
20 | .highlight .ges { font-weight: bold; font-style: italic } /* Generic.EmphStrong */
21 | .highlight .gr { color: #E40000 } /* Generic.Error */
22 | .highlight .gh { color: #000080; font-weight: bold } /* Generic.Heading */
23 | .highlight .gi { color: #008400 } /* Generic.Inserted */
24 | .highlight .go { color: #717171 } /* Generic.Output */
25 | .highlight .gp { color: #000080; font-weight: bold } /* Generic.Prompt */
26 | .highlight .gs { font-weight: bold } /* Generic.Strong */
27 | .highlight .gu { color: #800080; font-weight: bold } /* Generic.Subheading */
28 | .highlight .gt { color: #04D } /* Generic.Traceback */
29 | .highlight .kc { color: #008000; font-weight: bold } /* Keyword.Constant */
30 | .highlight .kd { color: #008000; font-weight: bold } /* Keyword.Declaration */
31 | .highlight .kn { color: #008000; font-weight: bold } /* Keyword.Namespace */
32 | .highlight .kp { color: #008000 } /* Keyword.Pseudo */
33 | .highlight .kr { color: #008000; font-weight: bold } /* Keyword.Reserved */
34 | .highlight .kt { color: #B00040 } /* Keyword.Type */
35 | .highlight .m { color: #666 } /* Literal.Number */
36 | .highlight .s { color: #BA2121 } /* Literal.String */
37 | .highlight .na { color: #687822 } /* Name.Attribute */
38 | .highlight .nb { color: #008000 } /* Name.Builtin */
39 | .highlight .nc { color: #00F; font-weight: bold } /* Name.Class */
40 | .highlight .no { color: #800 } /* Name.Constant */
41 | .highlight .nd { color: #A2F } /* Name.Decorator */
42 | .highlight .ni { color: #717171; font-weight: bold } /* Name.Entity */
43 | .highlight .ne { color: #CB3F38; font-weight: bold } /* Name.Exception */
44 | .highlight .nf { color: #00F } /* Name.Function */
45 | .highlight .nl { color: #767600 } /* Name.Label */
46 | .highlight .nn { color: #00F; font-weight: bold } /* Name.Namespace */
47 | .highlight .nt { color: #008000; font-weight: bold } /* Name.Tag */
48 | .highlight .nv { color: #19177C } /* Name.Variable */
49 | .highlight .ow { color: #A2F; font-weight: bold } /* Operator.Word */
50 | .highlight .w { color: #BBB } /* Text.Whitespace */
51 | .highlight .mb { color: #666 } /* Literal.Number.Bin */
52 | .highlight .mf { color: #666 } /* Literal.Number.Float */
53 | .highlight .mh { color: #666 } /* Literal.Number.Hex */
54 | .highlight .mi { color: #666 } /* Literal.Number.Integer */
55 | .highlight .mo { color: #666 } /* Literal.Number.Oct */
56 | .highlight .sa { color: #BA2121 } /* Literal.String.Affix */
57 | .highlight .sb { color: #BA2121 } /* Literal.String.Backtick */
58 | .highlight .sc { color: #BA2121 } /* Literal.String.Char */
59 | .highlight .dl { color: #BA2121 } /* Literal.String.Delimiter */
60 | .highlight .sd { color: #BA2121; font-style: italic } /* Literal.String.Doc */
61 | .highlight .s2 { color: #BA2121 } /* Literal.String.Double */
62 | .highlight .se { color: #AA5D1F; font-weight: bold } /* Literal.String.Escape */
63 | .highlight .sh { color: #BA2121 } /* Literal.String.Heredoc */
64 | .highlight .si { color: #A45A77; font-weight: bold } /* Literal.String.Interpol */
65 | .highlight .sx { color: #008000 } /* Literal.String.Other */
66 | .highlight .sr { color: #A45A77 } /* Literal.String.Regex */
67 | .highlight .s1 { color: #BA2121 } /* Literal.String.Single */
68 | .highlight .ss { color: #19177C } /* Literal.String.Symbol */
69 | .highlight .bp { color: #008000 } /* Name.Builtin.Pseudo */
70 | .highlight .fm { color: #00F } /* Name.Function.Magic */
71 | .highlight .vc { color: #19177C } /* Name.Variable.Class */
72 | .highlight .vg { color: #19177C } /* Name.Variable.Global */
73 | .highlight .vi { color: #19177C } /* Name.Variable.Instance */
74 | .highlight .vm { color: #19177C } /* Name.Variable.Magic */
75 | .highlight .il { color: #666 } /* Literal.Number.Integer.Long */
--------------------------------------------------------------------------------
/docs/_build/html/_static/sphinx_highlight.js:
--------------------------------------------------------------------------------
1 | /* Highlighting utilities for Sphinx HTML documentation. */
2 | "use strict";
3 |
4 | const SPHINX_HIGHLIGHT_ENABLED = true
5 |
6 | /**
7 | * highlight a given string on a node by wrapping it in
8 | * span elements with the given class name.
9 | */
10 | const _highlight = (node, addItems, text, className) => {
11 | if (node.nodeType === Node.TEXT_NODE) {
12 | const val = node.nodeValue;
13 | const parent = node.parentNode;
14 | const pos = val.toLowerCase().indexOf(text);
15 | if (
16 | pos >= 0 &&
17 | !parent.classList.contains(className) &&
18 | !parent.classList.contains("nohighlight")
19 | ) {
20 | let span;
21 |
22 | const closestNode = parent.closest("body, svg, foreignObject");
23 | const isInSVG = closestNode && closestNode.matches("svg");
24 | if (isInSVG) {
25 | span = document.createElementNS("http://www.w3.org/2000/svg", "tspan");
26 | } else {
27 | span = document.createElement("span");
28 | span.classList.add(className);
29 | }
30 |
31 | span.appendChild(document.createTextNode(val.substr(pos, text.length)));
32 | const rest = document.createTextNode(val.substr(pos + text.length));
33 | parent.insertBefore(
34 | span,
35 | parent.insertBefore(
36 | rest,
37 | node.nextSibling
38 | )
39 | );
40 | node.nodeValue = val.substr(0, pos);
41 | /* There may be more occurrences of search term in this node. So call this
42 | * function recursively on the remaining fragment.
43 | */
44 | _highlight(rest, addItems, text, className);
45 |
46 | if (isInSVG) {
47 | const rect = document.createElementNS(
48 | "http://www.w3.org/2000/svg",
49 | "rect"
50 | );
51 | const bbox = parent.getBBox();
52 | rect.x.baseVal.value = bbox.x;
53 | rect.y.baseVal.value = bbox.y;
54 | rect.width.baseVal.value = bbox.width;
55 | rect.height.baseVal.value = bbox.height;
56 | rect.setAttribute("class", className);
57 | addItems.push({ parent: parent, target: rect });
58 | }
59 | }
60 | } else if (node.matches && !node.matches("button, select, textarea")) {
61 | node.childNodes.forEach((el) => _highlight(el, addItems, text, className));
62 | }
63 | };
64 | const _highlightText = (thisNode, text, className) => {
65 | let addItems = [];
66 | _highlight(thisNode, addItems, text, className);
67 | addItems.forEach((obj) =>
68 | obj.parent.insertAdjacentElement("beforebegin", obj.target)
69 | );
70 | };
71 |
72 | /**
73 | * Small JavaScript module for the documentation.
74 | */
75 | const SphinxHighlight = {
76 |
77 | /**
78 | * highlight the search words provided in localstorage in the text
79 | */
80 | highlightSearchWords: () => {
81 | if (!SPHINX_HIGHLIGHT_ENABLED) return; // bail if no highlight
82 |
83 | // get and clear terms from localstorage
84 | const url = new URL(window.location);
85 | const highlight =
86 | localStorage.getItem("sphinx_highlight_terms")
87 | || url.searchParams.get("highlight")
88 | || "";
89 | localStorage.removeItem("sphinx_highlight_terms")
90 | url.searchParams.delete("highlight");
91 | window.history.replaceState({}, "", url);
92 |
93 | // get individual terms from highlight string
94 | const terms = highlight.toLowerCase().split(/\s+/).filter(x => x);
95 | if (terms.length === 0) return; // nothing to do
96 |
97 | // There should never be more than one element matching "div.body"
98 | const divBody = document.querySelectorAll("div.body");
99 | const body = divBody.length ? divBody[0] : document.querySelector("body");
100 | window.setTimeout(() => {
101 | terms.forEach((term) => _highlightText(body, term, "highlighted"));
102 | }, 10);
103 |
104 | const searchBox = document.getElementById("searchbox");
105 | if (searchBox === null) return;
106 | searchBox.appendChild(
107 | document
108 | .createRange()
109 | .createContextualFragment(
110 | '' +
111 | '' +
112 | _("Hide Search Matches") +
113 | "
"
114 | )
115 | );
116 | },
117 |
118 | /**
119 | * helper function to hide the search marks again
120 | */
121 | hideSearchWords: () => {
122 | document
123 | .querySelectorAll("#searchbox .highlight-link")
124 | .forEach((el) => el.remove());
125 | document
126 | .querySelectorAll("span.highlighted")
127 | .forEach((el) => el.classList.remove("highlighted"));
128 | localStorage.removeItem("sphinx_highlight_terms")
129 | },
130 |
131 | initEscapeListener: () => {
132 | // only install a listener if it is really needed
133 | if (!DOCUMENTATION_OPTIONS.ENABLE_SEARCH_SHORTCUTS) return;
134 |
135 | document.addEventListener("keydown", (event) => {
136 | // bail for input elements
137 | if (BLACKLISTED_KEY_CONTROL_ELEMENTS.has(document.activeElement.tagName)) return;
138 | // bail with special keys
139 | if (event.shiftKey || event.altKey || event.ctrlKey || event.metaKey) return;
140 | if (DOCUMENTATION_OPTIONS.ENABLE_SEARCH_SHORTCUTS && (event.key === "Escape")) {
141 | SphinxHighlight.hideSearchWords();
142 | event.preventDefault();
143 | }
144 | });
145 | },
146 | };
147 |
148 | _ready(() => {
149 | /* Do not call highlightSearchWords() when we are on the search page.
150 | * It will highlight words from the *previous* search query.
151 | */
152 | if (typeof Search === "undefined") SphinxHighlight.highlightSearchWords();
153 | SphinxHighlight.initEscapeListener();
154 | });
155 |
--------------------------------------------------------------------------------
/docs/_build/html/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 | SeisMonitor documentation — SeisMonitor 0.0.57 documentation
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
54 |
55 |
59 |
60 |
61 |
62 |
72 |
73 |
74 |
75 |
76 | SeisMonitor documentation
77 |
78 |
Contents:
79 |
108 |
109 |
110 |
111 |
112 |
113 |
114 |
130 |
131 |
132 |
133 |
134 |
139 |
140 |
141 |
--------------------------------------------------------------------------------
/docs/_build/html/modules.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 | SeisMonitor — SeisMonitor 0.0.57 documentation
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
51 |
52 |
56 |
57 |
58 |
59 |
69 |
70 |
71 |
72 |
73 | SeisMonitor
74 |
83 |
84 |
85 |
86 |
87 |
88 |
102 |
103 |
104 |
105 |
106 |
111 |
112 |
113 |
--------------------------------------------------------------------------------
/docs/_build/html/objects.inv:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ecastillot/SeisMonitor/fa5acfd767f93b5d3a6010822127936319ddd6c0/docs/_build/html/objects.inv
--------------------------------------------------------------------------------
/docs/_build/html/search.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 | Search — SeisMonitor 0.0.57 documentation
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
55 |
56 |
60 |
61 |
62 |
63 |
64 |
65 |
66 | - Search
67 | -
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
104 |
105 |
106 |
107 |
108 |
113 |
116 |
117 |
118 |
119 |
120 |
121 |
122 |
--------------------------------------------------------------------------------
/docs/conf.py:
--------------------------------------------------------------------------------
1 | # Configuration file for the Sphinx documentation builder.
2 | #
3 | # For the full list of built-in configuration values, see the documentation:
4 | # https://www.sphinx-doc.org/en/master/usage/configuration.html
5 |
6 | # -- Project information -----------------------------------------------------
7 | # https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information
8 | import os
9 | import sys
10 |
11 | sys.path.insert(0,os.path.abspath(".."))
12 |
13 | project = 'SeisMonitor'
14 | copyright = '2025, Emmanuel Castillo'
15 | author = 'Emmanuel Castillo'
16 | release = '0.0.57'
17 |
18 | # -- General configuration ---------------------------------------------------
19 | # https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
20 |
21 | extensions = ["sphinx.ext.todo","sphinx.ext.napoleon","sphinx.ext.viewcode","sphinx.ext.autodoc",'sphinx_rtd_theme']
22 |
23 | templates_path = ['_templates']
24 | exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
25 |
26 |
27 |
28 | # -- Options for HTML output -------------------------------------------------
29 | # https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output
30 |
31 | html_theme = 'sphinx_rtd_theme'
32 | html_static_path = ['_static']
33 |
--------------------------------------------------------------------------------
/docs/figures/f1-1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ecastillot/SeisMonitor/fa5acfd767f93b5d3a6010822127936319ddd6c0/docs/figures/f1-1.png
--------------------------------------------------------------------------------
/docs/figures/f1.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ecastillot/SeisMonitor/fa5acfd767f93b5d3a6010822127936319ddd6c0/docs/figures/f1.pdf
--------------------------------------------------------------------------------
/docs/figures/f7.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ecastillot/SeisMonitor/fa5acfd767f93b5d3a6010822127936319ddd6c0/docs/figures/f7.pdf
--------------------------------------------------------------------------------
/docs/figures/f8-1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ecastillot/SeisMonitor/fa5acfd767f93b5d3a6010822127936319ddd6c0/docs/figures/f8-1.png
--------------------------------------------------------------------------------
/docs/figures/f8.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ecastillot/SeisMonitor/fa5acfd767f93b5d3a6010822127936319ddd6c0/docs/figures/f8.pdf
--------------------------------------------------------------------------------
/docs/figures/f9-1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ecastillot/SeisMonitor/fa5acfd767f93b5d3a6010822127936319ddd6c0/docs/figures/f9-1.png
--------------------------------------------------------------------------------
/docs/figures/seismonitor.PNG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ecastillot/SeisMonitor/fa5acfd767f93b5d3a6010822127936319ddd6c0/docs/figures/seismonitor.PNG
--------------------------------------------------------------------------------
/docs/index.rst:
--------------------------------------------------------------------------------
1 | .. SeisMonitor documentation master file, created by
2 | sphinx-quickstart on Sun Mar 30 13:51:08 2025.
3 | You can adapt this file completely to your liking, but it should at least
4 | contain the root `toctree` directive.
5 |
6 | SeisMonitor documentation
7 | =========================
8 |
9 | .. toctree::
10 | :maxdepth: 2
11 | :caption: Contents:
12 |
13 | SeisMonitor.examples
14 | SeisMonitor.core
15 | SeisMonitor.monitor
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/docs/make.bat:
--------------------------------------------------------------------------------
1 | @ECHO OFF
2 |
3 | pushd %~dp0
4 |
5 | REM Command file for Sphinx documentation
6 |
7 | if "%SPHINXBUILD%" == "" (
8 | set SPHINXBUILD=sphinx-build
9 | )
10 | set SOURCEDIR=.
11 | set BUILDDIR=_build
12 |
13 | %SPHINXBUILD% >NUL 2>NUL
14 | if errorlevel 9009 (
15 | echo.
16 | echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
17 | echo.installed, then set the SPHINXBUILD environment variable to point
18 | echo.to the full path of the 'sphinx-build' executable. Alternatively you
19 | echo.may add the Sphinx directory to PATH.
20 | echo.
21 | echo.If you don't have Sphinx installed, grab it from
22 | echo.https://www.sphinx-doc.org/
23 | exit /b 1
24 | )
25 |
26 | if "%1" == "" goto help
27 |
28 | %SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
29 | goto end
30 |
31 | :help
32 | %SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
33 |
34 | :end
35 | popd
36 |
--------------------------------------------------------------------------------
/docs/modules.rst:
--------------------------------------------------------------------------------
1 | SeisMonitor
2 | ===========
3 |
4 | .. toctree::
5 | :maxdepth: 2
6 |
7 | SeisMonitor.monitor.downloader
8 |
9 |
--------------------------------------------------------------------------------
/docs/requirements.txt:
--------------------------------------------------------------------------------
1 | sphinx
2 | sphinx-rtd-theme
3 | obspy
4 | pytest
5 | pyproj
6 | GitPython
7 | matplotlib
8 | pandas
9 | tqdm
10 | scipy
11 | pexpect
12 | tensorflow==2.15
13 | keras==2.15
14 | numpy~=1.24
15 | keyring >=15.1
16 | pkginfo>=1.4.2
17 | h5py>=3.8
18 | gmma @ git+https://github.com/wayneweiqiang/GaMMA.git@1a5a5371c294727d2f814bcfd48f73bde94627b4
19 | EQTransformer @ git+https://github.com/ecastillot/EQTransformer.git@master
20 |
21 |
--------------------------------------------------------------------------------
/examples/3.associator.ipynb:
--------------------------------------------------------------------------------
1 | {
2 | "cells": [
3 | {
4 | "cell_type": "markdown",
5 | "metadata": {},
6 | "source": [
7 | ""
8 | ]
9 | },
10 | {
11 | "cell_type": "markdown",
12 | "metadata": {},
13 | "source": [
14 | "**This code is necessary on colab to install SeisMonitor.** "
15 | ]
16 | },
17 | {
18 | "cell_type": "code",
19 | "execution_count": null,
20 | "metadata": {},
21 | "outputs": [],
22 | "source": [
23 | "import sys\n",
24 | "if 'google.colab' in sys.modules:\n",
25 | " !pip install SeisMonitor\n",
26 | " !pip install git+https://github.com/ecastillot/EQTransformer.git@master\n",
27 | " !pip install git+https://github.com/wayneweiqiang/GaMMA.git"
28 | ]
29 | },
30 | {
31 | "cell_type": "markdown",
32 | "metadata": {},
33 | "source": [
34 | "**Please restart the kernel. It's mandatory to get everything up and running.**"
35 | ]
36 | },
37 | {
38 | "cell_type": "markdown",
39 | "metadata": {},
40 | "source": [
41 | "Firstable, as we are using colab, we have to download the picks data for this example."
42 | ]
43 | },
44 | {
45 | "cell_type": "code",
46 | "execution_count": null,
47 | "metadata": {},
48 | "outputs": [],
49 | "source": [
50 | "import os\n",
51 | "from SeisMonitor.utils4examples import clone_seismonitor_data\n",
52 | "\n",
53 | "monitor_path = os.path.join(os.path.dirname(os.getcwd()),\"6m\")\n",
54 | "others = monitor_path = os.path.join(os.path.dirname(os.getcwd()),\"others\")\n",
55 | "\n",
56 | "clone_seismonitor_data(others,branch=\"others\")\n",
57 | "picks = os.path.join(others,\"picks\")\n",
58 | "stations = os.path.join(others,\"stations\")\n",
59 | "\n",
60 | "\n",
61 | "print(\"others dir: \",others)\n",
62 | "print(\"Important folders in others directory\",os.listdir(others))"
63 | ]
64 | },
65 | {
66 | "cell_type": "markdown",
67 | "metadata": {},
68 | "source": [
69 | "We will use seismic phases picked by PhaseNet and EQTransformer using the SeisMonitor format. Take a look in [2.picker.ipynb](https://colab.research.google.com/github/ecastillot/SeisMonitor/blob/master/examples/2.picker.ipynb). \n",
70 | "\n",
71 | "We will associate those seismic phases using GaMMA."
72 | ]
73 | },
74 | {
75 | "cell_type": "markdown",
76 | "metadata": {},
77 | "source": [
78 | "# Association with GaMMA"
79 | ]
80 | },
81 | {
82 | "cell_type": "code",
83 | "execution_count": null,
84 | "metadata": {},
85 | "outputs": [],
86 | "source": [
87 | "import os\n",
88 | "from SeisMonitor.monitor.associator.ai import GaMMA,GaMMAObj\n",
89 | "from SeisMonitor.monitor.associator import utils as asut"
90 | ]
91 | },
92 | {
93 | "cell_type": "markdown",
94 | "metadata": {},
95 | "source": [
96 | "We create the object: GaMMAObj, which contains the GaMMA parameters."
97 | ]
98 | },
99 | {
100 | "cell_type": "code",
101 | "execution_count": null,
102 | "metadata": {},
103 | "outputs": [],
104 | "source": [
105 | "region = [-76.729, -72.315,1.55, 5.314,0, 150]\n",
106 | "gc = GaMMAObj(region,\"EPSG:3116\",\n",
107 | " use_amplitude = False,\n",
108 | " use_dbscan=False,\n",
109 | " calculate_amp=False)"
110 | ]
111 | },
112 | {
113 | "cell_type": "markdown",
114 | "metadata": {},
115 | "source": [
116 | "- GaMMA is instanced with GaMMAObj.\n",
117 | "- We use **asociate** method to asociate seismic phases. The input parameters are:\n",
118 | " - Picks filepath using seismonitor format.\n",
119 | " - Inventory filepath of the seismic network.\n",
120 | " - Output folder for GaMMA"
121 | ]
122 | },
123 | {
124 | "cell_type": "markdown",
125 | "metadata": {},
126 | "source": [
127 | "## Associations for EQTransformer picks"
128 | ]
129 | },
130 | {
131 | "cell_type": "code",
132 | "execution_count": null,
133 | "metadata": {},
134 | "outputs": [],
135 | "source": [
136 | "inv = os.path.join(stations,\"inv.xml\")\n",
137 | "picks = os.path.join(picks,\"eqt_seismonitor_picks.csv\")\n",
138 | "out_dir = os.path.join(monitor_path,\"gamma_asso\",\"eqt\")\n",
139 | "\n",
140 | "g = GaMMA(gc)\n",
141 | "obspy_catalog, df_catalog,df_picks = g.associate(picks,inv,out_dir)\n",
142 | "print(obspy_catalog)"
143 | ]
144 | },
145 | {
146 | "cell_type": "code",
147 | "execution_count": null,
148 | "metadata": {},
149 | "outputs": [],
150 | "source": [
151 | "import matplotlib.pyplot as plt\n",
152 | "fig = plt.figure(figsize=(10, 10))\n",
153 | "ax = fig.add_subplot(111)\n",
154 | "ax.set_aspect(\"equal\")\n",
155 | "ax.scatter(df_catalog[\"x(km)\"], df_catalog[\"y(km)\"])\n",
156 | "ax.set_xlabel(\"x(km)\")\n",
157 | "ax.set_ylabel(\"y(km)\")\n",
158 | "ax.set_xlim(950,1050)\n",
159 | "ax.set_ylim(780,880)\n",
160 | "plt.show()"
161 | ]
162 | },
163 | {
164 | "cell_type": "markdown",
165 | "metadata": {},
166 | "source": [
167 | "## Associations with PhaseNet"
168 | ]
169 | },
170 | {
171 | "cell_type": "code",
172 | "execution_count": null,
173 | "metadata": {},
174 | "outputs": [],
175 | "source": [
176 | "inv = os.path.join(stations,\"inv.xml\")\n",
177 | "picks = os.path.join(picks,\"pnet_seismonitor_picks.csv\")\n",
178 | "out_dir = os.path.join(monitor_path,\"gamma_asso\",\"pnet\")\n",
179 | "\n",
180 | "g = GaMMA(gc)\n",
181 | "obspy_catalog, df_catalog,df_picks = g.associate(picks,inv,out_dir)\n",
182 | "print(obspy_catalog)"
183 | ]
184 | },
185 | {
186 | "cell_type": "code",
187 | "execution_count": null,
188 | "metadata": {},
189 | "outputs": [],
190 | "source": [
191 | "import matplotlib.pyplot as plt\n",
192 | "fig = plt.figure(figsize=(10, 10))\n",
193 | "ax = fig.add_subplot(111)\n",
194 | "ax.set_aspect(\"equal\")\n",
195 | "ax.scatter(df_catalog[\"x(km)\"], df_catalog[\"y(km)\"])\n",
196 | "ax.set_xlabel(\"x(km)\")\n",
197 | "ax.set_ylabel(\"y(km)\")\n",
198 | "ax.set_xlim(950,1050)\n",
199 | "ax.set_ylim(780,880)\n",
200 | "plt.show()"
201 | ]
202 | },
203 | {
204 | "cell_type": "code",
205 | "execution_count": null,
206 | "metadata": {},
207 | "outputs": [],
208 | "source": []
209 | }
210 | ],
211 | "metadata": {
212 | "kernelspec": {
213 | "display_name": "Python 3.10.10 ('test2')",
214 | "language": "python",
215 | "name": "python3"
216 | },
217 | "language_info": {
218 | "codemirror_mode": {
219 | "name": "ipython",
220 | "version": 3
221 | },
222 | "file_extension": ".py",
223 | "mimetype": "text/x-python",
224 | "name": "python",
225 | "nbconvert_exporter": "python",
226 | "pygments_lexer": "ipython3",
227 | "version": "3.10.10"
228 | },
229 | "orig_nbformat": 4,
230 | "vscode": {
231 | "interpreter": {
232 | "hash": "a74d57761e21e3f420ede7bd75df8cecbe2e27c0773b80e80e5558f682c0ea38"
233 | }
234 | }
235 | },
236 | "nbformat": 4,
237 | "nbformat_minor": 2
238 | }
239 |
--------------------------------------------------------------------------------
/examples/XO_project/0.downloader.py:
--------------------------------------------------------------------------------
1 | # /**
2 | # * @author Emmanuel Castillo
3 | # * @email ecastillot@unal.edu.co / castillo.280997@gmail.com
4 | # * @create date 2023-08-05 21:03:30
5 | # * @modify date 2023-08-05 21:03:30
6 | # * @desc [description]
7 | # */
8 |
9 | import os
10 | from obspy.core.utcdatetime import UTCDateTime
11 | from obspy.clients.fdsn import Client as FDSNClient
12 | from SeisMonitor.core.objects import WaveformRestrictions,Provider
13 | from SeisMonitor.monitor.downloader.seismonitor import MseedDownloader
14 |
15 | monitor_path = r"/home/emmanuel/XO_monitor_results"
16 |
17 | sgc_rest = WaveformRestrictions(network="XO",
18 | station="EP*",
19 | location="*",
20 | channel="*",
21 | starttime=UTCDateTime("2018-07-01T00:00:00.000000Z"),
22 | endtime=UTCDateTime("2018-07-01T04:00:00.000000Z"),
23 | location_preferences=["","00","20","10","40"],
24 | channel_preferences=["HH","BH","EH","HN","HL"],
25 | filter_networks=[],
26 | filter_stations=[],
27 | )
28 |
29 |
30 | ####### NO MODIFY THE FOLLOWING
31 |
32 |
33 | sgc_client = FDSNClient('IRIS')
34 | sgc_provider = Provider(sgc_client,sgc_rest)
35 | md = MseedDownloader(providers=[sgc_provider])
36 |
37 | json_path = os.path.join(monitor_path,"stations")
38 | inv,json = md.make_inv_and_json(json_path)
39 |
40 | mseed_storage = os.path.join(monitor_path,"downloads/{station}/{network}.{station}.{location}.{channel}__{starttime}__{endtime}.mseed")
41 | md.download(mseed_storage,
42 | picker_args={"batch_size":100,"overlap":0.3,"length":60},
43 | chunklength_in_sec=7200,n_processor=None)
--------------------------------------------------------------------------------
/examples/XO_project/1.picker.py:
--------------------------------------------------------------------------------
1 | import os
2 | from SeisMonitor.monitor.picker.ai import EQTransformer,EQTransformerObj
3 | from SeisMonitor.monitor.picker import utils as piut
4 |
5 | monitor_path = "/home/emmanuel/XO_monitor_results"
6 | eqt_model = "/home/emmanuel/XO_monitor_results/picking_models/eqt/EqT_original_model.h5"
7 | eqtobj = EQTransformerObj(model_path=eqt_model,
8 | n_processor = 6,
9 | overlap = 0.3,
10 | detection_threshold =0.1,
11 | P_threshold = 0.01,
12 | S_threshold = 0.01,
13 | batch_size = 100,
14 | number_of_plots = 10,
15 | plot_mode = None )
16 |
17 | ####### NO MODIFY THE FOLLOWING
18 |
19 | out_dir = os.path.join(monitor_path ,"picks","eqt")
20 | result = os.path.join(monitor_path ,"picks","eqt","seismonitor_picks.csv")
21 | downloads = os.path.join(monitor_path ,"downloads")
22 | stations = os.path.join(monitor_path ,"stations")
23 |
24 | eqt = EQTransformer(eqtobj)
25 | eqt.pick(downloads,stations,out_dir)
26 | piut.eqt_picks_2_seismonitor_fmt(out_dir,downloads,result)
--------------------------------------------------------------------------------
/examples/XO_project/2.associator.py:
--------------------------------------------------------------------------------
1 | import os
2 | from SeisMonitor.monitor.associator.ai import GaMMA,GaMMAObj
3 | from SeisMonitor.monitor.associator import utils as asut
4 | import matplotlib.pyplot as plt
5 |
6 | monitor_path = "/home/emmanuel/XO_monitor_results"
7 |
8 | ####### NO MODIFY THE FOLLOWING
9 |
10 | region = [-162, -150,50, 60,0, 60]
11 | gc = GaMMAObj(region,"EPSG:3338",
12 | use_amplitude = False,
13 | use_dbscan=False,
14 | calculate_amp=False,
15 | method="BGMM",
16 | min_picks_per_eq=5,
17 | oversample_factor=1,
18 | max_sigma11=2.0,
19 | vel = {"p": 7.2, "s": 7.2/ 1.70})
20 |
21 | inv = os.path.join(monitor_path,"stations","inv.xml")
22 | picks = os.path.join(monitor_path,"picks","eqt","seismonitor_picks.csv")
23 | out_dir = os.path.join(monitor_path,"gamma_asso","eqt")
24 |
25 | g = GaMMA(gc)
26 | obspy_catalog, df_catalog,df_picks = g.associate(picks,inv,out_dir)
27 | print(obspy_catalog)
28 |
29 |
30 | ## just use this once to review the earthquake locations
31 | fig = plt.figure(figsize=(10, 10))
32 | ax = fig.add_subplot(111)
33 | ax.set_aspect("equal")
34 | ax.scatter(df_catalog["x(km)"], df_catalog["y(km)"])
35 | ax.set_xlabel("x(km)")
36 | ax.set_ylabel("y(km)")
37 | plt.show()
--------------------------------------------------------------------------------
/examples/XO_project/3.prepare_locator.py:
--------------------------------------------------------------------------------
1 | import os
2 | from SeisMonitor.monitor.locator.nlloc.nlloc import NLLoc
3 | from SeisMonitor.monitor.locator import utils as lut
4 | from SeisMonitor.monitor.locator.nlloc import utils as nlloc_utils
5 | from obspy import read_events
6 | from obspy.core.event.catalog import Catalog
7 |
8 | monitor_path = "/home/emmanuel/XO_monitor_results"
9 | nlloc_core_path = "/home/emmanuel/NLLoc"
10 | vel_path = "/home/emmanuel/XO_monitor/vel_model.csv"
11 |
12 | # download nlloc #this only works for ubuntu, if it doesn't work, you need to install NLLOC by yourself
13 | nlloc_utils.download_nlloc(nlloc_core_path) ##ONLY ONCE, IT'S TO INSTALL NLLOC
14 |
15 |
16 |
17 | ####### NO MODIFY THE FOLLOWING
18 |
19 | out_dir = os.path.join(monitor_path,"loc","nlloc")
20 | asso_dir = os.path.join(monitor_path,"gamma_asso","eqt")
21 | inv = os.path.join(monitor_path,"stations","inv.xml")
22 | nlloc_grid = os.path.join(out_dir,"nlloc_grid")
23 |
24 | vel_model = lut.VelModel(vel_path,model_name="vel_model")
25 | stations = lut.Stations(inv)
26 |
27 | nlloc = NLLoc(
28 | core_path = nlloc_core_path,
29 | agency="SeisMonitor",
30 | region = [-162, -150,50, 60,-2, 60],
31 | vel_model = vel_model,
32 | stations = stations,
33 | delta_in_km = 2,
34 | tmp_folder=nlloc_grid ### TAKE IN MIND THAT IN THIS FOLDER YOU WILL DOWNLOAD YOUR TTs, SO IT CONSUMES A LOT OF SPACE IN YOUR DISK
35 | )
36 |
37 | nlloc.compute_travel_times() ### ONLY ONCE, to compute the travel times, after the first run, this line it's not necessary
--------------------------------------------------------------------------------
/examples/XO_project/4.locator.py:
--------------------------------------------------------------------------------
1 | import os
2 | from SeisMonitor.monitor.locator.nlloc.nlloc import NLLoc
3 | from SeisMonitor.monitor.locator import utils as lut
4 | from SeisMonitor.monitor.locator.nlloc import utils as nlloc_utils
5 | from obspy import read_events
6 | from obspy.core.event.catalog import Catalog
7 |
8 | nlloc_core_path = "/home/emmanuel/NLLoc"
9 | monitor_path = "/home/emmanuel/XO_monitor_results"
10 | vel_path = "/home/emmanuel/XO_monitor/vel_model.csv"
11 |
12 |
13 | ####### NO MODIFY THE FOLLOWING
14 |
15 | out_dir = os.path.join(monitor_path,"loc","nlloc")
16 | asso_dir = os.path.join(monitor_path,"gamma_asso","eqt")
17 | gamma__catalog = os.path.join(asso_dir,"associations.xml")
18 | inv = os.path.join(monitor_path,"stations","inv.xml")
19 | nlloc_grid = os.path.join(out_dir,"nlloc_grid")
20 |
21 | vel_model = lut.VelModel(vel_path,model_name="vel_model")
22 | stations = lut.Stations(inv)
23 |
24 | nlloc = NLLoc(
25 | core_path = nlloc_core_path,
26 | agency="SeisMonitor",
27 | region = [-162, -150,50, 60,-2, 60],
28 | vel_model = vel_model,
29 | stations = stations,
30 | delta_in_km = 2,
31 | tmp_folder=nlloc_grid ### TAKE IN MIND THAT IN THIS FOLDER YOU WILL DOWNLOAD YOUR TTs, SO IT CONSUMES A LOT OF SPACE IN YOUR DISK
32 | )
33 |
34 | eqt_nlloc_catalog = nlloc.locate(catalog=gamma__catalog,
35 | nlloc_out_folder= out_dir,
36 | out_filename = "nlloc_loc.xml",
37 | out_format="SC3ML" )
38 | print(eqt_nlloc_catalog)
--------------------------------------------------------------------------------
/examples/XO_project/5.magnitude.py:
--------------------------------------------------------------------------------
1 | import os
2 | import math
3 | from obspy.clients.fdsn import Client as FDSNClient
4 | from obspy.core.utcdatetime import UTCDateTime
5 | from obspy.core.inventory.inventory import read_inventory
6 | from SeisMonitor.monitor.magnitude.mag import Magnitude,MwPhysicalMagParams, MwProcessingMagParams
7 | from SeisMonitor.core.objects import WaveformRestrictions,Provider
8 |
9 | monitor_path = "/home/emmanuel/XO_monitor_results"
10 |
11 |
12 | sgc_rest = WaveformRestrictions(network="XO",
13 | station="EP*",
14 | location="*",
15 | channel="*",
16 | starttime=UTCDateTime("2018-07-01T00:00:00.000000Z"),
17 | endtime=UTCDateTime("2018-07-01T04:00:00.000000Z"),
18 | location_preferences=["","00","20","10","40"],
19 | channel_preferences=["HH","BH","EH","HN","HL"],
20 | filter_networks=[],
21 | filter_stations=[],
22 | )
23 | ml_params = {"a":1.019,"b":0.0016,"r_ref":140} #YOU WILL NEED TO FIND THE VALUES ACCORDING TO THE PAPERS
24 | ### SEE HERE THE EQUATION ANT THE MEANNING OF THE VALUES
25 | #https://colab.research.google.com/github/ecastillot/SeisMonitor/blob/master/examples/5.magnitude.ipynb#scrollTo=4xsALpmpdmAk
26 |
27 | ####### NO MODIFY THE FOLLOWING
28 |
29 | sgc_client = FDSNClient('IRIS')
30 | sgc_provider = Provider(sgc_client,sgc_rest)
31 | nlloc_catalog_path = os.path.join(monitor_path,"loc","nlloc","nlloc_loc.xml")
32 | out_dir = os.path.join(monitor_path,"magnitude","nlloc","Ml")
33 | mag = Magnitude([sgc_provider],nlloc_catalog_path ,
34 | out_dir) #catalog,providers,out
35 |
36 |
37 | k = ml_params["a"]*math.log10(ml_params["r_ref"]/100) +\
38 | ml_params["b"]* (ml_params["r_ref"]-100) +3
39 |
40 | Ml = lambda ampl,epi_dist : math.log10(ampl * 1e3) + ml_params["a"] * math.log10(epi_dist/ml_params["r_ref"]) +\
41 | ml_params["b"] * (epi_dist-ml_params["r_ref"]) + k
42 |
43 | cat = mag.get_Ml(mag_type=Ml ,
44 | trimmedtime=5, #seconds after pick S to trim the signal
45 | out_format="SC3ML")
46 | print(cat)
--------------------------------------------------------------------------------
/examples/XO_project/6.plot.py:
--------------------------------------------------------------------------------
1 | from obspy import read_events
2 |
3 | catalog_path = "/home/emmanuel/XO_monitor_results/magnitude/nlloc/Ml/Ml_magnitude.xml"
4 | catalog = read_events(catalog_path)
5 | print(catalog)
6 |
7 |
8 | ### pip install Cartopy first
9 | catalog.plot()
10 | catalog.plot(projection="local")
11 |
12 |
--------------------------------------------------------------------------------
/examples/XO_project/vel_model.csv:
--------------------------------------------------------------------------------
1 | depth,vp,vs,disc,rho
2 | 0.0,5.9,0.0,,2.7
3 | 1,6.1,0.0,,2.7
4 | 14.0,6.3,0.0,,2.7
5 | 22.0,6.5,0.0,,2.7
6 | 35.0,6.9,0.0,,2.7
7 | 45.0,7.2,0.0,,2.7
8 | 100.0,7.2,0.0,,2.7
--------------------------------------------------------------------------------
/examples/eqt_test.py:
--------------------------------------------------------------------------------
1 | import os
2 | import zipfile
3 | from SeisMonitor.utils4examples import clone_seismonitor_data
4 | import os
5 | from SeisMonitor.monitor.picker.ai import PhaseNet,PhaseNetObj
6 | from SeisMonitor.monitor.picker import utils as piut
7 |
8 | import os
9 | from SeisMonitor.monitor.picker.ai import EQTransformer,EQTransformerObj
10 | from SeisMonitor.monitor.picker import utils as piut
11 |
12 | monitor_path = "/home/emmanuel/AIOBS/SeisMonitor-dataset/downloads"
13 |
14 | downloads = os.path.join(monitor_path ,"downloads")
15 | stations = os.path.join(monitor_path ,"stations")
16 |
17 | eqt_model = "/home/emmanuel/AIOBS/SeisMonitor-models/EQTransformer_models/EqT_model.h5"
18 |
19 | eqtobj = EQTransformerObj(model_path=eqt_model,
20 | n_processor = 6,
21 | overlap = 0.3,
22 | detection_threshold =0.1,
23 | P_threshold = 0.01,
24 | S_threshold = 0.01,
25 | batch_size = 20,
26 | number_of_plots = 0,
27 | plot_mode = 1 )
28 |
29 | out_dir = os.path.join(monitor_path ,"picks","eqt")
30 | result = os.path.join(monitor_path ,"picks","eqt","seismonitor_picks.csv")
31 |
32 | eqt = EQTransformer(eqtobj)
33 | eqt.pick(downloads,stations,out_dir)
34 | piut.eqt_picks_2_seismonitor_fmt(out_dir,downloads,result)
--------------------------------------------------------------------------------
/examples/pnet_test.py:
--------------------------------------------------------------------------------
1 | import os
2 | import zipfile
3 | from SeisMonitor.utils4examples import clone_seismonitor_data
4 | import os
5 | from SeisMonitor.monitor.picker.ai import PhaseNet,PhaseNetObj
6 | from SeisMonitor.monitor.picker import utils as piut
7 |
8 | monitor_path = "/home/emmanuel/AIOBS/SeisMonitor-dataset/downloads"
9 |
10 | downloads = os.path.join(monitor_path ,"downloads")
11 | stations = os.path.join(monitor_path ,"stations")
12 | models = "/home/emmanuel/AIOBS/SeisMonitor-models"
13 | pnet_model = os.path.join(models,"PhaseNet_models","190703-214543")
14 | pnet_path = os.path.join(monitor_path ,"PhaseNet")
15 |
16 |
17 | # piut.clone_aipicker("PhaseNet",pnet_path)
18 |
19 | pnetobj = PhaseNetObj(pnet_path=pnet_path,
20 | model_path=pnet_model,
21 | P_threshold=0.7, S_threshold=0.6,
22 | batch_size=100
23 | )
24 |
25 | out_dir = os.path.join(monitor_path,"picks","pnet")
26 | result = os.path.join(monitor_path,"picks","pnet","seismonitor_picks.csv")
27 |
28 | pnet = PhaseNet(pnetobj)
29 | pnet.pick(downloads,stations,out_dir)
--------------------------------------------------------------------------------
/requirements.txt:
--------------------------------------------------------------------------------
1 | obspy
2 | pytest
3 | pyproj
4 | GitPython
5 | matplotlib
6 | pandas
7 | tqdm
8 | scipy
9 | pexpect
10 | tensorflow==2.15
11 | keras==2.15
12 | numpy~=1.24
13 | keyring >=15.1
14 | pkginfo>=1.4.2
15 | h5py>=3.8
16 | # gmma
17 | # EQTransformer
18 |
19 |
20 | # keras == 2.3.1
21 | # EQTransformer==0.1.59
22 | #protobuf
23 | #gmma @ git+https://github.com/wayneweiqiang/GaMMA.git@1a5a5371c294727d2f814bcfd48f73bde94627b4
24 | #EQTransformer @ git+https://github.com/ecastillot/EQTransformer.git@master
25 |
26 |
--------------------------------------------------------------------------------
/setup.py:
--------------------------------------------------------------------------------
1 | from setuptools import setup, find_packages
2 | import pathlib
3 |
4 | import pkg_resources
5 | import setuptools
6 | import codecs
7 | import os
8 | import SeisMonitor
9 | # here = os.path.abspath(os.path.dirname(__file__))
10 |
11 | # with codecs.open(os.path.join(here, "README.md"), encoding="utf-8") as fh:
12 | # long_description = "\n" + fh.read()
13 |
14 | VERSION = SeisMonitor.__version__
15 | DESCRIPTION = 'To monitor seismic activity'
16 | LONG_DESCRIPTION = 'A package that allows to monitor the seismic activity through main steps in the monitoring workflow: earthquake detection and phase picking -> phase associator -> earthquake locator -> magnitude estimation.'
17 |
18 | req_path = os.path.join(os.path.dirname(__file__),"requirements.txt")
19 | with pathlib.Path('requirements.txt').open() as requirements_txt:
20 | install_requires = [
21 | str(requirement)
22 | for requirement
23 | in pkg_resources.parse_requirements(requirements_txt)
24 | ]
25 |
26 | # Setting up
27 | setup(
28 | name="seismonitor",
29 | version=VERSION,
30 | author="ecastillot (Emmanuel Castillo)",
31 | author_email="",
32 | url="https://github.com/ecastillot/SeisMonitor",
33 | description=DESCRIPTION,
34 | long_description_content_type="text/markdown",
35 | long_description=LONG_DESCRIPTION,
36 | packages=find_packages(),
37 | install_requires=install_requires,
38 | keywords=['python', "seismonitor","earthquakes","seismology"],
39 | classifiers=[
40 | "Development Status :: 1 - Planning",
41 | "Intended Audience :: Developers",
42 | "Programming Language :: Python :: 3",
43 | "Operating System :: Unix",
44 | ],
45 | python_requires='>=3.8'
46 | )
47 |
48 | # python setup.py sdist bdist_wheel
49 | # twine upload dist/*
50 | # python -m twine upload -u __token__ -p [unique_token] dist/*
51 |
52 | #pip install twine
53 | # pip install sphinx
54 | #pip install sphinx-rtd-theme
55 | # https://www.youtube.com/watch?v=BWIrhgCAae0&ab_channel=MariattaWijaya
--------------------------------------------------------------------------------
/test/clone.py:
--------------------------------------------------------------------------------
1 | import os
2 | from git import Repo
3 |
4 | def git_clone_aipicker(name,repo_dir):
5 | """
6 | Params:
7 | -------
8 | name: str
9 | EQTransformer or PhaseNet
10 | repo_dir: str
11 | Directory path to place the repository
12 | """
13 | if name == "PhaseNet":
14 | git_url = "https://github.com/ecastillot/PhaseNet.git"
15 | elif name == "EQTransformer":
16 | git_url = "https://github.com/ecastillot/EQTransformer.git"
17 | else:
18 | return False
19 |
20 | repo_dir = os.path.join(repo_dir,name)
21 | if os.path.isdir(repo_dir):
22 | print("There is alaready")
23 | return True
24 | else:
25 | Repo.clone_from(git_url, repo_dir)
26 | return True
27 |
28 | git_clone_aipicker(name="EQTransformer",repo_dir="/home/emmanuel")
--------------------------------------------------------------------------------
/test/step_by_step/1_download_with_archive.py:
--------------------------------------------------------------------------------
1 | # /**
2 | # * @author [Emmanuel Castillo]
3 | # * @email [ecastillot@unal.edu.co]
4 | # * @create date 2022-10-26 14:13:40
5 | # * @modify date 2022-10-26 14:13:40
6 | # * @desc [description]
7 | # */
8 |
9 | import os
10 | from obspy.core.utcdatetime import UTCDateTime
11 | from SeisMonitor.core.client import LocalClient
12 | from SeisMonitor.core.objects import WaveformRestrictions,Provider
13 | from SeisMonitor.monitor.downloader.seismonitor import MseedDownloader
14 |
15 | out_folder = "./out/download/local"
16 |
17 | carma_rest = WaveformRestrictions(network="YU",
18 | station="GJ*",
19 | location="*",
20 | channel="*",
21 | starttime=UTCDateTime("2017-12-24T00:00:00.000000Z"),
22 | endtime=UTCDateTime("2017-12-24T06:00:00.000000Z"),
23 | location_preferences=["","00","20","10","40"],
24 | channel_preferences=["HH","BH","EH","HN","HL"],
25 | filter_networks=[],
26 | filter_stations=[],
27 | filter_domain= [-83.101,-64.549,-2.229,14.945],
28 | )
29 |
30 | archive = "/home/emmanuel/Descargas/SeisMonitor_dataset/archive/mseed"
31 | my_local_fmt = os.path.join("{year}-{month:02d}",
32 | "{year}-{month:02d}-{day:02d}",
33 | "{network}.{station}.{location}.{channel}.{year}.{julday:03d}")
34 | carma_client = LocalClient(archive,my_local_fmt)
35 | # st = carma_client.get_waveforms(network="YU",
36 | # # station="GJ*,CS*",
37 | # station="GJ*",
38 | # location="*",
39 | # channel="*",
40 | # starttime=UTCDateTime("2017-12-24T00:00:00.000000Z"),
41 | # endtime=UTCDateTime("2017-12-24T00:10:00.000000Z"))
42 | # print(st)
43 |
44 | xml_path = "/home/emmanuel/Descargas/SeisMonitor_dataset/archive/dataless/YU.xml"
45 | carma_provider = Provider(carma_client,carma_rest,xml=xml_path)
46 |
47 | json_path = os.path.join(out_folder,"stations")
48 |
49 |
50 |
51 | dld_fmt = "downloads/{station}/{network}.{station}.{location}.{channel}__{starttime}__{endtime}.mseed"
52 | mseed_storage = os.path.join(out_folder,dld_fmt)
53 |
54 | md = MseedDownloader(providers=[carma_provider])
55 | md.make_inv_and_json(json_path)
56 | md.download(mseed_storage,
57 | chunklength_in_sec=3600,n_processor=16)
--------------------------------------------------------------------------------
/test/step_by_step/1_download_with_fdsn.py:
--------------------------------------------------------------------------------
1 | # /**
2 | # * @author [Emmanuel Castillo]
3 | # * @email [ecastillot@unal.edu.co]
4 | # * @create date 2022-10-26 14:13:40
5 | # * @modify date 2022-10-26 14:13:40
6 | # * @desc [description]
7 | # */
8 | import sys
9 | repository_path = r"/home/edc240000/SeisMonitor"
10 | sys.path.insert(0,repository_path)
11 |
12 | import os
13 | from obspy.core.utcdatetime import UTCDateTime
14 | from obspy.clients.fdsn import Client as FDSNClient
15 | from SeisMonitor.core.objects import WaveformRestrictions,Provider
16 | from SeisMonitor.monitor.downloader.seismonitor import MseedDownloader
17 |
18 | out_download_folder = "/home/edc240000/SeisMonitor/test/out/download/fdsn"
19 |
20 | sgc_rest = WaveformRestrictions(network="YU",
21 | station="CS*,FC*",
22 | location="*",
23 | channel="*",
24 | starttime=UTCDateTime("2017-01-02T19:00:00.000000Z"),
25 | endtime=UTCDateTime("2017-01-03T01:00:00.000000Z"),
26 | location_preferences=["","00","20","10","40"],
27 | channel_preferences=["HH","BH","EH","HN","HL"],
28 | filter_networks=[],
29 | filter_stations=[],
30 | #filter_domain= [-83.101,-64.549,-2.229,14.945],
31 | )
32 | sgc_client = FDSNClient('IRIS')
33 | sgc_provider = Provider(sgc_client,sgc_rest)
34 |
35 | json_path = os.path.join(out_download_folder,"stations")
36 |
37 |
38 | mseed_storage = os.path.join(out_download_folder,"downloads/{station}/{network}.{station}.{location}.{channel}__{starttime}__{endtime}.mseed")
39 |
40 | md = MseedDownloader(providers=[sgc_provider])
41 | md.make_inv_and_json(json_path)
42 | md.download(mseed_storage,picker_args={"batch_size":100,"overlap":0.3,"length":60},
43 | chunklength_in_sec=7200,n_processor=None)
--------------------------------------------------------------------------------
/test/step_by_step/2_pick_with_eqtransformer.py:
--------------------------------------------------------------------------------
1 | import sys
2 | repository_path = r"/home/edc240000/SeisMonitor"
3 | sys.path.insert(0,repository_path)
4 |
5 | import os
6 | os.environ['TF_CPP_MIN_LOG_LEVEL'] = '1'
7 | from SeisMonitor.monitor.picker.ai import EQTransformer,EQTransformerObj
8 | from SeisMonitor.monitor.picker import utils as piut
9 | from obspy.clients.fdsn import Client as FDSNClient
10 | from obspy.core.utcdatetime import UTCDateTime
11 | from obspy.core.utcdatetime import UTCDateTime
12 | from SeisMonitor.core.client import LocalClient
13 | from SeisMonitor.core.objects import WaveformRestrictions,Provider
14 | from SeisMonitor.monitor.downloader.seismonitor import MseedDownloader
15 |
16 | archive = "/home/edc240000/SeisMonitor/test/out/download/fdsn"
17 | json_path = os.path.join(archive,"json/stations.json")
18 | mseed_storage = os.path.join(archive,"downloads/{station}/{network}.{station}.{location}.{channel}__{starttime}__{endtime}.mseed")
19 |
20 | dataset = os.path.join(os.path.dirname(os.path.dirname(os.path.dirname(__file__))),"data")
21 | # eqt_model = os.path.join(dataset,"models",'EqT_model.h5')
22 | eqt_model_path = "/home/edc240000/EQTransformer/ModelsAndSampleData/EqT_model.h5"
23 | eqtobj = EQTransformerObj(eqt_model_path,
24 | n_processor = 6,
25 | overlap = 0.3,
26 | detection_threshold =0.1,
27 | P_threshold = 0.01,
28 | S_threshold = 0.01,
29 | batch_size = 20,
30 | number_of_plots = 0,
31 | plot_mode = 1 )
32 |
33 | mseed_storage = os.path.join(archive,"downloads")
34 | json_dir = os.path.join(archive,"stations")
35 | out_dir = os.path.join(archive,"picks","eqt")
36 | result = os.path.join(archive,"picks","seismonitor_picks.csv")
37 |
38 | # eqt = EQTransformer(mseed_storage,json_path,out_dir)
39 | eqt = EQTransformer(eqtobj)
40 | eqt.pick(mseed_storage,json_dir,out_dir)
41 | piut.eqt_picks_2_seismonitor_fmt(out_dir,mseed_storage,result)
--------------------------------------------------------------------------------
/test/step_by_step/2_pick_with_phasenet.py:
--------------------------------------------------------------------------------
1 | import sys
2 | repository_path = r"/home/edc240000/SeisMonitor"
3 | sys.path.insert(0,repository_path)
4 |
5 | import os
6 | from SeisMonitor.monitor.picker.ai import PhaseNet,PhaseNetObj
7 | from SeisMonitor.monitor.picker import utils as piut
8 | from obspy.clients.fdsn import Client as FDSNClient
9 | from obspy.core.utcdatetime import UTCDateTime
10 | from obspy.core.utcdatetime import UTCDateTime
11 | from SeisMonitor.core.client import LocalClient
12 | from SeisMonitor.core.objects import WaveformRestrictions,Provider
13 | from SeisMonitor.monitor.downloader.seismonitor import MseedDownloader
14 |
15 | archive = "/home/edc240000/SeisMonitor/test/out/download/fdsn"
16 | mseed_storage = os.path.join(archive,"downloads","{station}/{network}.{station}.{location}.{channel}__{starttime}__{endtime}.mseed")
17 |
18 | dataset = os.path.join(os.path.dirname(os.path.dirname(os.path.dirname(__file__))),"data")
19 | pnet_path = "/home/edc240000/PhaseNet"
20 | pnet_model_path = "/home/edc240000/PhaseNet/model/190703-214543"
21 | pnetobj = PhaseNetObj(
22 | pnet_path=pnet_path,
23 | model_path=pnet_model_path,
24 | P_threshold=0.7, S_threshold=0.6,
25 | batch_size=100
26 | )
27 |
28 | mseed_storage = os.path.join(archive,"downloads")
29 | json_dir = os.path.join(archive,"stations")
30 | out_dir = os.path.join(archive,"picks","pnet")
31 | result = os.path.join(archive,"picks","seismonitor_picks.csv")
32 |
33 | pnet = PhaseNet(pnetobj)
34 | pnet.pick(mseed_storage,json_dir,out_dir)
--------------------------------------------------------------------------------
/test/step_by_step/3_asso_with_gamma.py:
--------------------------------------------------------------------------------
1 | import sys
2 | repository_path = r"/home/edc240000/SeisMonitor"
3 | sys.path.insert(0,repository_path)
4 |
5 | import os
6 | from SeisMonitor.monitor.associator import utils as ut
7 | from obspy.core.utcdatetime import UTCDateTime
8 | from obspy.core.inventory.inventory import read_inventory
9 | from SeisMonitor.monitor.associator.ai import GaMMA,GaMMAObj
10 |
11 | # archive = "./out/download/fdsn"
12 | archive = "/home/edc240000/SeisMonitor/test/others"
13 |
14 | resp = os.path.join(archive,"stations","inv.xml")
15 | picks = os.path.join(archive,"picks","eqt_seismonitor_picks.csv")
16 | out_dir = os.path.join(archive,"asso","gamma")
17 |
18 | # region = [-84.798, -66.546,-1.628, 15.445,0, 150]
19 | region = [-76.729, -72.315,1.55, 5.314,0, 150]
20 |
21 | gc = GaMMAObj(region,"EPSG:3116",
22 | use_amplitude = False,
23 | use_dbscan=False,
24 | calculate_amp=False)
25 | g = GaMMA(gc)
26 | obspy_catalog, df_catalog,df_picks = g.associate(picks,resp,out_dir)
27 | print(obspy_catalog)
--------------------------------------------------------------------------------
/test/step_by_step/4_loc_with_nlloc.py:
--------------------------------------------------------------------------------
1 | import os
2 | from SeisMonitor.monitor.locator.nlloc.nlloc import NLLoc
3 | from SeisMonitor.monitor.locator import utils as lut
4 | from SeisMonitor.monitor.locator.nlloc import utils as nlloc_utils
5 | from obspy import read_events
6 | from obspy.core.event.catalog import Catalog
7 |
8 | dataset = os.path.join("/home/emmanuel/SeisMonitor","data")
9 |
10 | archive = "/home/emmanuel/SeisMonitor/out"
11 | out_dir = os.path.join(archive,"loc","nlloc")
12 | asso_dir = os.path.join(archive,"asso","gamma")
13 | vel_path = os.path.join(dataset,"velmodel","vel1d_col.csv")
14 | inv = os.path.join(dataset,"stations","inv.xml")
15 |
16 | vel_model = lut.VelModel(vel_path,model_name="Ojeda&Havskov(2004)")
17 | stations = lut.Stations(inv)
18 |
19 | nlloc = NLLoc(
20 | agency="SeisMonitor",
21 | region = [-85, -68,0, 15,-5, 205],
22 | vel_model = vel_model,
23 | stations = stations,
24 | delta_in_km = 2.5,
25 | tmp_folder="/home/emmanuel/NLLoc_grid/NLLoc_grid" ### CHANGE PATH TO YOUR OWN PATH AND ALSO TAKE IN MIND THAT CONSUME DISK
26 | )
27 | nlloc.download()
28 | # nlloc.compute_travel_times()
29 | # nlloc.locate(catalog=os.path.join(asso_dir,"associations.xml"),
30 | # nlloc_out_folder= out_dir,
31 | # out_filename = "LOC.xml",
32 | # out_format="SC3ML" )
--------------------------------------------------------------------------------
/test/step_by_step/5_mag_with_ml.py:
--------------------------------------------------------------------------------
1 | import os
2 | import math
3 | from obspy.clients.fdsn import Client as FDSNClient
4 | from obspy.core.utcdatetime import UTCDateTime
5 | from obspy.core.inventory.inventory import read_inventory
6 | from SeisMonitor.monitor.magnitude.mag import Magnitude,MwPhysicalMagParams, MwProcessingMagParams
7 | from SeisMonitor.core.objects import WaveformRestrictions,Provider
8 |
9 | archive = "./out/download/fdsn"
10 |
11 | sgc_client = FDSNClient('http://sismo.sgc.gov.co:8080')
12 | sgc_rest = WaveformRestrictions(network="CM",
13 | station="*",
14 | location="*",
15 | channel="*",
16 | starttime=UTCDateTime("2019-12-24T19:00:00.000000Z"),
17 | endtime=UTCDateTime("2019-12-25T01:00:00.000000Z"),
18 | location_preferences=["","00","20","10","40"],
19 | channel_preferences=["HH","BH","EH","HN","HL"],
20 | filter_networks=[],
21 | filter_stations=[],
22 | filter_domain= [-83.101,-64.549,-2.229,14.945],
23 | )
24 | sgc_client = FDSNClient('http://sismo.sgc.gov.co:8080')
25 | sgc_provider = Provider(sgc_client,sgc_rest)
26 |
27 | catalog = os.path.join(archive,"loc","nlloc","LOC.xml")
28 | out_dir = os.path.join(archive,"mag","Ml")
29 |
30 | mag = Magnitude([sgc_provider],catalog,out_dir) #catalog,providers,out
31 |
32 |
33 | ml_params = {"a":1.019,"b":0.0016,"r_ref":140} #ojeda
34 | k = ml_params["a"]*math.log10(ml_params["r_ref"]/100) +\
35 | ml_params["b"]* (ml_params["r_ref"]-100) +3
36 | Ml = lambda ampl,epi_dist : math.log10(ampl * 1e3) + ml_params["a"] * math.log10(epi_dist/ml_params["r_ref"]) +\
37 | ml_params["b"] * (epi_dist-ml_params["r_ref"]) + k
38 |
39 | cat = mag.get_Ml(mag_type=Ml ,
40 | trimmedtime=5,
41 | out_format="SC3ML")
--------------------------------------------------------------------------------
/test/test_seismonitor.py:
--------------------------------------------------------------------------------
1 | import os
2 | import math
3 | from obspy import read_events
4 | from obspy.clients.fdsn import Client as FDSNClient
5 | from obspy.core.utcdatetime import UTCDateTime
6 | from obspy.core.event.origin import OriginUncertainty
7 | from obspy.core.event.event import Event
8 | from SeisMonitor.monitor.seismonitor import SeisMonitor
9 | from SeisMonitor.monitor.picker import ai as ai_picker
10 | from SeisMonitor.monitor.downloader import utils as dut
11 | from SeisMonitor.monitor.associator import ai as ai_asso
12 | from SeisMonitor.monitor.locator.nlloc.nlloc import NLLoc
13 | from SeisMonitor.monitor.locator import utils as lut
14 | from SeisMonitor.core.objects import WaveformRestrictions,Provider
15 | from SeisMonitor.monitor.downloader.utils import get_merged_inv_and_json
16 |
17 | out = "/home/emmanuel/E_ColSeismicity/ColSeismicity/test"
18 |
19 | sgc_client = FDSNClient('http://sismo.sgc.gov.co:8080')
20 | sgc_rest = WaveformRestrictions(network="CM",
21 | station="URMC,VILL,PRA,CLEJA",
22 | location="*",
23 | channel="*",
24 | starttime=UTCDateTime("2019-12-24T19:00:00.000000Z"),
25 | endtime=UTCDateTime("2019-12-25T01:00:00.000000Z"),
26 | location_preferences=["","00","20","10","40"],
27 | channel_preferences=["HH","BH","EH","HN","HL"],
28 | filter_networks=[],
29 | filter_stations=[],
30 | filter_domain= [-83.101,-64.549,-2.229,14.945],
31 | )
32 | sgc_client = FDSNClient('http://sismo.sgc.gov.co:8080')
33 | sgc_provider = Provider(sgc_client,sgc_rest)
34 |
35 | seismo = SeisMonitor(providers = [sgc_provider],
36 | chunklength_in_sec=7200,
37 | out_folder = out)
38 |
39 | seismo.add_downloader(picker_args= {"batch_size":100,"overlap":0.3,"length":60})
40 |
41 | dataset = os.path.join(os.path.dirname(os.path.dirname(__file__)),"data")
42 | eqt_model = os.path.join(dataset,"models",'EqT_model.h5')
43 | eqt_path = "/home/emmanuel/EDCT/EQTransformer"
44 | seismo.add_picker(
45 | pickers={
46 | "EQTransformer":ai_picker.EQTransformerObj(
47 | eqt_path = eqt_model,
48 | n_processor = 32,
49 | overlap = 0.3,
50 | detection_threshold =0.1,
51 | P_threshold = 0.01,
52 | S_threshold = 0.01,
53 | batch_size = 100,
54 | number_of_plots = 0,
55 | plot_mode = 1,
56 | rm_downloads=True )
57 | }
58 | )
59 | # seismo.add_associator(input=["EQTransformer"],
60 | # associators={
61 | # "GaMMA":ai_asso.GaMMAObj(
62 | # [-85, -68,-2, 15,0, 180],
63 | # "EPSG:3116",
64 | # use_amplitude = False,
65 | # use_dbscan=False,
66 | # max_sigma11=5.0,
67 | # calculate_amp=False)
68 | # }
69 | # )
70 |
71 | # dataset = os.path.join(os.path.dirname(os.path.dirname(__file__)),"data")
72 | # vel_path = os.path.join(dataset,"metadata","vel1d_col.csv")
73 | # vel_model = lut.VelModel(vel_path)
74 | # inv,_,_,_ = dut.get_merged_inv_and_json(seismo.providers)
75 | # stations = lut.Stations(inv)
76 |
77 | # nlloc = NLLoc(
78 | # agency="SeisMonitor",
79 | # region = [-85, -68,0, 15,-5, 205],
80 | # vel_model = vel_model,
81 | # stations = stations,
82 | # delta_in_km = 2.5,
83 | # tmp_folder="/home/emmanuel/NLLoc_grid/NLLoc_grid" ### CHANGE PATH TO YOUR OWN PATH AND ALSO TAKE IN MIND THAT CONSUME DISK
84 | # )
85 |
86 | # seismo.add_locator(input={"associations":("GaMMA","EQTransformer")},
87 | # locators={
88 | # "NLLOC":nlloc}
89 | # )
90 |
91 |
92 | # ml_params = {"a":1.019,"b":0.0016,"r_ref":140} #ojeda
93 | # k = ml_params["a"]*math.log10(ml_params["r_ref"]/100) +\
94 | # ml_params["b"]* (ml_params["r_ref"]-100) +3
95 | # Ml = lambda ampl,epi_dist : math.log10(ampl * 1e3) + ml_params["a"] * math.log10(epi_dist/ml_params["r_ref"]) +\
96 | # ml_params["b"] * (epi_dist-ml_params["r_ref"]) + k
97 |
98 | # seismo.add_magnitude(input={"locations":("NLLOC","GaMMA/EQTransformer")},
99 | # magnitudes={
100 | # "Ml":{"mag_type":Ml,
101 | # "trimmedtime":5,
102 | # "out_format":"SC3ML"}}
103 | # )
104 | seismo.run()
--------------------------------------------------------------------------------