NumPy 和 SciPy 这两个 Python 库是十分强大的数值处理和分析工具,适用于多种应用程序。我们开发了一个 Python 库 ObsPy(http://obspy.org),目的是使地震学软件包和工作流程的发展更为便利,也利用这些功能为地震学进入更大的科学 Python 生态系统建桥铺路。许多领域的科学家希望转化他们现有的工具和程序,以便能够利用 Py-thon 所提供的这类平台环境,但是经常遇到下述困扰,例如特殊的文件格式、未知的专业术语,以及找不到合适的办法来替代软件中的某一个重要功能。我们提出一种方案,即在科学的 NumPy 包上层实现特定领域的时间序列库。据此,我们显示了一个时间序列数据的内部抽象表现的具体化实现,它能支持各种不同文件格式的读写。随后我们仔细描述了已充分发挥作用的旧代码的集成与改造,使它们能够在 Python 编写的现代工作流程之中继续发挥作用。最后我们举例研究如何将科研代码整合到 ObsPy 中,使其受众更为广泛。虽然本文给出的例子针对的是地震学,但是其中许多概念和抽象方法都可以直接应用于其他学科,特别是那些重点放在时间序列分析上的学科。
The Python libraries NumPy and SciPy are extremely powerful tools for numerical processing and analysis well suited to a large variety of applications. We developed ObsPy (http://obspy.org), a Python library for seismology intended to facilitate the development of seismological software packages and workflows, to utilize these abilities and provide a bridge for seismology into the larger scientific Python ecosystem. Scientists in many domains who wish to convert their existing tools and applications to take advantage of a platform like the one Python provides are confronted with several hurdles such as special file formats, unknown terminology, and no suitable replacement for a non-trivial piece of software. We present an approach to implement a domain-specific time series library on top of the scientific NumPy stack. In so doing, we show a realization of an abstract internal representation of time series data permitting I/O support for a diverse collection of file formats. Then we detail the integration and repurposing of well established legacy codes, enabling them to be used in modern workflows composed in Python. Finally we present a case study on how to integrate research code into ObsPy, opening it to the broader community. While the implementations presented in this work are specific to seismology, many of the described concepts and abstractions are directly applicable to other sciences, especially to those with an emphasis on time series analysis.
Research Article| May 01, 2013 ObsPyLoad: A Tool for Fully Automated Retrieval of Seismological Waveform Data Chris Scheingraber; Chris Scheingraber aDepartment of Earth and Environmental Sciences, Ludwig‐Maximilians‐Universität München, Theresienstrasse 41, 80333 Munich, Germanychris@scheingraber.nethosseini@geophysik.uni-muenchen.desigloch@geophysik.uni-muenchen.de Search for other works by this author on: GSW Google Scholar Kasra Hosseini; Kasra Hosseini aDepartment of Earth and Environmental Sciences, Ludwig‐Maximilians‐Universität München, Theresienstrasse 41, 80333 Munich, Germanychris@scheingraber.nethosseini@geophysik.uni-muenchen.desigloch@geophysik.uni-muenchen.de Search for other works by this author on: GSW Google Scholar Robert Barsch; Robert Barsch bEGU Executive Office, Luisenstr. 37, 80333 Munich, Germanybarsch@egu.eu Search for other works by this author on: GSW Google Scholar Karin Sigloch Karin Sigloch aDepartment of Earth and Environmental Sciences, Ludwig‐Maximilians‐Universität München, Theresienstrasse 41, 80333 Munich, Germanychris@scheingraber.nethosseini@geophysik.uni-muenchen.desigloch@geophysik.uni-muenchen.de Search for other works by this author on: GSW Google Scholar Author and Article Information Chris Scheingraber aDepartment of Earth and Environmental Sciences, Ludwig‐Maximilians‐Universität München, Theresienstrasse 41, 80333 Munich, Germanychris@scheingraber.nethosseini@geophysik.uni-muenchen.desigloch@geophysik.uni-muenchen.de Kasra Hosseini aDepartment of Earth and Environmental Sciences, Ludwig‐Maximilians‐Universität München, Theresienstrasse 41, 80333 Munich, Germanychris@scheingraber.nethosseini@geophysik.uni-muenchen.desigloch@geophysik.uni-muenchen.de Robert Barsch bEGU Executive Office, Luisenstr. 37, 80333 Munich, Germanybarsch@egu.eu Karin Sigloch aDepartment of Earth and Environmental Sciences, Ludwig‐Maximilians‐Universität München, Theresienstrasse 41, 80333 Munich, Germanychris@scheingraber.nethosseini@geophysik.uni-muenchen.desigloch@geophysik.uni-muenchen.de Publisher: Seismological Society of America First Online: 09 Mar 2017 Online ISSN: 1938-2057 Print ISSN: 0895-0695 © 2013 by the Seismological Society of America Seismological Research Letters (2013) 84 (3): 525–531. https://doi.org/10.1785/0220120103 Article history First Online: 09 Mar 2017 Cite View This Citation Add to Citation Manager Share Icon Share Facebook Twitter LinkedIn MailTo Tools Icon Tools Get Permissions Search Site Citation Chris Scheingraber, Kasra Hosseini, Robert Barsch, Karin Sigloch; ObsPyLoad: A Tool for Fully Automated Retrieval of Seismological Waveform Data. Seismological Research Letters 2013;; 84 (3): 525–531. doi: https://doi.org/10.1785/0220120103 Download citation file: Ris (Zotero) Refmanager EasyBib Bookends Mendeley Papers EndNote RefWorks BibTex toolbar search Search Dropdown Menu toolbar search search input Search input auto suggest filter your search All ContentBy SocietySeismological Research Letters Search Advanced Search We confront the data avalanche: the amount of waveform data available from seismological data centers has been growing enormously over the past few years. This is a highly welcome development from a scientific point of view, but the time and effort spent on identification, retrieval, and quality control of subsets of these data may quickly exceed tolerable limits for an individual researcher. Data from different data centers may not be available through the same interfaces or may arrive in different formats, which have tended to change over time. This often results in time‐consuming homogenization efforts. The situation has improved in... You do not have access to this content, please speak to your institutional administrator if you feel you should have access.
ObsPy: The Python toolbox for seismology (http://www.obspy.org) aims at filling the gap between interactive analysis and automatic data acquisition systems. Automatic batch analysis of continuous data streams or feeding a so far unknown formatted data stream into an acquisition system are two possible applications. Python provides a platform independent, free and open source interpreter language including a large collection of scientific open-source modules thus allowing rapid development of prototype code. ObsPy extends Python by providing the seismologist with basic seismological routines, e.g. MiniSEED, SAC, GSE2 read and write support, various pickers, filters, instrument correction, extended display routines... The data itself is stored in numpy.ndarrays allowing powerful numerical array-programming modules like NumPy (http://numpy.scipy.org) or SciPy (http://scipy.org) to be used. 1 Unified Read and Write Support ObsPy provides unified access to read and write seismograms formated as GSE2, MiniSEED, SAC, SEISAN, Seismic Handler formats Q and ASCII. In this respect all data are saved into a stream object. >>> from obspy . core import read >>> st = read ( my_mseed_file ) >>> st . wr i t e ( my_sac_file , format=SAC ) Simple MiniSEED to SAC Converter The stream object consists of multiple trace objects itself. Thus it is similar to a MiniSEED or GSE2 volume where multiple data records are stored in a single file. These separate data records are each one trace object. The header attributes of the first trace (tr = st[0]) can be addressed by the tr.stats object (e.g. tr.stats.sampling_rate). The attribute tr.data contains the data as a numpy.ndarray object (array-programming). Thus the data can be further processed by standard Python, NumPy, SciPy, matplotlib or ObsPy routines or easily passed via the python ctypes library to any shared C or FORTRAN library. O bs P y miniseed gse2 sac seisan sh-Q sh-ascii miniseed gse2 sac sh-Q sh-ascii 2 ArcLink, Fissures, Seishub The ArcLink module makes it possible to automatically access the data via ArcLink or for testing the servers functionality. The following example shows how to retrieve data via ArcLink. >>> from obspy . core import UTCDateTime >>> from obspy . a r c l i n k . c l i e n t import Cl i en t >>> >>> c l i e n t = Cl i en t ( webdc . eu , 18001) >>> s t a r t = UTCDateTime( 2009−08−20 04 : 03 : 12 ) >>> st = c l i e n t . getWaveform ( BW , RJOB , , EH∗ , s t a r t − 3 , s t a r t + 15) In a similar way ObsPy provides an interface to the database SeisHub (an in house development [1]) and to the FISSURES protocol (DHI) of IRIS. ObsPy — Processing SeisHub ArcLink Fissures/DHI
Data acquisition by seismic centers relies on real-time systems, like SeisComP3, Antelope and Earthworm. However, these are complex systems that are designed for fast and precisely defined standard real-time analyses. Therefore, it is not a simple task to access or modify internal routines, and to integrate them into custom-processing workflows or to perform in-depth data analyses. Often a library is necessary that provides convenient access to data and allows easy control over all of the operations that are to be performed on the data. ObsPy is such a library, which is designed to access and process seismological waveform data and metadata. We use short and simple examples here to demonstrate how effective it is to use Python for seismological data analysis. Then, we illustrate the general capabilities of ObsPy, and highlight some of its specific aspects that are relevant for seismological data centers and observatories, through presentation of real-world examples. Finally, we demonstrate how the ObsPy library can be used to develop custom graphical user interface applications.
Research Article| May 01, 2010 ObsPy: A Python Toolbox for Seismology Moritz Beyreuther; Moritz Beyreuther Department of Earth and Environmental Sciences Geophysical Observatory Ludwig Maximilians Universität München Munich, Germany moritz.beyreuther@geophysik.uni-muenchen.de (M. B.) 1Department of Earth and Environmental Sciences, Geophysical Observatory, Ludwig Maximilians Universität München, Germany Search for other works by this author on: GSW Google Scholar Robert Barsch; Robert Barsch Department of Earth and Environmental Sciences Geophysical Observatory Ludwig Maximilians Universität München Munich, Germany moritz.beyreuther@geophysik.uni-muenchen.de (M. B.) 1Department of Earth and Environmental Sciences, Geophysical Observatory, Ludwig Maximilians Universität München, Germany Search for other works by this author on: GSW Google Scholar Lion Krischer; Lion Krischer Department of Earth and Environmental Sciences Geophysical Observatory Ludwig Maximilians Universität München Munich, Germany moritz.beyreuther@geophysik.uni-muenchen.de (M. B.) 1Department of Earth and Environmental Sciences, Geophysical Observatory, Ludwig Maximilians Universität München, Germany Search for other works by this author on: GSW Google Scholar Tobias Megies; Tobias Megies Department of Earth and Environmental Sciences Geophysical Observatory Ludwig Maximilians Universität München Munich, Germany moritz.beyreuther@geophysik.uni-muenchen.de (M. B.) 1Department of Earth and Environmental Sciences, Geophysical Observatory, Ludwig Maximilians Universität München, Germany Search for other works by this author on: GSW Google Scholar Yannik Behr; Yannik Behr Department of Earth and Environmental Sciences Geophysical Observatory Ludwig Maximilians Universität München Munich, Germany moritz.beyreuther@geophysik.uni-muenchen.de (M. B.) 2School of Geography, Environment, and Earth Sciences, Victoria University of Wellington, New Zealand Search for other works by this author on: GSW Google Scholar Joachim Wassermann Joachim Wassermann Department of Earth and Environmental Sciences Geophysical Observatory Ludwig Maximilians Universität München Munich, Germany moritz.beyreuther@geophysik.uni-muenchen.de (M. B.) 1Department of Earth and Environmental Sciences, Geophysical Observatory, Ludwig Maximilians Universität München, Germany Search for other works by this author on: GSW Google Scholar Author and Article Information Moritz Beyreuther 1Department of Earth and Environmental Sciences, Geophysical Observatory, Ludwig Maximilians Universität München, Germany Department of Earth and Environmental Sciences Geophysical Observatory Ludwig Maximilians Universität München Munich, Germany moritz.beyreuther@geophysik.uni-muenchen.de (M. B.) Robert Barsch 1Department of Earth and Environmental Sciences, Geophysical Observatory, Ludwig Maximilians Universität München, Germany Department of Earth and Environmental Sciences Geophysical Observatory Ludwig Maximilians Universität München Munich, Germany moritz.beyreuther@geophysik.uni-muenchen.de (M. B.) Lion Krischer 1Department of Earth and Environmental Sciences, Geophysical Observatory, Ludwig Maximilians Universität München, Germany Department of Earth and Environmental Sciences Geophysical Observatory Ludwig Maximilians Universität München Munich, Germany moritz.beyreuther@geophysik.uni-muenchen.de (M. B.) Tobias Megies 1Department of Earth and Environmental Sciences, Geophysical Observatory, Ludwig Maximilians Universität München, Germany Department of Earth and Environmental Sciences Geophysical Observatory Ludwig Maximilians Universität München Munich, Germany moritz.beyreuther@geophysik.uni-muenchen.de (M. B.) Yannik Behr 2School of Geography, Environment, and Earth Sciences, Victoria University of Wellington, New Zealand Department of Earth and Environmental Sciences Geophysical Observatory Ludwig Maximilians Universität München Munich, Germany moritz.beyreuther@geophysik.uni-muenchen.de (M. B.) Joachim Wassermann 1Department of Earth and Environmental Sciences, Geophysical Observatory, Ludwig Maximilians Universität München, Germany Department of Earth and Environmental Sciences Geophysical Observatory Ludwig Maximilians Universität München Munich, Germany moritz.beyreuther@geophysik.uni-muenchen.de (M. B.) Publisher: Seismological Society of America First Online: 09 Mar 2017 Online ISSN: 1938-2057 Print ISSN: 0895-0695 © 2010 by the Seismological Society of America Seismological Research Letters (2010) 81 (3): 530–533. https://doi.org/10.1785/gssrl.81.3.530 Article history First Online: 09 Mar 2017 Cite View This Citation Add to Citation Manager Share Icon Share Facebook Twitter LinkedIn Email Permissions Search Site Citation Moritz Beyreuther, Robert Barsch, Lion Krischer, Tobias Megies, Yannik Behr, Joachim Wassermann; ObsPy: A Python Toolbox for Seismology. Seismological Research Letters 2010;; 81 (3): 530–533. doi: https://doi.org/10.1785/gssrl.81.3.530 Download citation file: Ris (Zotero) Refmanager EasyBib Bookends Mendeley Papers EndNote RefWorks BibTex toolbar search Search Dropdown Menu toolbar search search input Search input auto suggest filter your search All ContentBy SocietySeismological Research Letters Search Advanced Search The wide variety of computer platforms, file formats, and methods to access seismological data often requires considerable effort in preprocessing such data. Although preprocessing work-flows are mostly very similar, few software standards exist to accomplish this task. The objective of ObsPy is to provide a Python toolbox that simplifies the usage of Python programming for seismologists. It is conceptually similar to SEATREE (Milner and Thorsten 2009) or the exploration seismic software project MADAGASCAR (http://www.reproducibility.org). In ObsPy the following essential seismological processing routines are implemented and ready to use: reading and writing data only SEED/MiniSEED and Dataless... You do not have access to this content, please speak to your institutional administrator if you feel you should have access.
The success of volcano fast response systems including early warning of an imminent eruption lives through its connection capability to already installed monitoring systems. Also new temporary, possible wireless networks as well as combination of different raw and model data needs to be covered. In practice this means a high-dimensional, complicated (raw or already parameterised) data stream with different sampling rates and time histories that have to be stored and analysed. In the framework of the Exupery project (GEOTECHNOLOGIEN, German Ministry for Education and Research BMBF) the SeisHub Database handles multi-parameter data resulting from modern volcano monitoring networks simultaneously. This is a quite common situation today in order to assess volcanic activity. The warning system, here a GIS and an automatic alert level estimation, connects to the data base to retrieve the relevant information. The GIS provides access to the data as well as analysis results. By overlaying various parameters in the GIS systems the expert can analyse the situation and base his/her decision easily on multi-parameter data. In addition to data interactive visualization via the GIS the alert level of the volcano is automatically estimated using a Bayesian Belief Network (BBN) approach. This allows the expert to verify his own assessment versus the automatic system. In case there are major differences, the expert can identify the origin of the difference in the graphical representation of the BBN and if necessary adapt the BBN. BBNs are chosen because of their transparency (graphical representation), flexibility, probabilistic architecture and their possibility to incorporate expert knowledge. The probabilistic architecture allows to compute a confidence measure for the given alert level. A high, automatically estimated alert level with either high or low confidence can certainly lead to different decisions by the human interpreter.
A mobile volcano fast response system (VFRS) that can be used for volcano monitoring in case of volcanic unrest anywhere in the world is currently under development in Germany. The main goal of the project called Exupery is to provide the communication technology for stations in the field and an expert system that collects all data from various sources, assembles them in a database, and allows users to assess the data through one common web GIS interface. The system also includes an integrated automatic alert level including the alert level estimation in order to characterize the activity state of the volcano. The web GIS interface serves as a decision support system to assist scientists and local authorities in deciding how to react in the case of volcanic unrest.
Seismic databases and processing tools currently available are mainly limited to classic three-component seismic recordings and cannot handle collocated multi-component, multi-disciplinary datasets easily. Further, these seismological databases depend on event-related data and are not able to manage state of the art continuous waveform data input as well. None of them allows for automated request of data available at seismic data centers or to share specific data to users outside one institute. Some seismic databases even depend on licensed database engines, which contradicts the open source character of most software packages used in seismology. This study intends to provide a suitable answer to the deficiencies of existing seismic databases. SeisHub is a novel web-based database approach created for archiving, processing, and sharing geophysical data and meta data (data describing data), particularly adapted for seismic data. The implemented database prototype offers the full functionality of a native XML database combined with the versatility of a RESTful Web service. The XML database itself uses a standard relational database as back-end, which is currently tested with PostgreSQL (http://www.postgres.org) and SQLite (http://www.sqlite.org). This sophisticated structure allows for the usage of both worlds: on the one hand the power of the SQL for querying and manipulating data, and one the other hand the freedom to use any standard connected to XML, e.g. document conversion via XSLT (Extensible Stylesheet Language Transformations) or resource validation via XSD (XML Schema). The actual resources and any additional services are available via fixed Uniform Resource Identifiers (URIs), where as the database back-end stores the original XML documents and all related indexed values. Indexes are generated using the XPath language and may be added at any time during runtime. This flexibility of the XML/SQL mixture introduced above enables the user to include parameters or results as well as meta data from additional or yet unknown monitoring techniques at any time. SeisHub also comprises features of a “classical seismic database” providing direct access to continuous seismic waveform data and associated meta data. Additionally, SeisHub offers various access protocols (HTTP/HTTPS, SFTP, SSH), an extensible plug-in system, user management, and a sophisticated web-based administration front-end. The SeisHub database is an open source project and the latest development release can be downloaded via the project home page http://www.seishub.org. The SeisHub database has already been deployed as central database component within two scientific projects: Exupery (http://www.exupery-vfrs.de), a mobile Volcano Fast Response System (VFRS), and BayernNetz, the seismological network of the Bavarian Seismological Service (Erdbebendienst Bayern; http://www.erdbeben-in-bayern.de).
Computational methodologies play an increasingly important role in Earth sciences. However, Earth science curricula in general often do not equip scientists with the necessary background in mathematical and computational aspects of the rapidly expanding field of simulation technology.This lack of preparation applies in particular to the field of computational seismology. Despite the fact that the same numerical methodologies (e.g., finite differences, finite/spectral elements) are used in various domains (e.g., exploration seismics, volcanology, global seismology, earthquake physics), there often has been little interaction and exchange of experiences among researchers working in these different domains.