Skip to content

Commit

Permalink
MCMTpy first add 2021.10.12
Browse files Browse the repository at this point in the history
  • Loading branch information
OUCyf committed Oct 12, 2021
0 parents commit eac1c53
Show file tree
Hide file tree
Showing 632 changed files with 90,834 additions and 0 deletions.
Binary file added .DS_Store
Binary file not shown.
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2021 Fu Yin

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
1 change: 1 addition & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
global-include *.py
150 changes: 150 additions & 0 deletions MCMTpy.egg-info/PKG-INFO
Original file line number Diff line number Diff line change
@@ -0,0 +1,150 @@
Metadata-Version: 1.1
Name: MCMTpy
Version: 0.1.0a1
Summary: MCMTpy is Created on Sun Apr 18 17:24:43 2021
Home-page: https://www.google.com.hk/
Author: Fu Yin
Author-email: [email protected]
License: MIT
Description: MCMTpy
======



About
-------------
🚨 **The package is still undergoing development.** 🚨

MCMTpy is a Python package designed for seismic source study. It provides functionality for focal mechanism
inversion and source parameters analysis.

MCMTpy has mainly provided functions as:

* Focal mechanism inversion of the double couple source and moment tensor using improved **Markov chain Monte Carlo** method.
* A series of scripts is provided for source parameter calculation and conversion.
* Moment tensor decompose, Huston plot and Beachball with station projected.
* A new framework for source inversion based on a python's workflow.

and it has the features as:

* The package MCMTpy runs on Unix-like systems including Mac and Linux.
* It has a close integration with Obspy, pyfk and pyasdf.
* It can be done in parallel based on mpi4py.
* It's is efficient to do the seismological research based on python.

.. image:: ./docs/figures/logo/logo-small-cut.png
:width: 80%
:align: center




Documentation
-------------
Detailed `documentation <https://github.com/OUCyf/>`_ can be found here.



Citation
-------------
If you use **MCMTpy** for your research and prepare publications, please citing **MCMTpy**:

* MCMTpy: A Python Package for Simultaneous Inversion of Source Location, Focal Mechanism, and Rupture Directivity.
In prep for Seismological Research Letter.





Quick Installation
---------------------
Firstly, make sure **Anaconda** has been installed, then::

$ conda create -n MCMTpy python=3.8 numpy=1.16 matplotlib=3.1.1 mpi4py obspy pyasdf json5 tqdm
$ conda activate MCMTpy
$ pip install pyfk
$ pip install MCMTpy

Some errors may occurred of that pyfk not support the new version of ``cysignals``, please::

$ conda uninstall cysignals
$ pip install cysignals==1.10.2
$ pip install pyfk


Successful installation will generate an executable program ``MCMTpy`` under the anaconda environment path:
*/Users/user/opt/anaconda3/bin*. And run following code to check the installation::

$ MCMTpy --help







Short Tutorial
-----------------
MCMTpy stores all the parameter information in four JSON files: **build_GFs.json**, **syn.json**,
**sample.json** and **plot.json**, and you can find those json-files in path *./MCMTpy-master/jsons/*.
For parameters choosing, please refer to **Detailed tutorial**. The steps to do inversion process are:

**1. Calculate green function database**::

$ MCMTpy build_GFs pyfk -c ./build_GFs.json
$ mpirun -n 4 MCMTpy build_GFs pyfk -c ./build_GFs.json # parallel

**2. Synthesize the test data**::

$ MCMTpy syn pyfk -c ./syn.json

**3. Inversion of focal mechanism**::

$ MCMTpy sample MH -c ./sample.json
$ mpirun -n 4 MCMTpy sample MH -c ./sample.json # parallel

**4. Result visualization**::

$ MCMTpy plot pyfk -c plot.json


.. image:: ./docs/figures/station_location.png
:width: 100%
:align: center
.. image:: ./docs/figures/hist.png
:width: 100%
:align: center
.. image:: ./docs/figures/misfit.png
:width: 100%
:align: center
.. image:: ./docs/figures/alpha.png
:width: 100%
:align: center
.. image:: ./docs/figures/waveform.png
:width: 100%
:align: center
.. image:: ./docs/figures/beachball.png
:width: 100%
:align: center
.. image:: ./docs/figures/Decompose.png
:width: 100%
:align: center



License
-------
MCMTpy is a free software: you can redistribute it and/or modify it under the terms of
the **MIT License**. A copy of this license is provided in
`LICENSE <https://github.com/OUCyf>`__.

Platform: UNKNOWN
Classifier: Development Status :: 3 - Alpha
Classifier: Environment :: Console
Classifier: Intended Audience :: Science/Research
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: MacOS
Classifier: Programming Language :: Python :: 3.8
Classifier: Topic :: Scientific/Engineering
Classifier: Topic :: Scientific/Engineering :: Physics
61 changes: 61 additions & 0 deletions MCMTpy.egg-info/SOURCES.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
MANIFEST.in
README.rst
setup.py
MCMTpy/__init__.py
MCMTpy/__version__.py
MCMTpy/info.py
MCMTpy.egg-info/PKG-INFO
MCMTpy.egg-info/SOURCES.txt
MCMTpy.egg-info/dependency_links.txt
MCMTpy.egg-info/entry_points.txt
MCMTpy.egg-info/requires.txt
MCMTpy.egg-info/top_level.txt
MCMTpy/apps/MCMTpy.py
MCMTpy/apps/__init__.py
MCMTpy/gfs/__init__.py
MCMTpy/gfs/build_GFs.py
MCMTpy/gfs/pyfk_GFs/__init__.py
MCMTpy/gfs/pyfk_GFs/build_GFs_pyfk.py
MCMTpy/gfs/pyfk_GFs/cal_gfs.py
MCMTpy/gfs/pyfk_GFs/read_json.py
MCMTpy/gfs/sem_GFs/__init__.py
MCMTpy/gfs/sem_GFs/build_GFs_sem.py
MCMTpy/plotting/__init__.py
MCMTpy/plotting/plot.py
MCMTpy/plotting/pyfk_plot/__init__.py
MCMTpy/plotting/pyfk_plot/plot_accept_ratio.py
MCMTpy/plotting/pyfk_plot/plot_hist.py
MCMTpy/plotting/pyfk_plot/plot_misfit.py
MCMTpy/plotting/pyfk_plot/plot_waveform.py
MCMTpy/sampler/__init__.py
MCMTpy/sampler/sample.py
MCMTpy/sampler/grid/__init__.py
MCMTpy/sampler/grid/read_grid_json.py
MCMTpy/sampler/grid/sample_grid.py
MCMTpy/sampler/grid/sampler_module.py
MCMTpy/sampler/pyfk_MH/__init__.py
MCMTpy/sampler/pyfk_MH/read_sampler_json.py
MCMTpy/sampler/pyfk_MH/sample_MH.py
MCMTpy/sampler/pyfk_MH/sampler_module.py
MCMTpy/syn/__init__.py
MCMTpy/syn/syn.py
MCMTpy/syn/pyfk_syn/__init__.py
MCMTpy/syn/pyfk_syn/syn_pyfk.py
MCMTpy/syn/sem_syn/__init__.py
MCMTpy/utils/MomentTensor.py
MCMTpy/utils/__init__.py
MCMTpy/utils/asdf_function.py
MCMTpy/utils/distaz.py
MCMTpy/utils/rotate.py
docs/source/conf.py
docs/source/tutorials/S1_setup_gfs.py
docs/source/tutorials/S2_plot_syn.py
docs/source/tutorials/S2_syn_waveform.py
docs/source/tutorials/S3_processing_data.py
docs/source/tutorials/S4_alpha.py
docs/source/tutorials/S4_inv.py
docs/source/tutorials/S5_plot.py
docs/source/tutorials/S7_plot_beachball.py
docs/source/tutorials/S8_plot_decompose.py
docs/source/tutorials/S9_plot_hudson.py
test/__init__.py
1 change: 1 addition & 0 deletions MCMTpy.egg-info/dependency_links.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

3 changes: 3 additions & 0 deletions MCMTpy.egg-info/entry_points.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[console_scripts]
MCMTpy = MCMTpy.apps.MCMTpy:main

8 changes: 8 additions & 0 deletions MCMTpy.egg-info/requires.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
numpy>=1.14
tqdm>=4.19.4
matplotlib<=3.1.1
mpi4py
obspy
pyfk
pyasdf
json5
2 changes: 2 additions & 0 deletions MCMTpy.egg-info/top_level.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
MCMTpy
test
Binary file added MCMTpy/.DS_Store
Binary file not shown.
13 changes: 13 additions & 0 deletions MCMTpy/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
from MCMTpy.gfs.build_GFs import build_GFs
from MCMTpy.sampler.sample import sample
from MCMTpy.syn.syn import syn
from MCMTpy.plotting.plot import plot
from MCMTpy.utils import MomentTensor

__all__ = [
"build_GFs",
"sample",
"syn",
"plot",
"MomentTensor",
]
Binary file added MCMTpy/__pycache__/__init__.cpython-38.pyc
Binary file not shown.
Binary file added MCMTpy/__pycache__/info.cpython-38.pyc
Binary file not shown.
13 changes: 13 additions & 0 deletions MCMTpy/__version__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# __major_version__ = 0
# __minor_version__ = 1
# __patch__ = 0
# __release__ = "a1"
# __version_number__ = ".".join(
# (
# str(__major_version__),
# str(__minor_version__),
# str(__patch__)
# )
# )
# f"{__version_number__}{__release__}"
__version__ ='0.1.0a1'
Binary file added MCMTpy/apps/.DS_Store
Binary file not shown.
Loading

0 comments on commit eac1c53

Please sign in to comment.