A Python Package for Surface-Wave Inversion Pre- and Post-Processing
Project description
SWprepost - A Python Package for Surface Wave Inversion Pre- and Post-Processing
Joseph P. Vantassel, The University of Texas at Austin
Table of Contents
About SWprepost
SWprepost
is a Python package for performing surface wave inversion pre- and
post-processing. SWprepost
was developed by Joseph P. Vantassel under the
supervision of Professor Brady R. Cox at The University of Texas at Austin. The
package includes 11 class definitions for interacting with the various
components required for surface wave inversion. It is designed to integrate
seamlessly with the Dinver module of the popular open-source software Geopsy,
however has been written in a general manner to ensure its usefulness with other
inversion programs. Furthermore, some of the class definitions provided such as
GroundModel
may even be of use to those working in the Geotechnical or
Geophysical fields, but who do not perform surface wave inversions.
If you use SWprepost
in your research or consulting we ask you please cite the
following:
Citation Forthcoming
Note: For software, version specific citations should be preferred to general
concept citations, such as that listed above. To generate a version specific
citation for SWprepost
, please use the citation tool for that specific version
on the SWprepost
archive.
For the motivation behind the development of SWprepost
and its role in a
larger project focused on developing a complete workflow for surface wave
inversion please refer to and consider citing the following:
Citation Forthcoming
A Few Examples
All examples presented here can be replicated using the Jupyter notebook titled
ReadmeExamples.ipynb
in the examples
directory.
Import 100 ground models in less than 0.5 seconds
time_start = time.perf_counter()
gm_suite = swprepost.GroundModelSuite.from_geopsy(fname="inputs/from_geopsy_100gm.txt")
time_stop = time.perf_counter()
print(f"Elapsed Time: {np.round(time_stop - time_start)} seconds.")
print(gm_suite)
Elapsed Time: 0.0 seconds.
GroundModelSuite with 100 GroundModels.
Plot the ground models
fig, ax = plt.subplots(figsize=(2,4), dpi=150)
# Plot 100 best
label = "100 Best"
for gm in gm_suite:
ax.plot(gm.vs2, gm.depth, color="#ababab", label=label)
label=None
# Plot the single best in different color
ax.plot(gm_suite[0].vs2, gm_suite[0].depth, color="#00ffff", label="1 Best")
ax.set_ylim(50,0)
ax.set_xlabel("Vs (m/s)")
ax.set_ylabel("Depth (m)")
ax.legend()
plt.show()
Compute and plot their uncertainty
fig, ax = plt.subplots(figsize=(2,4), dpi=150)
# Calculate Median
disc_depth, siglnvs = gm_suite.sigma_ln()
ax.plot(siglnvs, disc_depth, color="#00ff00")
ax.set_xlim(0, 0.2)
ax.set_ylim(50,0)
ax.set_xlabel("$\sigma_{ln,Vs}$")
ax.set_ylabel("Depth (m)")
plt.show()
Getting Started
Installing or Upgrading SWprepost
-
If you do not have Python 3.6 or later installed, you will need to do so. A detailed set of instructions can be found here.
-
If you have not installed
swprepost
previously usepip install swprepost
. If you are not familiar withpip
, a useful tutorial can be found here. If you have an earlier version and would like to upgrade to the latest version ofswprepost
usepip install swprepost --upgrade
. -
Confirm that
swprepost
has installed/updated successfully by examining the last few lines of text displayed in the console.
Using SWprepost
-
Download the contents of the examples directory to any location of your choice.
-
Explore Jupyter notebooks in the basic directory for a no-coding-required introduction to the
swprepost
package. If you have not installedJupyter
, detailed instructions can be found here. -
Move to the adv directory and follow the Jupyter notebook title
SWinvertWorkflow.ipynb
for an example application of the SWinvert workflow. -
Enjoy!
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for swprepost-0.3.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e4dbc753533d43280bb91a5a9aea717ab98071726a4b736865957c27a541bc9c |
|
MD5 | d66172058d6c618a50c40fef8e60c473 |
|
BLAKE2b-256 | 7c9a88889f63ae22e35353c48ae181dbde4201dd86767d940d80f1b7bfa30d23 |