Skip to main content

A Python package for horizontal-to-vertical spectral ratio processing

Project description

hvsrpy - A Python package for horizontal-to-vertical spectral ratio processing

Joseph P. Vantassel, The University of Texas at Austin

DOI License: GPL v3 CircleCI Documentation Status Language grade: Python Codacy Badge codecov

Table of Contents


About hvsrpy


hvsrpy is a Python package for performing horizontal-to-vertical spectral ratio (H/V) processing. hvsrpy was developed by Joseph P. Vantassel with contributions from Dana M. Brannon under the supervision of Professor Brady R. Cox at The University of Texas at Austin. The automated frequency-domain window-rejection algorithm and log-normal statistics implemented in hvsrpy are detailed in Cox et al. (2020). The statistical approach to incorporate azimuth variability implemented in hvsrpy are detailed in Cheng et al. (2020).

If you use hvsrpy in your research or consulting, we ask you please cite the following:

Joseph Vantassel. (2020). jpvantassel/hvsrpy: latest (Concept). Zenodo. http://doi.org/10.5281/zenodo.3666956

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 hvsrpy, please use the citation tool for that specific version on the hvsrpy archive.

These works provide background for the calculations performed by hvsrpy.

Cox, B. R., Cheng, T., Vantassel, J. P., and Manuel, L. (2020). “A statistical representation and frequency-domain window-rejection algorithm for single-station HVSR measurements.” Geophysical Journal International, 221(3), 2170-2183.

Cheng, T., Cox, B. R., Vantassel, J. P., and Manuel, L. (2020). "A statistical approach to account for azimuthal variability in single-station HVSR measurements." Geophysical Journal International, In Review.

Cheng, T., Hallal, M., Vantassel, J. P., and Cox, B. R. (2020). "Estimating Unbiased Statistics for Fundamental Site Frequency Using Spatially Distributed HVSR Measurements and Voronoi Tessellation." Submitted.

Why use hvsrpy


hvsrpy contains features not currently available in any other commercial or open-source software, including:

  • A log-normal distribution for the fundamental site frequency (f0) so the uncertainty in f0 can be represented consistently in frequency or period.
  • Ability to use the geometric-mean, squared-average, or any azimuth of your choice.
  • Access to the H/V data from each time window (and azimuth in the case of azimuthal calculations), and not only the mean/median curve.
  • A method to calculate statistics on f0 that incorporates azimuthal variability.
  • A method for developing rigorous and unbiased spatial statistics.
  • A fully-automated frequency-domain window-rejection algorithm.
  • A performant framework for batch-style processing.

Example output from hvsrpy when considering the geometric-mean of the horizontal components

Example output from hvsrpy when considering azimuthal variability

Example output from hvsrpy when considering spatial variability

A comparison of hvsrpy with Geopsy


Some of the functionality available in hvsrpy overlaps with the popular open-source software Geopsy. And so to encourage standardization, wherever their functionality coincides we have sought to ensure consistency. Two such comparisons are shown below. One for a single time window (left) and one for multiple time windows (right). Additional examples and the information necessary to reproduce them are provided at the end of this document.

Getting Started


Installing or Upgrading hvsrpy

  1. 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.

  2. If you have not installed hvsrpy previously use pip install hvsrpy. If you are not familiar with pip, a useful tutorial can be found here. If you have an earlier version and would like to upgrade to the latest version of hvsrpy use pip install hvsrpy --upgrade.

  3. Confirm that hvsrpy has installed/updated successfully by examining the last few lines of the text displayed in the console.

Using hvsrpy

  1. Download the contents of the examples directory to any location of your choice.

  2. Launch the Jupyter notebook (simple_hvsrpy_interface.ipynb) in the examples directory for a no-coding-required introduction to the basics of the hvsrpy package. If you have not installed Jupyter, detailed instructions can be found here.

  3. Launch the Jupyter notebook (azimuthal_hvsrpy_interface.ipynb) in the examples directory to perform more rigorous calculations which incorporate azimuthal variability.

  4. Enjoy!

Looking for more information

More information regarding HVSR processing and hvsrpy can be found here.

Additional Comparisons between hvsrpy and Geopsy


Multiple Windows

The examples in this section use the same settings applied to different noise records. The settings are provided in the Settings section and the name of each file is provided above the corresponding figure in the Results section. The noise records (i.e., .miniseed files) are provided in the examples directory and also as part of a large published data set (Cox and Vantassel, 2018).

Settings

  • Window Length: 60 seconds
  • Bandpass Filter Boolean: False
  • Cosine Taper Width: 10% (i.e., 5% in Geopsy)
  • Konno and Ohmachi Smoothing Coefficient: 40
  • Resampling:
    • Minimum Frequency: 0.3 Hz
    • Maximum Frequency: 40 Hz
    • Number of Points: 2048
    • Sampling Type: 'log'
  • Method for Combining Horizontal Components: 'squared-average'
  • Distribution for f0 from Time Windows: 'normal'
  • Distribution for Mean Curve: 'log-normal'

Multiple Window Results

File Name: UT.STN11.A2_C50.miniseed

File Name: UT.STN11.A2_C150.miniseed

File Name: UT.STN12.A2_C50.miniseed

File Name: UT.STN12.A2_C150.miniseed

Single Window

The examples in this section apply different settings to the same noise record (UT.STN11.A2_C50.miniseed). For brevity, the default settings are listed in the Default Settings section, with only the variations from these settings noted for each example.

Default Settings

  • Window Length: 60 seconds
  • Bandpass Filter Boolean: False
  • Cosine Taper Width: 10% (i.e., 5% in Geopsy)
  • Konno and Ohmachi Smoothing Coefficient: 40
  • Resampling:
    • Minimum Frequency: 0.3 Hz
    • Maximum Frequency: 40 Hz
    • Number of Points: 2048
    • Sampling Type: 'log'
  • Method for Combining Horizontal Components: 'squared-average'
  • Distribution for f0 from Time Windows: 'normal'
  • Distribution for Mean Curve: 'log-normal'

Single Window Results

Default Case: No variation from those settings listed above.

Window Length: 120 seconds.

Cosine Taper Width: 20 % (i.e., 10 % in Geopsy)

Cosine Taper Width: 0.2 % (i.e., 0.1 % in Geopsy)

Konno and Ohmachi Smoothing Coefficient: 10

Konno and Ohmachi Smoothing Coefficient: 80

Number of Points: 512

Number of Points: 4096

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

hvsrpy-0.4.1.tar.gz (49.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

hvsrpy-0.4.1-py3-none-any.whl (44.2 kB view details)

Uploaded Python 3

File details

Details for the file hvsrpy-0.4.1.tar.gz.

File metadata

  • Download URL: hvsrpy-0.4.1.tar.gz
  • Upload date:
  • Size: 49.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/42.0.2 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.7.5

File hashes

Hashes for hvsrpy-0.4.1.tar.gz
Algorithm Hash digest
SHA256 b8dc8b43940e6e4373a689bae74a70d20c403e77a1507857adea16f3e08d5ea3
MD5 66208811991be00abc913cb473f034d7
BLAKE2b-256 4fdc2ee818d8ed285e897e8d4abe8366a88e701bc64e0563b614ed7da7ac7652

See more details on using hashes here.

File details

Details for the file hvsrpy-0.4.1-py3-none-any.whl.

File metadata

  • Download URL: hvsrpy-0.4.1-py3-none-any.whl
  • Upload date:
  • Size: 44.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/42.0.2 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.7.5

File hashes

Hashes for hvsrpy-0.4.1-py3-none-any.whl
Algorithm Hash digest
SHA256 2e8159e6fd2df1f46c10c838ba51657949fc4f0f04688262137b6d0903bf47d1
MD5 4472ea5643333e00f351caebe2c0bb7d
BLAKE2b-256 ab188ded19ed1cb292fa184ec2a82cf402f3fa54eb55ec8e2c57fc10bd5ad747

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page