44 changed files with 8265 additions and 134 deletions
@ -1,131 +1,15 @@
|
||||
# ---> Python |
||||
# Byte-compiled / optimized / DLL files |
||||
__pycache__/ |
||||
*.py[cod] |
||||
*$py.class |
||||
|
||||
# C extensions |
||||
*.so |
||||
|
||||
# Distribution / packaging |
||||
.Python |
||||
build/ |
||||
develop-eggs/ |
||||
dist/ |
||||
downloads/ |
||||
eggs/ |
||||
.eggs/ |
||||
lib/ |
||||
lib64/ |
||||
parts/ |
||||
sdist/ |
||||
var/ |
||||
wheels/ |
||||
pip-wheel-metadata/ |
||||
share/python-wheels/ |
||||
*.egg-info/ |
||||
.installed.cfg |
||||
*.egg |
||||
MANIFEST |
||||
|
||||
# PyInstaller |
||||
# Usually these files are written by a python script from a template |
||||
# before PyInstaller builds the exe, so as to inject date/other infos into it. |
||||
*.manifest |
||||
*.spec |
||||
|
||||
# Installer logs |
||||
pip-log.txt |
||||
pip-delete-this-directory.txt |
||||
|
||||
# Unit test / coverage reports |
||||
htmlcov/ |
||||
.tox/ |
||||
.nox/ |
||||
.coverage |
||||
.coverage.* |
||||
.cache |
||||
nosetests.xml |
||||
coverage.xml |
||||
*.cover |
||||
*.py,cover |
||||
.hypothesis/ |
||||
.pytest_cache/ |
||||
|
||||
# Translations |
||||
*.mo |
||||
*.pot |
||||
|
||||
# Django stuff: |
||||
*.log |
||||
local_settings.py |
||||
db.sqlite3 |
||||
db.sqlite3-journal |
||||
|
||||
# Flask stuff: |
||||
instance/ |
||||
.webassets-cache |
||||
|
||||
# Scrapy stuff: |
||||
.scrapy |
||||
|
||||
# Sphinx documentation |
||||
docs/_build/ |
||||
|
||||
# PyBuilder |
||||
target/ |
||||
|
||||
# Jupyter Notebook |
||||
.ipynb_checkpoints |
||||
|
||||
# IPython |
||||
profile_default/ |
||||
ipython_config.py |
||||
|
||||
# pyenv |
||||
.python-version |
||||
|
||||
# pipenv |
||||
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. |
||||
# However, in case of collaboration, if having platform-specific dependencies or dependencies |
||||
# having no cross-platform support, pipenv may install dependencies that don't work, or not |
||||
# install all needed dependencies. |
||||
#Pipfile.lock |
||||
|
||||
# PEP 582; used by e.g. github.com/David-OConnor/pyflow |
||||
__pypackages__/ |
||||
|
||||
# Celery stuff |
||||
celerybeat-schedule |
||||
celerybeat.pid |
||||
|
||||
# SageMath parsed files |
||||
*.sage.py |
||||
|
||||
# Environments |
||||
.env |
||||
.venv |
||||
env/ |
||||
venv/ |
||||
ENV/ |
||||
env.bak/ |
||||
venv.bak/ |
||||
|
||||
# Spyder project settings |
||||
.spyderproject |
||||
.spyproject |
||||
|
||||
# Rope project settings |
||||
.ropeproject |
||||
|
||||
# mkdocs documentation |
||||
/site |
||||
|
||||
# mypy |
||||
.mypy_cache/ |
||||
.dmypy.json |
||||
dmypy.json |
||||
|
||||
# Pyre type checker |
||||
.pyre/ |
||||
|
||||
/aclocal.m4 |
||||
/autom4te.cache |
||||
/configure |
||||
/install-sh |
||||
/missing |
||||
/py-compile |
||||
/Makefile.in |
||||
/src/Makefile.in |
||||
/Makefile |
||||
/src/Makefile |
||||
/config.log |
||||
/config.status |
||||
*.o |
||||
*.mod |
||||
/src/ids2020 |
@ -1,7 +1,33 @@
|
||||
# ids |
||||
|
||||
# IDS2020 (packaged as pyrocko backend) |
||||
|
||||
Code to do kinematic earthquake source imaging based on the Iterative Deconvolution and Stacking (IDS) method using seismic waveform and static displacement jointly. |
||||
|
||||
IDS has been written by Rongjiang Wang. |
||||
|
||||
Packaging has been done by Malte Metz. |
||||
Packaging has been done by Malte Metz. |
||||
|
||||
|
||||
## References |
||||
|
||||
- Zhang, Y., Wang, R., Chen, Y., Xu, L., Du, F., Jin, M., Tu, H. and Dahm, T. (2014), Kinematic |
||||
Rupture Model and Hypocenter Relocation of the 2013 Mw 6.6 Lushan Earthquake Constrained by |
||||
StrongโMotion and Teleseismic Data, Seismological Research Letters, 85 (1), 15โ22, |
||||
doi: https://doi.org/10.1785/0220130126. |
||||
|
||||
- Zhang, Y., Wang, R., and Chen, Y.โT. (2015), Stability of rapid finiteโfault inversion for the |
||||
2014 Mw6.1 South Napa earthquake, Geophys. Res. Lett., 42, 10, 263โ10, 272, |
||||
doi: https://doi.org/10.1002/2015GL066244. |
||||
|
||||
- Diao, F. , Wang, R. , Aochi, H. , Walter, T.R., Zhang, Y. , Zheng, Y. and Xiong, X. (2016), |
||||
Rapid kinematic finite-fault inversion for an Mw 7+ scenario earthquake in the Marmara Sea: an |
||||
uncertainty study, Geophysical Journal International, 204, 2, 813โ824, |
||||
https://doi.org/10.1093/gji/ggv459 |
||||
|
||||
## Compile and install |
||||
|
||||
``` |
||||
autoreconf -i # only if 'configure' script is missing |
||||
./configure |
||||
make |
||||
sudo make install |
||||
``` |
||||
|
@ -0,0 +1,8 @@
|
||||
AC_INIT([ids], [2020]) |
||||
AM_INIT_AUTOMAKE([-Wall -Werror foreign]) |
||||
AC_PROG_F77 |
||||
AC_CONFIG_FILES([ |
||||
Makefile |
||||
src/Makefile |
||||
]) |
||||
AC_OUTPUT |
@ -0,0 +1,235 @@
|
||||
# Example for the input file of FORTRAN77 program "ids2020" for kinematic earthquake |
||||
# source imaging based on the Iterative Deconvolution and Stacking (IDS) Method using |
||||
# seismic waveform and static displacement data jointly. |
||||
# |
||||
# written by Rongjiang Wang |
||||
# Helmholtz Centre Potsdam |
||||
# GFZ German Research Centre for Geosciences |
||||
# e-mail: wang@gfz-potsdam.de |
||||
# Phone +49 331 2881209 |
||||
# Fax +49 331 2881204 |
||||
# |
||||
# Last modified: Potsdam, April, 2020 |
||||
# |
||||
# Reference: |
||||
# Zhang and Wang et al. (2014). Automatic imaging of earthquake rupture processes |
||||
# by iterative deconvolution and stacking of high-rate GNSS and strong motion |
||||
# seismograms, JGR Solid Earth, 199(7), 5633-5650. |
||||
# |
||||
################################################################# |
||||
## ## |
||||
## If not specified otherwise, SI Unit System is used overall! ## |
||||
## ## |
||||
## ## |
||||
## Each comment line should start with "#" ## |
||||
## and no blank line is allowed! ## |
||||
## ## |
||||
################################################################# |
||||
# |
||||
#================================================================================ |
||||
# EARTHQUAKE LOCATION PARAMETERS |
||||
# ------------------------------ |
||||
# 1. origin time [s] (year, month, day, hour, minute [positive integer number] |
||||
# and second [positive or negative real number]), which will be also used as |
||||
# the reference time of the output data |
||||
# 2. hypocentre (lat[deg], lon[deg], depth[km]) |
||||
# 3. preliminary estimate of moment magnitude |
||||
# Note: the hypocentre location and origin time (at least to minute) should be |
||||
# consistent with those given in the "StationInfo.dat" file of the |
||||
# waveform data (s. below) |
||||
#-------------------------------------------------------------------------------- |
||||
2015 9 16 22 54 32.0 |
||||
-31.573 -72.674 22.40 |
||||
8.3 |
||||
#================================================================================ |
||||
# WAVEFORM DATA (HIGH-RATE-GNSS/STRONG-MOTION SEISMOGRAMS) |
||||
# -------------------------------------------------------------------- |
||||
# 1. folder name of the data |
||||
# Note: this folder should include a file 'StationInfo.dat' giving all |
||||
# necessary information about the local monitoring network. |
||||
# 2. lower and upper thresholds of the epicentral distances [km] (stations |
||||
# outside the threshold distances will not be used) |
||||
# 3. weight of the static offset data (obtained automatically from the velocity |
||||
# waveforms after an empirical baseline correction) relative to the waveform |
||||
# data (suggested value 0.0-1.0) |
||||
#-------------------------------------------------------------------------------- |
||||
'./WaveformData/' |
||||
0.0 8000.0 |
||||
0.0 |
||||
#================================================================================ |
||||
# GREEN'S FUNCTION DATABASE |
||||
# ------------------------- |
||||
# 1. Green's function database (folder name) |
||||
# 2. Parameters of Butterworth bandpass filter applied to the synthetics: |
||||
# order, lower and upper cutoff frequencies [Hz] |
||||
# computation [Hz] |
||||
#-------------------------------------------------------------------------------- |
||||
'../GreenChileSM/GreenFunctions/' |
||||
3 0.000 0.50 |
||||
#================================================================================ |
||||
# GNSS STATIC OFFSETS |
||||
# ------------------- |
||||
# 1. number of GNSS sites, file name of the data |
||||
# Note: if the number of GNSS sites <= 0, then no GNSS data are available. |
||||
# the GNSS data file includes one header line and 8 culomns, |
||||
# Lat(deg) Lon(deg) East(m) North(m) Up(m) wf_E wf_N wf_Z |
||||
# where wf_E/N/Z are within-dataset relative weighting factor proportional to |
||||
# inverse error variance |
||||
# 2. weight of the whole GNSS dataset relative to the waveform dataset (suggested |
||||
# value 0.0-1.0) |
||||
#-------------------------------------------------------------------------------- |
||||
0 './GPSData/GPS_Pisagua.dat' |
||||
0.0 |
||||
#================================================================================ |
||||
# InSAR LOS DISPLACEMENTS |
||||
# ----------------------- |
||||
# 1. number of InSAR grids, file name of the data |
||||
# Note: if the number of InSAR grids <= 0, then no InSAR data are used. |
||||
# the InSAR data file includes one header line and 8 culomns, |
||||
# Lat(deg) Lon(deg) LOS(m) wf_los incidence(deg) azimuth(deg) |
||||
# where wf_los is the within-dataset relative weighting factor |
||||
# proportional to inverse error variance |
||||
# 2. weight of the whole InSAR dataset in the misfit variance relative to the |
||||
# waveform dataset (suggested value 0.0-1.0) |
||||
#-------------------------------------------------------------------------------- |
||||
0 './InSAR/NoInSAR.dat' |
||||
0.00 |
||||
#================================================================================ |
||||
# Geodetic GREEN'S FUNCTION DATABASE |
||||
# ---------------------------------- |
||||
# 1. geodetic Green's function database (folder name) |
||||
# 2. 3 file names of the geodetic Green's functions |
||||
#-------------------------------------------------------------------------------- |
||||
'../GreenChileGD/DGreen/' |
||||
'uz' 'ur' 'ut' |
||||
#================================================================================ |
||||
# FAULT PARAMETERS |
||||
# ---------------- |
||||
# 1. ipatch: switch (0/1) for subfaults input form, |
||||
# 0 = read discrete patches from files, |
||||
# 1 = automatic discretization of a single rectangular fault |
||||
#-------------------------------------------------------------------------------- |
||||
# idisc |
||||
#-------------------------------------------------------------------------------- |
||||
1 |
||||
#-------------------------------------------------------------------------------- |
||||
# IF(idisc = 0)THEN |
||||
# |
||||
# subfault paramters |
||||
# ================== |
||||
# file_name: data file for discrete patches |
||||
# number of sub-faults |
||||
# iref selection of the patch reference location |
||||
# |
||||
# Note: the file includes one header line followed by 8 columns of data: |
||||
# |
||||
# latitude[deg], longitude[deg], depth[km], length[km], width[km], |
||||
# strike[deg], dip[deg], rake[deg] |
||||
# |
||||
# where (lat, lon, dep) is the reference location of the patch depending |
||||
# on iref: 1 = upper-left corner, 2 = upper-right corner, |
||||
# 3 = lower-left corner, 4 = lower-right corner, |
||||
# 5 = central point (s. Fig.) |
||||
# |
||||
# definitions for a rectangular fault patch |
||||
# ========================================= |
||||
# |
||||
# north(x) |
||||
# / |
||||
# / | strike |
||||
# 1-----------------------2 |
||||
# |\ p . \ W |
||||
# :-\ i . \ i |
||||
# | \ l . 5 \ d |
||||
# :90 \ S . \ t |
||||
# |-dip\ . \ h |
||||
# : \. ) rake \ |
||||
# downward(z) 3-----------------------4 |
||||
# L e n g t h |
||||
#-------------------------------------------------------------------------------- |
||||
# file_name nsf iref |
||||
#-------------------------------------------------------------------------------- |
||||
# './fault_patches.dat' 288 5 |
||||
#-------------------------------------------------------------------------------- |
||||
# ELSE IF(idisc = 1)THEN |
||||
# |
||||
# 2. focal mechanism: strike, dip and rake angles [deg] |
||||
#-------------------------------------------------------------------------------- |
||||
7.0 19.0 109.0 |
||||
#================================================================================ |
||||
# IDS PARAMETERS |
||||
# -------------- |
||||
# 1. maximum numbers of iterations. |
||||
# Note: if max. iteration = 0, forward modelling for any dummy data set is |
||||
# made using the given rupture model and the filter parameters |
||||
# if max. iteration < 0, same as iteration = 0, but without filtering. |
||||
#-------------------------------------------------------------------------------- |
||||
100 |
||||
#================================================================================ |
||||
# OUTPUT |
||||
# ------ |
||||
# 1. folder name for the output files (should exist already) |
||||
# 2. sub-folder name for comparisons of observed and modelled waveform data |
||||
# (should exist already) |
||||
# 3. sub-folder name for results from empirical baseline correction of |
||||
# waveform data (this folder should exist already) |
||||
# 4. file name of major earthquake parameters |
||||
# 5. file name of earthquake source-time-function (moment rate history) |
||||
# 6. file name of sub-fault source-time-function (moment rate history) |
||||
# 7. file name of rupture propagation |
||||
# 8. file name of final slip model |
||||
# Note: if forward modelling is selected (s. above), the above two files |
||||
# should provide data for the given kinematic rupture model and will |
||||
# be overwritten after the IDS inversion |
||||
# 9. file name of normalized residual waveform variance |
||||
#10. file name of predicted static offsets at seismic waveform data sites |
||||
#11. file name of comparison between observed and modelled GNSS data |
||||
#12. file name of comparison between observed and modelled InSAR data |
||||
#13. number of snapshots of the rupture process |
||||
#14. file name of the 1. snapshot for the slip released within the given |
||||
# time window (t1[s], t2[s]) |
||||
#-------------------------------------------------------------------------------- |
||||
'./Output' |
||||
'O2S' |
||||
'EBC' |
||||
'EQ_MP.dat' |
||||
'EQ_STF.dat' |
||||
'PT_STF.dat' |
||||
'Rup_Front.dat' |
||||
'SlipModel_Tp_Mean.dat' |
||||
'WFMisfitvar.dat' |
||||
'SMStaticOffset.dat' |
||||
'GNSSDatafit.dat' |
||||
'InSARDatafit.dat' |
||||
30 |
||||
'Snapshot_010s.dat' 0.0 10.0 |
||||
'Snapshot_015s.dat' 0.0 15.0 |
||||
'Snapshot_020s.dat' 0.0 20.0 |
||||
'Snapshot_025s.dat' 0.0 25.0 |
||||
'Snapshot_030s.dat' 0.0 30.0 |
||||
'Snapshot_035s.dat' 0.0 35.0 |
||||
'Snapshot_040s.dat' 0.0 40.0 |
||||
'Snapshot_045s.dat' 0.0 45.0 |
||||
'Snapshot_050s.dat' 0.0 50.0 |
||||
'Snapshot_055s.dat' 0.0 55.0 |
||||
'Snapshot_060s.dat' 0.0 60.0 |
||||
'Snapshot_065s.dat' 0.0 65.0 |
||||
'Snapshot_070s.dat' 0.0 70.0 |
||||
'Snapshot_075s.dat' 0.0 75.0 |
||||
'Snapshot_080s.dat' 0.0 80.0 |
||||
'SnapshotR_010s.dat' 5.0 10.0 |
||||
'SnapshotR_015s.dat' 10.0 15.0 |
||||
'SnapshotR_020s.dat' 15.0 20.0 |
||||
'SnapshotR_025s.dat' 20.0 25.0 |
||||
'SnapshotR_030s.dat' 25.0 30.0 |
||||
'SnapshotR_035s.dat' 30.0 35.0 |
||||
'SnapshotR_040s.dat' 35.0 40.0 |
||||
'SnapshotR_045s.dat' 40.0 45.0 |
||||
'SnapshotR_050s.dat' 45.0 50.0 |
||||
'SnapshotR_055s.dat' 50.0 55.0 |
||||
'SnapshotR_060s.dat' 55.0 60.0 |
||||
'SnapshotR_065s.dat' 60.0 65.0 |
||||
'SnapshotR_070s.dat' 65.0 70.0 |
||||
'SnapshotR_075s.dat' 70.0 75.0 |
||||
'SnapshotR_080s.dat' 75.0 80.0 |
||||
#================================end of input==================================== |
@ -0,0 +1,236 @@
|
||||
# Example for the input file of FORTRAN77 program "ids2020" for kinematic earthquake |
||||
# source imaging based on the Iterative Deconvolution and Stacking (IDS) Method using |
||||
# seismic waveform and static displacement data jointly. |
||||
# |
||||
# written by Rongjiang Wang |
||||
# Helmholtz Centre Potsdam |
||||
# GFZ German Research Centre for Geosciences |
||||
# e-mail: wang@gfz-potsdam.de |
||||
# Phone +49 331 2881209 |
||||
# Fax +49 331 2881204 |
||||
# |
||||
# Last modified: Potsdam, April, 2020 |
||||
# |
||||
# Reference: |
||||
# Zhang and Wang et al. (2014). Automatic imaging of earthquake rupture processes |
||||
# by iterative deconvolution and stacking of high-rate GNSS and strong motion |
||||
# seismograms, JGR Solid Earth, 199(7), 5633-5650. |
||||
# |
||||
################################################################# |
||||
## ## |
||||
## If not specified otherwise, SI Unit System is used overall! ## |
||||
## ## |
||||
## ## |
||||
## Each comment line should start with "#" ## |
||||
## and no blank line is allowed! ## |
||||
## ## |
||||
################################################################# |
||||
# |
||||
#================================================================================ |
||||
# EARTHQUAKE LOCATION PARAMETERS |
||||
# ------------------------------ |
||||
# 1. origin time [s] (year, month, day, hour, minute [positive integer number] |
||||
# and second [positive or negative real number]), which will be also used as |
||||
# the reference time of the output data |
||||
# 2. hypocentre (lat[deg], lon[deg], depth[km]) |
||||
# 3. preliminary estimate of moment magnitude |
||||
# Note: the hypocentre location and origin time (at least to minute) should be |
||||
# consistent with those given in the "StationInfo.dat" file of the |
||||
# waveform data (s. below) |
||||
#-------------------------------------------------------------------------------- |
||||
2014 4 3 2 42 72.66 |
||||
-20.5984 -70.6320 27.33 |
||||
7.70 |
||||
#================================================================================ |
||||
# WAVEFORM DATA (HIGH-RATE-GNSS/STRONG-MOTION/TELE-SEISMIC SEISMOGRAMS) |
||||
# -------------------------------------------------------------------- |
||||
# 1. folder name of the data |
||||
# Note: this folder should include a file 'StationInfo.dat' giving all |
||||
# necessary information about the local monitoring network. |
||||
# 2. lower and upper thresholds of the epicentral distances [km] (stations |
||||
# outside the threshold distances will not be used) |
||||
# 3. weight of the static offset data (obtained automatically from the velocity |
||||
# waveforms after an empirical baseline correction) relative to the waveform |
||||
# data (suggested value 0.0-1.0) |
||||
#-------------------------------------------------------------------------------- |
||||
'./WaveformData/' |
||||
0.0 500.0 |
||||
0.1 |
||||
#================================================================================ |
||||
# GREEN'S FUNCTION DATABASE |
||||
# ------------------------- |
||||
# 1. Green's function database (folder name) |
||||
# 2. Parameters of Butterworth bandpass filter applied to the synthetics: |
||||
# order, lower and upper cutoff frequencies [Hz] |
||||
# computation [Hz] |
||||
#-------------------------------------------------------------------------------- |
||||
'../GreenChileSM/GreenFunctions/' |
||||
3 0.00 0.50 |
||||
#================================================================================ |
||||
# GNSS STATIC OFFSETS |
||||
# ------------------- |
||||
# 1. number of GNSS sites, file name of the data |
||||
# Note: if the number of GNSS sites <= 0, then no GNSS data are available. |
||||
# the GNSS data file includes one header line and 8 culomns, |
||||
# Lat(deg) Lon(deg) East(m) North(m) Up(m) wf_E wf_N wf_Z |
||||
# where wf_E/N/Z are within-dataset relative weighting factor proportional to |
||||
# inverse error variance |
||||
# 2. weight of the whole GNSS dataset relative to the waveform dataset (suggested |
||||
# value 0.0-1.0) |
||||
#-------------------------------------------------------------------------------- |
||||
21 './GPSData/GPS_Iquique.dat' |
||||
1.0 |
||||
#================================================================================ |
||||
# InSAR LOS DISPLACEMENTS |
||||
# ----------------------- |
||||
# 1. number of InSAR grids, file name of the data |
||||
# Note: if the number of InSAR grids <= 0, then no InSAR data are used. |
||||
# the InSAR data file includes one header line and 8 culomns, |
||||
# Lat(deg) Lon(deg) LOS(m) wf_los incidence(deg) azimuth(deg) |
||||
# where wf_los is the within-dataset relative weighting factor |
||||
# proportional to inverse error variance |
||||
# 2. weight of the whole InSAR dataset in the misfit variance relative to the |
||||
# waveform dataset (suggested value 0.0-1.0) |
||||
#-------------------------------------------------------------------------------- |
||||
0 './InSAR/NoInSAR.dat' |
||||
0.00 |
||||
#================================================================================ |
||||
# Geodetic GREEN'S FUNCTION DATABASE |
||||
# ---------------------------------- |
||||
# 1. geodetic Green's function database (folder name) |
||||
# 2. 3 file names of the geodetic Green's functions |
||||
#-------------------------------------------------------------------------------- |
||||
'../GreenChileGD/DGreen/' |
||||
'uz' 'ur' 'ut' |
||||
#================================================================================ |
||||
# FAULT PARAMETERS |
||||
# ---------------- |
||||
# 1. ipatch: switch (0/1) for subfaults input form, |
||||
# 0 = read discrete patches from files, |
||||
# 1 = automatic discretization of a single rectangular fault |
||||
#-------------------------------------------------------------------------------- |
||||
# idisc |
||||
#-------------------------------------------------------------------------------- |
||||
1 |
||||
#-------------------------------------------------------------------------------- |
||||
# IF(idisc = 0)THEN |
||||
# |
||||
# subfault paramters |
||||
# ================== |
||||
# file_name: data file for discrete patches |
||||
# number of sub-faults |
||||
# iref selection of the patch reference location |
||||
# |
||||
# Note: the file includes one header line followed by 8 columns of data: |
||||
# |
||||
# latitude[deg], longitude[deg], depth[km], length[km], width[km], |
||||
# strike[deg], dip[deg], rake[deg] |
||||
# |
||||
# where (lat, lon, dep) is the reference location of the patch depending |
||||
# on iref: 1 = upper-left corner, 2 = upper-right corner, |
||||
# 3 = lower-left corner, 4 = lower-right corner, |
||||
# 5 = central point (s. Fig.) |
||||
# |
||||
# definitions for a rectangular fault patch |
||||
# ========================================= |
||||
# |
||||
# north(x) |
||||
# / |
||||
# / | strike |
||||
# 1-----------------------2 |
||||
# |\ p . \ W |
||||
# :-\ i . \ i |
||||
# | \ l . 5 \ d |
||||
# :90 \ S . \ t |
||||
# |-dip\ . \ h |
||||
# : \. ) rake \ |
||||
# downward(z) 3-----------------------4 |
||||
# L e n g t h |
||||
#-------------------------------------------------------------------------------- |
||||
# file_name nsf iref |
||||
#-------------------------------------------------------------------------------- |
||||
# './fault_patches.dat' 288 5 |
||||
#-------------------------------------------------------------------------------- |
||||
# |
||||
# ELSE IF(idisc = 1)THEN |
||||
# |
||||
# 2. focal mechanism: strike, dip and rake angles [deg] |
||||
#-------------------------------------------------------------------------------- |
||||
347.0 25.00 87.00 |
||||
#================================================================================ |
||||
# IDS PARAMETERS |
||||
# -------------- |
||||
# 1. maximum numbers of iterations. |
||||
# Note: if max. iteration = 0, forward modelling for any dummy data set is |
||||
# made using the given rupture model and the filter parameters |
||||
# if max. iteration < 0, same as iteration = 0, but without filtering. |
||||
#-------------------------------------------------------------------------------- |
||||
100 |
||||
#================================================================================ |
||||
# OUTPUT |
||||
# ------ |
||||
# 1. folder name for the output files (should exist already) |
||||
# 2. sub-folder name for comparisons of observed and modelled waveform data |
||||
# (should exist already) |
||||
# 3. sub-folder name for results from empirical baseline correction of |
||||
# waveform data (this folder should exist already) |
||||
# 4. file name of major earthquake parameters |
||||
# 5. file name of earthquake source-time-function (moment rate history) |
||||
# 6. file name of sub-fault source-time-function (moment rate history) |
||||
# 7. file name of rupture propagation |
||||
# 8. file name of final slip model |
||||
# Note: if forward modelling is selected (s. above), the above two files |
||||
# should provide data for the given kinematic rupture model and will |
||||
# be overwritten after the IDS inversion |
||||
# 9. file name of normalized residual waveform variance |
||||
#10. file name of predicted static offsets at seismic waveform data sites |
||||
#11. file name of comparison between observed and modelled GNSS data |
||||
#12. file name of comparison between observed and modelled InSAR data |
||||
#13. number of snapshots of the rupture process |
||||
#14. file name of the 1. snapshot for the slip released within the given |
||||
# time window (t1[s], t2[s]) |
||||
#-------------------------------------------------------------------------------- |
||||
'./Output' |
||||
'O2S' |
||||
'EBC' |
||||
'EQ_MP.dat' |
||||
'EQ_STF.dat' |
||||
'PT_STF.dat' |
||||
'Rup_Front.dat' |
||||
'SlipModel.dat' |
||||
'WFMisfitvar.dat' |
||||
'SMStaticOffset.dat' |
||||
'GNSSDatafit.dat' |
||||
'InSARDatafit.dat' |
||||
30 |
||||
'Snapshot_010s.dat' 0.0 10.0 |
||||
'Snapshot_015s.dat' 0.0 15.0 |
||||
'Snapshot_020s.dat' 0.0 20.0 |
||||
'Snapshot_025s.dat' 0.0 25.0 |
||||
'Snapshot_030s.dat' 0.0 30.0 |
||||
'Snapshot_035s.dat' 0.0 35.0 |
||||
'Snapshot_040s.dat' 0.0 40.0 |
||||
'Snapshot_045s.dat' 0.0 45.0 |
||||
'Snapshot_050s.dat' 0.0 50.0 |
||||
'Snapshot_055s.dat' 0.0 55.0 |
||||
'Snapshot_060s.dat' 0.0 60.0 |
||||
'Snapshot_065s.dat' 0.0 65.0 |
||||
'Snapshot_070s.dat' 0.0 70.0 |
||||
'Snapshot_075s.dat' 0.0 75.0 |
||||
'Snapshot_080s.dat' 0.0 80.0 |
||||
'SnapshotR_010s.dat' 5.0 10.0 |
||||
'SnapshotR_015s.dat' 10.0 15.0 |
||||
'SnapshotR_020s.dat' 15.0 20.0 |
||||
'SnapshotR_025s.dat' 20.0 25.0 |
||||
'SnapshotR_030s.dat' 25.0 30.0 |
||||
'SnapshotR_035s.dat' 30.0 35.0 |
||||
'SnapshotR_040s.dat' 35.0 40.0 |
||||
'SnapshotR_045s.dat' 40.0 45.0 |
||||
'SnapshotR_050s.dat' 45.0 50.0 |
||||
'SnapshotR_055s.dat' 50.0 55.0 |
||||
'SnapshotR_060s.dat' 55.0 60.0 |
||||
'SnapshotR_065s.dat' 60.0 65.0 |
||||
'SnapshotR_070s.dat' 65.0 70.0 |
||||
'SnapshotR_075s.dat' 70.0 75.0 |
||||
'SnapshotR_080s.dat' 75.0 80.0 |
||||
#================================end of input==================================== |
@ -0,0 +1,236 @@
|
||||
# Example for the input file of FORTRAN77 program "ids2020" for kinematic earthquake |
||||
# source imaging based on the Iterative Deconvolution and Stacking (IDS) Method using |
||||
# seismic waveform and static displacement data jointly. |
||||
# |
||||
# written by Rongjiang Wang |
||||
# Helmholtz Centre Potsdam |
||||
# GFZ German Research Centre for Geosciences |
||||
# e-mail: wang@gfz-potsdam.de |
||||
# Phone +49 331 2881209 |
||||
# Fax +49 331 2881204 |
||||
# |
||||
# Last modified: Potsdam, April, 2020 |
||||
# |
||||
# Reference: |
||||
# Zhang and Wang et al. (2014). Automatic imaging of earthquake rupture processes |
||||
# by iterative deconvolution and stacking of high-rate GNSS and strong motion |
||||
# seismograms, JGR Solid Earth, 199(7), 5633-5650. |
||||
# |
||||
################################################################# |
||||
## ## |
||||
## If not specified otherwise, SI Unit System is used overall! ## |
||||
## ## |
||||
## ## |
||||
## Each comment line should start with "#" ## |
||||
## and no blank line is allowed! ## |
||||
## ## |
||||
################################################################# |
||||
# |
||||
#================================================================================ |
||||
# EARTHQUAKE LOCATION PARAMETERS |
||||
# ------------------------------ |
||||
# 1. origin time [s] (year, month, day, hour, minute [positive integer number] |
||||
# and second [positive or negative real number]), which will be also used as |
||||
# the reference time of the output data |
||||
# 2. hypocentre (lat[deg], lon[deg], depth[km]) |
||||
# 3. preliminary estimate of moment magnitude |
||||
# Note: the hypocentre location and origin time (at least to minute) should be |
||||
# consistent with those given in the "StationInfo.dat" file of the |
||||
# waveform data (s. below) |
||||
#-------------------------------------------------------------------------------- |
||||
2014 4 1 23 45 105.55 |
||||
-19.5764 -70.9037 28.54 |
||||
8.10 |
||||
#================================================================================ |
||||
# WAVEFORM DATA (HIGH-RATE-GNSS/STRONG-MOTION SEISMOGRAMS) |
||||
# -------------------------------------------------------------------- |
||||
# 1. folder name of the data |
||||
# Note: this folder should include a file 'StationInfo.dat' giving all |
||||
# necessary information about the local monitoring network. |
||||
# 2. lower and upper thresholds of the epicentral distances [km] (stations |
||||
# outside the threshold distances will not be used) |
||||
# 3. weight of the static offset data (obtained automatically from the velocity |
||||
# waveforms after an empirical baseline correction) relative to the waveform |
||||
# data (suggested value 0.0-1.0) |
||||
#-------------------------------------------------------------------------------- |
||||
'./WaveformData/' |
||||
0.0 800.0 |
||||
1.0 |
||||
#================================================================================ |
||||
# GREEN'S FUNCTION DATABASE |
||||
# ------------------------- |
||||
# 1. Green's function database (folder name) |
||||
# 2. Parameters of Butterworth bandpass filter applied to the synthetics: |
||||
# order, lower and upper cutoff frequencies [Hz] |
||||
# computation [Hz] |
||||
#-------------------------------------------------------------------------------- |
||||
'../GreenChileSM/GreenFunctions/' |
||||
3 0.00 0.50 |
||||
#================================================================================ |
||||
# GNSS STATIC OFFSETS |
||||
# ------------------- |
||||
# 1. number of GNSS sites, file name of the data |
||||
# Note: if the number of GNSS sites <= 0, then no GNSS data are available. |
||||
# the GNSS data file includes one header line and 8 culomns, |
||||
# Lat(deg) Lon(deg) East(m) North(m) Up(m) wf_E wf_N wf_Z |
||||
# where wf_E/N/Z are within-dataset relative weighting factor proportional to |
||||
# inverse error variance |
||||
# 2. weight of the whole GNSS dataset relative to the waveform dataset (suggested |
||||
# value 0.0-1.0) |
||||
#-------------------------------------------------------------------------------- |
||||
21 './GPSData/GPS_Pisagua.dat' |
||||
1.0 |
||||
#================================================================================ |
||||
# InSAR LOS DISPLACEMENTS |
||||
# ----------------------- |
||||
# 1. number of InSAR grids, file name of the data |
||||
# Note: if the number of InSAR grids <= 0, then no InSAR data are used. |
||||
# the InSAR data file includes one header line and 8 culomns, |
||||
# Lat(deg) Lon(deg) LOS(m) wf_los incidence(deg) azimuth(deg) |
||||
# where wf_los is the within-dataset relative weighting factor |
||||
# proportional to inverse error variance |
||||
# 2. weight of the whole InSAR dataset in the misfit variance relative to the |
||||
# waveform dataset (suggested value 0.0-1.0) |
||||
#-------------------------------------------------------------------------------- |
||||
0 './InSAR/NoInSAR.dat' |
||||
0.00 |
||||
#================================================================================ |
||||
# Geodetic GREEN'S FUNCTION DATABASE |
||||
# ---------------------------------- |
||||
# 1. geodetic Green's function database (folder name) |
||||
# 2. 3 file names of the geodetic Green's functions |
||||
#-------------------------------------------------------------------------------- |
||||
'../GreenChileGD/DGreen/' |
||||
'uz' 'ur' 'ut' |
||||
#================================================================================ |
||||
# FAULT PARAMETERS |
||||
# ---------------- |
||||
# 1. ipatch: switch (0/1) for subfaults input form, |
||||
# 0 = read discrete patches from files, |
||||
# 1 = automatic discretization of a single rectangular fault |
||||
#-------------------------------------------------------------------------------- |
||||
# idisc |
||||
#-------------------------------------------------------------------------------- |
||||
1 |
||||
#-------------------------------------------------------------------------------- |
||||
# IF(idisc = 0)THEN |
||||
# |
||||
# subfault paramters |
||||
# ================== |
||||
# file_name: data file for discrete patches |
||||
# number of sub-faults |
||||
# iref selection of the patch reference location |
||||
# |
||||
# Note: the file includes one header line followed by 8 columns of data: |
||||
# |
||||
# latitude[deg], longitude[deg], depth[km], length[km], width[km], |
||||
# strike[deg], dip[deg], rake[deg] |
||||
# |
||||
# where (lat, lon, dep) is the reference location of the patch depending |
||||
# on iref: 1 = upper-left corner, 2 = upper-right corner, |
||||
# 3 = lower-left corner, 4 = lower-right corner, |
||||
# 5 = central point (s. Fig.) |
||||
# |
||||
# definitions for a rectangular fault patch |
||||
# ========================================= |
||||
# |
||||
# north(x) |
||||
# / |
||||
# / | strike |
||||
# 1-----------------------2 |
||||
# |\ p . \ W |
||||
# :-\ i . \ i |
||||
# | \ l . 5 \ d |
||||
# :90 \ S . \ t |
||||
# |-dip\ . \ h |
||||
# : \. ) rake \ |
||||
# downward(z) 3-----------------------4 |
||||
# L e n g t h |
||||
#-------------------------------------------------------------------------------- |
||||
# file_name nsf iref |
||||
#-------------------------------------------------------------------------------- |
||||
# './fault_patches.dat' 288 5 |
||||
#-------------------------------------------------------------------------------- |
||||
# |
||||
# ELSE IF(idisc = 1)THEN |
||||
# |
||||
# 2. focal mechanism: strike, dip and rake angles [deg] |
||||
#-------------------------------------------------------------------------------- |
||||
346.0 13.00 84.00 |
||||
#================================================================================ |
||||
# IDS PARAMETERS |
||||
# -------------- |
||||
# 1. maximum numbers of iterations. |
||||
# Note: if max. iteration = 0, forward modelling for any dummy data set is |
||||
# made using the given rupture model and the filter parameters |
||||
# if max. iteration < 0, same as iteration = 0, but without filtering. |
||||
#-------------------------------------------------------------------------------- |
||||
100 |
||||
#================================================================================ |
||||
# OUTPUT |
||||
# ------ |
||||
# 1. folder name for the output files (should exist already) |
||||
# 2. sub-folder name for comparisons of observed and modelled waveform data |
||||
# (should exist already) |
||||
# 3. sub-folder name for results from empirical baseline correction of |
||||
# waveform data (this folder should exist already) |
||||
# 4. file name of major earthquake parameters |
||||
# 5. file name of earthquake source-time-function (moment rate history) |
||||
# 6. file name of sub-fault source-time-function (moment rate history) |
||||
# 7. file name of rupture propagation |
||||
# 8. file name of final slip model |
||||
# Note: if forward modelling is selected (s. above), the above two files |
||||
# should provide data for the given kinematic rupture model and will |
||||
# be overwritten after the IDS inversion |
||||
# 9. file name of normalized residual waveform variance |
||||
#10. file name of predicted static offsets at seismic waveform data sites |
||||
#11. file name of comparison between observed and modelled GNSS data |
||||
#12. file name of comparison between observed and modelled InSAR data |
||||
#13. number of snapshots of the rupture process |
||||
#14. file name of the 1. snapshot for the slip released within the given |
||||
# time window (t1[s], t2[s]) |
||||
#-------------------------------------------------------------------------------- |
||||
'./Output' |
||||
'O2S' |
||||
'EBC' |
||||
'EQ_MP.dat' |
||||
'EQ_STF.dat' |
||||
'PT_STF.dat' |
||||
'Rup_Front.dat' |
||||
'SlipModel.dat' |
||||
'WFMisfitvar.dat' |
||||
'SMStaticOffset.dat' |
||||
'GNSSDatafit.dat' |
||||
'InSARDatafit.dat' |
||||
30 |
||||
'Snapshot_010s.dat' 0.0 10.0 |
||||
'Snapshot_015s.dat' 0.0 15.0 |
||||
'Snapshot_020s.dat' 0.0 20.0 |
||||
'Snapshot_025s.dat' 0.0 25.0 |
||||
'Snapshot_030s.dat' 0.0 30.0 |
||||
'Snapshot_035s.dat' 0.0 35.0 |
||||
'Snapshot_040s.dat' 0.0 40.0 |
||||
'Snapshot_045s.dat' 0.0 45.0 |
||||
'Snapshot_050s.dat' 0.0 50.0 |
||||
'Snapshot_055s.dat' 0.0 55.0 |
||||
'Snapshot_060s.dat' 0.0 60.0 |
||||
'Snapshot_065s.dat' 0.0 65.0 |
||||
'Snapshot_070s.dat' 0.0 70.0 |
||||
'Snapshot_075s.dat' 0.0 75.0 |
||||
'Snapshot_080s.dat' 0.0 80.0 |
||||
'SnapshotR_010s.dat' 5.0 10.0 |
||||
'SnapshotR_015s.dat' 10.0 15.0 |
||||
'SnapshotR_020s.dat' 15.0 20.0 |
||||
'SnapshotR_025s.dat' 20.0 25.0 |
||||
'SnapshotR_030s.dat' 25.0 30.0 |
||||
'SnapshotR_035s.dat' 30.0 35.0 |
||||
'SnapshotR_040s.dat' 35.0 40.0 |
||||
'SnapshotR_045s.dat' 40.0 45.0 |
||||
'SnapshotR_050s.dat' 45.0 50.0 |
||||
'SnapshotR_055s.dat' 50.0 55.0 |
||||
'SnapshotR_060s.dat' 55.0 60.0 |
||||
'SnapshotR_065s.dat' 60.0 65.0 |
||||
'SnapshotR_070s.dat' 65.0 70.0 |
||||
'SnapshotR_075s.dat' 70.0 75.0 |
||||
'SnapshotR_080s.dat' 75.0 80.0 |
||||
#================================end of input==================================== |
@ -0,0 +1,9 @@
|
||||
bin_PROGRAMS = ids2020
|
||||
ids2020_SOURCES = banddpasss.f bscbilin.f bscmono.f butterworth.f d2dfit.f dc3d.f deepphase.f \
|
||||
depthp.f depthphase.f disazi.f four1w.f idsalloc.f idsdifgrn.f idsforward.f \
|
||||
idsgetinp.f idsgnsdat.f idsgnsgrn.f idsinverse.f idskernel.f idsmain.f \
|
||||
idsmodel.f idsosmgrn.f idsoutput.f idspstt.f idssardat.f idssargrn.f \
|
||||
idsscale.f idssmdat.f idssmgrn.f idssmwei.f moments.f rampfit.f skipdoc.f \
|
||||
stepfit.f swavelet.f tpssub.f
|
||||
clean-local: |
||||
-rm -f *.mod
|
@ -0,0 +1,44 @@
|
||||
subroutine bandpass(n,f1,f2,df,nf,h) |
||||
implicit none |
||||
integer*4 n,nf |
||||
real*8 f1,f2,df |
||||
complex*16 h(nf) |
||||
c |
||||
integer*4 l,k |
||||
real*8 w,w1,w2,delt,arg |
||||
c |
||||
real*8 PI |
||||
data PI/3.14159265358979d0/ |
||||
c |
||||
if(n.le.0.or.f1.ge.f2)then |
||||
do l=1,nf |
||||
h(l)=(1.d0,0.d0) |
||||
enddo |
||||
else if(f1.le.0.d0)then |
||||
w2=2.d0*PI*f2 |
||||
do l=1,nf |
||||
w=2.d0*PI*dble(l-1)*df |
||||
delt=w2-w1 |
||||
h(l)=(1.d0,0.d0) |
||||
do k=1,n |
||||
arg=PI*dble(2*k-1)/dble(2*n) |
||||
h(l)=h(l)*dcmplx(0.d0,-delt) |
||||
& /dcmplx(w-delt*dcos(arg),-delt*dsin(arg)) |
||||
enddo |
||||
enddo |
||||
else |
||||
w1=2.d0*PI*f1 |
||||
w2=2.d0*PI*f2 |
||||
do l=1,nf |
||||
w=2.d0*PI*dble(l-1)*df |
||||
delt=w*(w2-w1) |
||||
h(l)=(1.d0,0.d0) |
||||
do k=1,n |
||||
arg=PI*dble(2*k-1)/dble(2*n) |
||||
h(l)=h(l)*dcmplx(0.d0,-delt) |
||||
& /dcmplx(w*w-w1*w2-delt*dcos(arg),-delt*dsin(arg)) |
||||
enddo |
||||
enddo |
||||
endif |
||||
return |
||||
end |
@ -0,0 +1,127 @@
|
||||
subroutine bscbilin(n,ip,vel,bserr,dt,offset,sigma) |
||||
implicit none |
||||
c |
||||
integer*4 n,ip |
||||
real*8 dt,offset,sigma |
||||
real*8 vel(n),bserr(n) |
||||
c |
||||
integer i,j,k,i0,i1,i2,iw,ia,ib,id,ierr |
||||
real*8 a,b,a0,a1,delta,gamma,smin |
||||
c |
||||
integer*4 ndeg |
||||
real*8 PI |
||||
data ndeg,PI/1,3.14159265358979d0/ |
||||
c |
||||
real*8, allocatable:: poly(:,:),bat(:),swap(:) |
||||
c |
||||
allocate (swap(n),stat=ierr) |
||||
if(ierr.ne.0)stop ' Error in bscmono: swap not allocated!' |
||||
allocate (poly(n,0:ndeg),stat=ierr) |
||||
if(ierr.ne.0)stop ' Error in bscmono: poly not allocated!' |
||||
allocate (bat(0:ndeg),stat=ierr) |
||||
if(ierr.ne.0)stop ' Error in bscmono: bat not allocated!' |
||||
c |
||||
c remove pre-event trend |
||||
c |
||||
call d2dfit(ip,vel,poly,bat,1,bserr) |
||||
a0=bserr(1) |
||||
a1=(bserr(ip)-bserr(1))/dble(ip-1) |
||||
c |
||||
do i=1,n |
||||
vel(i)=vel(i)-(a0+a1*dble(i-1)) |
||||
enddo |
||||
c |
||||
c estimate signal duration |
||||
c |
||||
swap(1)=0.d0 |
||||
do i=2,n |
||||
swap(i)=swap(i-1)+dabs(vel(i)-vel(i-1)) |
||||
enddo |
||||
iw=2 |
||||
do i=2,n-1 |
||||
if(swap(i).le.0.85d0*swap(n))iw=i |
||||
enddo |
||||
c |
||||
c empirical bi-linear baseline correction |
||||
c |
||||
call d2dfit(1+n-iw,vel(iw),poly,bat,1,bserr(iw)) |
||||
c |
||||
a=bserr(iw) |
||||
b=(bserr(n)-bserr(iw))/dble(n-iw) |
||||
do i=1,iw-1 |
||||
bserr(i)=a+b*dble(i-iw) |
||||
enddo |
||||
c |
||||
swap(1)=0.d0 |
||||
do i=2,iw-1 |
||||
swap(i)=swap(i-1)+vel(i) |
||||
enddo |
||||
do i=iw,n |
||||
swap(i)=swap(i-1)+vel(i)-bserr(i) |
||||
enddo |
||||
call stepfit(n,swap,ip,iw,i0,delta,smin) |
||||
ia=iw-1 |
||||
ib=iw |
||||
c |
||||
id=max0(1,(iw-ip)/50) |
||||
c |
||||
do k=ip,iw-id,id |
||||
do j=max0(k+id,(ip+iw)/2),iw,id |
||||
do i=1,ip-1 |
||||
swap(i)=0.d0 |
||||
enddo |
||||
do i=ip,k |
||||
swap(i)=swap(i-1)+vel(i) |
||||
enddo |
||||
do i=k+1,j-1 |
||||
swap(i)=swap(i-1)+vel(i)-bserr(j)*dble(i-k)/dble(j-k) |
||||
enddo |
||||
do i=j,n |
||||
swap(i)=swap(i-1)+vel(i)-bserr(i) |
||||
enddo |
||||
c |
||||
call stepfit(n,swap,ip,iw,i0,delta,gamma) |
||||
c |
||||
if(gamma.le.smin)then |
||||
ia=k |
||||
ib=j |
||||
smin=gamma |
||||
endif |
||||
enddo |
||||
enddo |
||||
c |
||||
do i=1,ia |
||||
bserr(i)=0.d0 |
||||
enddo |
||||
a=bserr(ib) |
||||
do i=ia+1,ib-1 |
||||
bserr(i)=a*dble(i-ia)/dble(ib-ia) |
||||
enddo |
||||
c |
||||
do i=1,n |
||||
vel(i)=vel(i)-bserr(i) |
||||
enddo |
||||
c |
||||
swap(1)=0.d0 |
||||
do i=2,n |
||||
swap(i)=swap(i-1)+vel(i)*dt |
||||
enddo |
||||
call rampfit(n,swap,ip,iw,i1,i2,offset,sigma,poly) |
||||
sigma=0.d0 |
||||
do i=i2,iw+1 |
||||
sigma=sigma+dabs(swap(i)-offset) |
||||
enddo |
||||
sigma=sigma/dble(1+iw-i2) |
||||
delta=0.d0 |
||||
do i=ip,i2 |
||||
delta=delta+bserr(i)*dt |
||||
enddo |
||||
sigma=dmax1(sigma,dabs(delta)) |
||||
c |
||||
do i=1,n |
||||
bserr(i)=bserr(i)+a0+a1*dble(i-1) |
||||
enddo |
||||
c |
||||
deallocate(swap,poly,bat) |
||||
return |
||||
end |
@ -0,0 +1,313 @@
|
||||
subroutine bscmono(nw,ipp,vel,bse,dt,offset,sigma) |
||||
implicit none |
||||
c |
||||
integer*4 nw,ipp |
||||
real*8 dt,offset,sigma |
||||
real*8 vel(nw),bse(nw) |
||||
c |
||||
integer*4 i,j,i0,i1,i2,i3,i4,i5,i6,iw,ierr |
||||
integer*4 k,k1,k2,k3,k4,k5,k6,ks,id,ip,npeak,ipga |
||||
real*8 a0,a1,delta,smin,gamma,pga,pgv |
||||
real*8 d1,d2,d3,d4,d5,d6,d1opt,d2opt,d3opt,d4opt,d5opt |
||||
c |
||||
integer*4 ndeg |
||||
parameter(ndeg=2) |
||||
c |
||||
real*8 pi,sdw |
||||
data pi,sdw/3.14159265358979d+00,0.75d+00/ |
||||
c |
||||
real*8, allocatable:: poly(:,:),bat(:),swp(:) |
||||
allocate (poly(nw,0:ndeg),stat=ierr) |
||||
if(ierr.ne.0)stop ' Error in bscmono: poly not allocated!' |
||||
allocate (bat(0:ndeg),stat=ierr) |
||||
if(ierr.ne.0)stop ' Error in bscmono: bat not allocated!' |
||||
allocate (swp(nw),stat=ierr) |
||||
if(ierr.ne.0)stop ' Error in bscmono: swp not allocated!' |
||||
c |
||||
c remove pre-event trend |
||||
c |
||||
ip=ipp |
||||
call d2dfit(ip,vel,poly,bat,1,bse) |
||||
c |
||||
a0=bse(1) |
||||
a1=(bse(ip)-bse(1))/dble(ip-1) |
||||
c |
||||
do i=1,nw |
||||
vel(i)=vel(i)-(a0+a1*dble(i-1)) |
||||
enddo |
||||
c |
||||
c uncorrected acceleration |
||||
c |
||||
do i=2,nw |
||||
swp(i)=(vel(i)-vel(i-1))/dt |
||||
enddo |
||||
swp(1)=swp(2) |
||||
c |
||||
c estimate pga time |
||||
c |
||||
ipga=ip |
||||
pga=dabs(swp(ip)) |
||||
do i=ip+1,nw |
||||
if(pga.lt.dabs(swp(i)))then |
||||
ipga=i |
||||
pga=dabs(swp(i)) |
||||
endif |
||||
enddo |
||||
c |
||||
swp(1)=0.d0 |
||||
do i=2,nw |
||||
swp(i)=swp(i-1)+swp(i)**2 |
||||
enddo |
||||
c |
||||
c estimate energy signal window |
||||
c |
||||
iw=ip |
||||
do i=ip+1,nw |
||||
if(swp(i).ge.sdw*swp(nw))then |
||||
iw=i |
||||
goto 100 |
||||
endif |
||||
enddo |
||||
100 continue |
||||
c |
||||
iw=min0((2*nw+ip)/3,max0(iw,2*ipga-ip)) |
||||
c |
||||
c estimate earliest start time of baseline shift |
||||
c |
||||
swp(1)=0.d0 |
||||
do i=2,nw |
||||
swp(i)=swp(i-1)+vel(i)*dt |
||||
enddo |
||||
c |
||||
i0=ip |
||||
do i=1+(2*ip+ipga)/3,ip+1,-1 |
||||
if(swp(i)*swp(i-1).le.0.d0)then |
||||
i0=i |
||||
goto 200 |
||||
endif |
||||
enddo |
||||
200 continue |
||||
ip=i0 |
||||
c |
||||
c main smoothing procedure |
||||
c |
||||
i0=1+(2*nw+iw)/3 |
||||
call d2dfit(2+nw-i0,swp(i0-1),poly,bat,2,bse(i0-1)) |
||||
do i=i0,nw |
||||
swp(i)=(bse(i)-bse(i-1))/dt |
||||
enddo |
||||
d1=(swp(nw)-swp(i0))/dble(nw-i0) |
||||
c |
||||
do i=1,ip |
||||
bse(i)=0.d0 |
||||
enddo |
||||
do i=ip+1,i0 |
||||
bse(i)=vel(i) |
||||
enddo |
||||
do i=i0+1,nw |
||||
bse(i)=vel(i)*dcos(0.5d0*pi*dble(i-i0)/dble(nw-i0))**2 |
||||
& +swp(i)*dsin(0.5d0*pi*dble(i-i0)/dble(nw-i0))**2 |
||||
enddo |
||||
c |
||||
k=0 |
||||
400 k=k+1 |
||||
do i=ip,nw |
||||
swp(i)=bse(i) |
||||
enddo |
||||
do i=ip+1,nw-1 |
||||
bse(i)=(swp(i-1)+swp(i)+swp(i+1))/3.d0 |
||||
enddo |
||||
c |
||||
npeak=0 |
||||
do i=iw+1,nw-1 |
||||
if(bse(i).lt.bse(i-1)+d1.and. |
||||
& bse(i).lt.bse(i+1)-d1.or. |
||||
& bse(i).gt.bse(i-1)+d1.and. |
||||
& bse(i).gt.bse(i+1)-d1)npeak=npeak+1 |
||||
enddo |
||||
if(npeak.gt.1)goto 400 |
||||
c |
||||
gamma=0.d0 |
||||
do i=iw,nw |
||||
gamma=dmax1(gamma,dabs(vel(i)-bse(i))) |
||||
enddo |
||||
c |
||||
pgv=gamma |
||||
do i=1,iw-1 |
||||
pgv=dmax1(pgv,dabs(vel(i)-bse(i))) |
||||
enddo |
||||
c |
||||
i0=iw |
||||
npeak=0 |
||||
do i=iw-1,ip+1,-1 |
||||
gamma=dmax1(gamma,dabs(vel(i)-bse(i))) |
||||
if(bse(i).lt.bse(i-1)+d1.and. |
||||
& bse(i).lt.bse(i+1)-d1.or. |
||||
& bse(i).gt.bse(i-1)+d1.and. |
||||
& bse(i).gt.bse(i+1)-d1)npeak=npeak+1 |
||||
if(npeak.gt.0.or. |
||||
& gamma.ge.0.25d0*pgv.and.dabs(bse(i)).le.0.5d0*pgv)then |
||||
goto 500 |
||||
else |
||||
i0=i |
||||
endif |
||||
enddo |
||||
500 continue |
||||
if(npeak.gt.0)then |
||||
iw=(2*i0+iw)/3 |
||||
else |
||||
iw=i0 |
||||
endif |
||||
c |
||||
call d2dfit(1+nw-iw,bse(iw),poly,bat,1,swp(iw)) |
||||
c |
||||
d1=swp(iw+1)-swp(iw) |
||||
d2=swp(iw)/dble(iw-ip) |
||||
if(d2*d1.ge.0.d0.and.dabs(d2).lt.dabs(d1))then |
||||
ip=(ip+iw-idint(swp(iw)/d1))/2 |
||||
endif |
||||
c |
||||
do i=1,iw |
||||
bse(i)=0.d0 |
||||
enddo |
||||
c |
||||
c estimate best-fit monotonic trend within signal window by grid search |
||||
c assuming that baseline shift increases faster than ~sqrt(t) |
||||
c |
||||
id=1+(iw-ip)/6 |
||||
if(ip+6*id.ge.nw)id=id-1 |
||||
i1=ip+id |
||||
i2=i1+id |
||||
i3=i2+id |
||||
i4=i3+id |
||||
i5=i4+id |
||||
i6=i5+id |
||||
smin=0.d0 |
||||
c |
||||
k6=18 |
||||
d6=bse(i6) |
||||
delta=d6/18.d0 |
||||
c |
||||
do k5=0,16 |
||||
d5=dble(k5)*delta |
||||
do k4=0,min0(15,k5) |
||||
d4=dble(k4)*delta |
||||
do k3=0,min0(13,k4) |
||||
d3=dble(k3)*delta |
||||
do k2=0,min0(10,k3) |
||||
d2=dble(k2)*delta |
||||
do k1=0,min0(7,k2) |
||||
d1=dble(k1)*delta |
||||
sigma=0.d0 |
||||
do i=ip+1,i1 |
||||
sigma=sigma+(vel(i) |
||||
& -d1*(dble(i-ip)/dble(id))**2)**2 |
||||
enddo |
||||
do i=i1+1,i2 |
||||
sigma=sigma+(vel(i) |
||||
& -(d1+(d2-d1)*dble(i-i1)/dble(id)))**2 |
||||
enddo |
||||
do i=i2+1,i3 |
||||
sigma=sigma+(vel(i) |
||||
& -(d2+(d3-d2)*dble(i-i2)/dble(id)))**2 |
||||
enddo |
||||
do i=i3+1,i4 |
||||
sigma=sigma+(vel(i) |
||||
& -(d3+(d4-d3)*dble(i-i3)/dble(id)))**2 |
||||
enddo |
||||
do i=i4+1,i5 |
||||
sigma=sigma+(vel(i) |
||||
& -(d4+(d5-d4)*dble(i-i4)/dble(id)))**2 |
||||
enddo |
||||
do i=i5+1,i6 |
||||
sigma=sigma+(vel(i) |
||||
& -(d5+(d6-d5)*dble(i-i5)/dble(id)))**2 |
||||
enddo |
||||
if(smin.le.0.d0.or.sigma.le.smin)then |
||||
smin=sigma |
||||
d1opt=d1 |
||||
d2opt=d2 |
||||
d3opt=d3 |
||||
d4opt=d4 |
||||
d5opt=d5 |
||||
endif |
||||
enddo |
||||
enddo |
||||
enddo |
||||
enddo |
||||
enddo |
||||
c |
||||
do i=1,ip |
||||
bse(i)=0.d0 |
||||
enddo |
||||
do i=ip+1,i1 |
||||
bse(i)=d1opt*(dble(i-ip)/dble(id))**2 |
||||
enddo |
||||
do i=i1+1,i2 |
||||
bse(i)=d1opt+(d2opt-d1opt)*dble(i-i1)/dble(id) |
||||
enddo |
||||
do i=i2+1,i3 |
||||
bse(i)=d2opt+(d3opt-d2opt)*dble(i-i2)/dble(id) |
||||
enddo |
||||
do i=i3+1,i4 |
||||
bse(i)=d3opt+(d4opt-d3opt)*dble(i-i3)/dble(id) |
||||
enddo |
||||
do i=i4+1,i5 |
||||
bse(i)=d4opt+(d5opt-d4opt)*dble(i-i4)/dble(id) |
||||
enddo |
||||
do i=i5+1,i6-1 |
||||
bse(i)=d5opt+(d6-d5opt)*dble(i-i5)/dble(id) |
||||
enddo |
||||
c |
||||
600 continue |
||||
c |
||||
c re-smoothing |
||||
c |
||||
d1=bse(i6)/dble(i6-ip) |
||||
ks=1+(i6-ip)/2 |
||||
c |
||||
k=0 |
||||
800 k=k+1 |
||||
do i=ipp,min0(nw,i6+k) |
||||
swp(i)=bse(i) |
||||
enddo |
||||
do i=ipp+1,min0(nw,i6+k)-1 |
||||
bse(i)=(swp(i-1)+swp(i)+swp(i+1))/3.d0 |
||||
enddo |
||||
c |
||||
npeak=0 |
||||
do i=ipp+1,i6-1 |
||||
if(bse(i).lt.bse(i-1)+d1.and. |
||||
& bse(i).lt.bse(i+1)-d1.or. |
||||
& bse(i).gt.bse(i-1)+d1.and. |
||||
& bse(i).gt.bse(i+1)-d1)npeak=npeak+1 |
||||
enddo |
||||
if(k.lt.ks.or.npeak.gt.1)goto 800 |
||||
c |
||||
do i=1,nw |
||||
vel(i)=vel(i)-bse(i) |
||||
enddo |
||||
c |
||||
swp(1)=0.d0 |
||||
do i=2,nw |
||||
swp(i)=swp(i-1)+vel(i)*dt |
||||
enddo |
||||
call rampfit(nw,swp,ipp,iw,i1,i2,offset,sigma,poly) |
||||
sigma=0.d0 |
||||
do i=i2,iw+1 |
||||
sigma=sigma+dabs(swp(i)-offset) |
||||
enddo |
||||
sigma=sigma/dble(1+iw-i2) |
||||
delta=0.d0 |
||||
do i=ip,iw |
||||
delta=delta+bse(i)*dt |
||||
enddo |
||||
sigma=dmax1(sigma,dabs(delta)) |
||||
c |
||||
do i=1,nw |
||||
bse(i)=bse(i)+a0+a1*dble(i-1) |
||||
enddo |
||||
c |
||||
deallocate(poly,bat,swp) |
||||
return |
||||
end |
@ -0,0 +1,46 @@
|
||||
subroutine butterworth(n,fc,df,nf,lpf) |
||||
c |
||||
c butterworth lowpass filter |
||||
c |
||||
c n: order |
||||
c fc: cutoff frequency |
||||
c df: frequency sampling interval |
||||
c nf: number of freqquency samples |
||||
c lpf: complex lowpass filter (return values) |
||||
c |
||||
implicit none |
||||
integer*4 n,nf |
||||
real*8 fc,df |
||||
complex*16 lpf(nf) |
||||
c |
||||
integer*4 l,k |
||||
complex*16 s,cs |
||||
c |
||||
real*8 PI |
||||
data PI/3.14159265358979d0/ |
||||
c |
||||
if(n.le.0.or.fc.le.0.d0)then |
||||
do l=1,nf |
||||
lpf(l)=(1.d0,0.d0) |
||||
enddo |
||||
else if(n.eq.2*(n/2))then |
||||
do l=1,nf |
||||
s=dcmplx(0.d0,df*dble(l-1)/fc) |
||||
lpf(l)=(1.d0,0.d0) |
||||
do k=1,n/2 |
||||
cs=dcmplx(2.d0*dcos(PI*dble(2*k+n-1)/dble(2*n)),0.d0) |
||||
lpf(l)=lpf(l)/(s*s-s*cs+(1.d0,0.d0)) |
||||
enddo |
||||
enddo |
||||
else |
||||
do l=1,nf |
||||
s=dcmplx(0.d0,df*dble(l-1)/fc) |
||||
lpf(l)=(1.d0,0.d0)/(s+(1.d0,0.d0)) |
||||
do k=1,(n-1)/2 |
||||
cs=dcmplx(2.d0*dcos(PI*dble(2*k+n-1)/dble(2*n)),0.d0) |
||||
lpf(l)=lpf(l)/(s*s-s*cs+(1.d0,0.d0)) |
||||
enddo |
||||
enddo |
||||
endif |
||||
return |
||||
end |
@ -0,0 +1,38 @@
|
||||
subroutine d2dfit(n,dis,p,b,ndeg,disfit) |
||||
implicit none |
||||
integer*4 n,ndeg |
||||
real*8 dis(n),disfit(n),p(n,0:ndeg),b(0:ndeg) |
||||
c |
||||
integer*4 i,ideg |
||||
real*8 x,dx |
||||
c |
||||
dx=2.d0/dble(n-1) |
||||
do i=1,n |
||||
x=-1.d0+dble(i-1)*dx |
||||
p(i,0)=1.d0 |
||||
if(ndeg.gt.0)then |
||||
p(i,1)=x |
||||
do ideg=2,ndeg |
||||
p(i,ideg)=(dble(2*ideg-1)*x*p(i,ideg-1) |
||||
& -dble(ideg-1)*p(i,ideg-2))/dble(ideg) |
||||
enddo |
||||
endif |
||||
enddo |
||||
c |
||||
do ideg=0,ndeg |
||||
b(ideg)=0.5d0*(dis(1)*p(1,ideg)+dis(n)*p(n,ideg)) |
||||
do i=2,n-1 |
||||
b(ideg)=b(ideg)+dis(i)*p(i,ideg) |
||||
enddo |
||||