{"id":17987462,"url":"https://github.com/miili/pysurf96","last_synced_at":"2025-04-05T14:03:43.304Z","repository":{"id":72852906,"uuid":"158565132","full_name":"miili/pysurf96","owner":"miili","description":"Python wrapper for modelling surface wave dispersion curves from surf96 - Computer Programs in Seismology, R. Hermann","archived":false,"fork":false,"pushed_at":"2024-12-06T13:45:03.000Z","size":23,"stargazers_count":64,"open_issues_count":1,"forks_count":21,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-29T13:05:25.150Z","etag":null,"topics":["dispersion","geophysics","python","seismology","surf96"],"latest_commit_sha":null,"homepage":"https://pyrocko.org","language":"Fortran","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/miili.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-11-21T15:02:04.000Z","updated_at":"2025-03-24T12:22:39.000Z","dependencies_parsed_at":null,"dependency_job_id":"6f7c4b85-c74e-4eb6-ae37-247bf8729025","html_url":"https://github.com/miili/pysurf96","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/miili%2Fpysurf96","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/miili%2Fpysurf96/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/miili%2Fpysurf96/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/miili%2Fpysurf96/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/miili","download_url":"https://codeload.github.com/miili/pysurf96/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247345850,"owners_count":20924102,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["dispersion","geophysics","python","seismology","surf96"],"created_at":"2024-10-29T19:08:54.759Z","updated_at":"2025-04-05T14:03:43.273Z","avatar_url":"https://github.com/miili.png","language":"Fortran","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PySurf96\n\n[![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)\n[![Python 3.10+](https://img.shields.io/badge/Python-3.10+-blue.svg)](https://python.org/)\n\n_Modelling Surface Wave Dispersion Curves_\n\nThis is a slim wrapper around the program `surf96` from _Computer programs in seismology_ by R. Hermann (\u003chttp://www.eas.slu.edu/eqc/eqccps.html\u003e) for forward modelling of Rayleigh and Love wave dispersion curves.\n\nIn this implementation the Fortran77 code is wrapped by `f2py`, which makes the forward computation approximately **8x faster** compared over calling a Python subprocess.\n\nMore useful software for seismology at \u003chttps://pyrocko.org\u003e.\n\n## Installation\n\nThis package is for Python 3.\n\nPrerequisits is a Fortran77 compiler, like GNU GCC.\n\n```\npip install .\n```\n\nOr through pip:\n\n```\npip install git+https://github.com/miili/pysurf96\n```\n\n## Documentation\n\nEssentially this is a single function, `surf96`. Here is the docstring:\n\n```\nCalculate synthetic surface wave dispersion curves for a given earth model, wave type and periods.\n\nThis is a slim Fortran wrapper around surf96 from Computer Programs in Seismology from R. Hermann (2013)\n\nArgs:\n    thickness (np.ndarray): Layer thickness in kilometers.\n    vp (np.ndarray): Layer Vp velocity.\n    vs (np.ndarray): Layer Vs velocity.\n    rho (np.ndarray): Layer density in g/m^3.\n    periods (np.ndarray): The periods in seconds, where wave velocity is calculated\n    wave (WaveType, optional): The wave type, \"love\" or \"rayleigh\". Defaults to \"love\".\n    mode (int, optional): Mode of the wave, 1: fundamental, 2: second-mode, etc... Defaults to 1.\n    velocity (Velocity, optional): \"group\" or \"phase\" velocity. Defaults to \"group\".\n    flat_earth (bool, optional): Assume a flat earth. Defaults to True.\nRaises:\n    ValueError: Raised when input values are unexpected.\n    Surf96Error: If surf96 fortran code raises an error,\n        this may be due to low velocity zone.\nReturns:\n    np.ndarray: The surface wave velocities at defined periods.\n```\n\n## Example\n\n```python\nimport numpy as np\nfrom pysurf96 import surf96\n\n# Define the velocity model in km and km/s\nthickness = np.array([5.0, 23.0, 8.0, 0])\nvs = np.array([2, 3.6, 3.8, 3.3])\nvp = vs * 1.73\nrho = vp * 0.32 + 0.77\n\n# Periods we are interested in\nperiods = np.linspace(1.0, 20.0, 20)\n\nvelocities = surf96(\n    thickness,\n    vp,\n    vs,\n    rho,\n    periods,\n    wave=\"love\",\n    mode=1,\n    velocity=\"group\",\n    flat_earth=True,\n\n```\n\n## Citations and Acknowledgments\n\n\u003e Herrmann, R. B. (2013) Computer programs in seismology: An evolving tool for instruction and research, Seism. Res. Lettr. 84, 1081-1088, doi:10.1785/0220110096\n\nThanks to Hongjian Fang for creating the Fortran subroutine (\u003chttps://github.com/caiweicaiwei/SurfTomo\u003e)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmiili%2Fpysurf96","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmiili%2Fpysurf96","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmiili%2Fpysurf96/lists"}