obspy | Python Toolbox for seismology/seismological observatories | Audio Utils library

 by   obspy Python Version: 1.4.1 License: Non-SPDX

kandi X-RAY | obspy Summary

kandi X-RAY | obspy Summary

obspy is a Python library typically used in Audio, Audio Utils applications. obspy has no bugs, it has no vulnerabilities, it has build file available and it has medium support. However obspy has a Non-SPDX License. You can install using 'pip install obspy' or download it from GitHub, PyPI.

ObsPy is an open-source project dedicated to provide a Python framework for processing seismological data. It provides parsers for common file formats, clients to access data centers and seismological signal processing routines which allow the manipulation of seismological time series (see Beyreuther et al. 2010, Megies et al. 2011, Krischer et al. 2015). The goal of the ObsPy project is to facilitate rapid application development for seismology. ObsPy is licensed under the GNU Lesser General Public License (LGPL) v3.0. A one-hour introduction to ObsPy is available at YouTube.
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              obspy has a medium active ecosystem.
              It has 1036 star(s) with 517 fork(s). There are 107 watchers for this library.
              There were 1 major release(s) in the last 6 months.
              There are 167 open issues and 1514 have been closed. On average issues are closed in 269 days. There are 89 open pull requests and 0 closed requests.
              It has a neutral sentiment in the developer community.
              The latest version of obspy is 1.4.1

            kandi-Quality Quality

              obspy has 0 bugs and 0 code smells.

            kandi-Security Security

              obspy has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
              obspy code analysis shows 0 unresolved vulnerabilities.
              There are 0 security hotspots that need review.

            kandi-License License

              obspy has a Non-SPDX License.
              Non-SPDX licenses can be open source with a non SPDX compliant license, or non open source licenses, and you need to review them closely before use.

            kandi-Reuse Reuse

              obspy releases are available to install and integrate.
              Deployable package is available in PyPI.
              Build file is available. You can build the component from source.
              Installation instructions, examples and code snippets are available.
              It has 177002 lines of code, 5295 functions and 722 files.
              It has high code complexity. Code complexity directly impacts maintainability of the code.

            Top functions reviewed by kandi - BETA

            kandi has reviewed obspy and discovered the below as its top functions. This is intended to give you an instant insight into obspy implemented functionality, and help decide if they suit your requirements.
            • Return the response for a channel .
            • Compute the rotation of an array .
            • Parse the name of the leg .
            • Call Evalresp for given frequencies .
            • Write a MSE file .
            • Extract flags from multiple files .
            • Read a M seed file .
            • Plot a matplotlib matrix .
            • Collect data from the seed link .
            • Create an EventType subclass .
            Get all kandi verified functions for this library.

            obspy Key Features

            No Key Features are available at this moment for obspy.

            obspy Examples and Code Snippets

            copy iconCopy
            s = str (time.split (":")[2])   # second
            
            s = open (stationlist, "r")
            
            from pathlib import Path
            from obspy import UTCDateTime
            
            data_dir = Path('/home/alireza/Desktop/Saman/Eqcomplete')
            home_d
            Pandas read_csv() and dtype doubts
            Pythondot img2Lines of Code : 6dot img2License : Strong Copyleft (CC BY-SA 4.0)
            copy iconCopy
            DF = pd.read_csv(kat, sep=',', usecols=(['YYYY', 'LAT', 'LON', 'DEPTH', 'ML']))
            
            new_data['YYYY'].unique()
            
            new_data[new_data['YYYY'] == 'YYYY']
            
            Problem plotting spectrogram colorbar in matplotlib
            Pythondot img3Lines of Code : 24dot img3License : Strong Copyleft (CC BY-SA 4.0)
            copy iconCopy
            fig, (ax1, ax2, ax3) = plt.subplots(3, sharex=True)
            ax1.plot(time, data1[0].data)
            ax2.plot(time, data2.data)
            spec = data2.spectrogram(axes=ax3,  # <-- Assign a name.
                                     show=True,
                                     samp_rate
            Cant read content from a specific .CSV file using pandas
            Pythondot img4Lines of Code : 34dot img4License : Strong Copyleft (CC BY-SA 4.0)
            copy iconCopy
            # using some random seperator to get the entire row as one column
            df = pd.read_csv("coordinates.csv", sep="!", header=None)
            df.columns = ['coord']
            
            # added separate columns will blanks for lat and lon (I assumed them to be lat and lon)
            df[
            Matplotlib plot x axis (data file datetime)
            Pythondot img5Lines of Code : 7dot img5License : Strong Copyleft (CC BY-SA 4.0)
            copy iconCopy
            def pushButtonClicked(self):
                pathfile, _ = QFileDialog.getOpenFileName(self)
                if pathfile:
                    fname = basename(pathfile)
                    data = read(fname)
                    data.plot(fig=self.fig)
            
            loop to read multiple files
            Pythondot img6Lines of Code : 16dot img6License : Strong Copyleft (CC BY-SA 4.0)
            copy iconCopy
            import glob, os
            def save_fig(in_file_name, out_file_name):
                line_1 = _read_segy(in_file_name)
                data = np.stack(t.data for t in line_1.traces)
                vm = np.percentile(data, 99)
                plt.figure(figsize=(60, 30))
                plt.imshow(data.T, cm
            loop to read multiple files
            Pythondot img7Lines of Code : 14dot img7License : Strong Copyleft (CC BY-SA 4.0)
            copy iconCopy
            files = ['st1.segy', 'st2.segy']
            lines = {} # creates an empty dictionary; dictionaries consist of key: value pairs
            for f in files: # f will first be 'st1.segy', then 'st2.segy'
                lines[f] = read_segy(f)
            
            lines = 
            Reducing time and memory used in loop calculation when locating earthquakes
            Pythondot img8Lines of Code : 15dot img8License : Strong Copyleft (CC BY-SA 4.0)
            copy iconCopy
            for i in range(len(di)):
                try:
                    tt.append((latot[i],lotot[i],traveltime(dia[i])-traveltime(dib[i])))
                except IndexError:
                    continue
            
            /* This over-allocates proportional to the list size, making ro
            Using obspy.taup with variables obtained from a .txt file
            Pythondot img9Lines of Code : 7dot img9License : Strong Copyleft (CC BY-SA 4.0)
            copy iconCopy
            a = float(columna[0])
            b = float(columna[1])
            c = float(columna[2])
            d = float(columna[3])
            e = float(columna[4])
            
            
            copy iconCopy
                  For example:
            
                     port select --summary
                     port select --show python
                     port select --list python
                     port select --set python python34
            
            port select --summary
            
            sud

            Community Discussions

            QUESTION

            Meshgrid, not enough values to unpack (expected 2,got 1)
            Asked 2022-Feb-21 at 07:58

            maybe it will be a very basic question for the experts but I am just a beginner. I have multiple time series signals from different distances. I plotted all time series data with the help of the plt.plot command as given in the below script.

            ...

            ANSWER

            Answered 2022-Feb-21 at 07:58

            Do not worry about being a beginner, good that you ask questions. It will help others in similar situation as you.

            Regarding your question, it would be really helpful with a minimum working example so that we can investigate our selves. Which version of matplotlib are you running (matplotlib.__version__)? What shapes do xarray, yarray, and zarray have?

            I can reproduce your error with a modified example from the matplotlib docs gallery (here https://matplotlib.org/stable/gallery/images_contours_and_fields/pcolormesh_levels.html). If I run

            Source https://stackoverflow.com/questions/71202585

            QUESTION

            TypeError: int() argument must be a string, a bytes-like object or a number, not '_io.TextIOWrapper'
            Asked 2021-Oct-18 at 02:56

            I am trying to read a text file line by line as integers. I did every suggestion I saw here but none works for me. here is the code I'm using. It reads some seismic data from the datadir and evaluates the SNR ratio to decide whether keep the data or remove it. To do so, I need to calculate the distance between stations and the earthquake which the info comes from input files.

            ...

            ANSWER

            Answered 2021-Oct-18 at 02:56

            QUESTION

            Pandas read_csv() and dtype doubts
            Asked 2021-Aug-06 at 03:16

            I have a set of bulletins in txt format, those have some chunky (big header, tails, etc) data that I was able "to clean up" them using pandas. Then I had to append all DataFrames in a new one DataFrame in order to have a new file, because I need to process about 10 year of data, so the code is:

            ...

            ANSWER

            Answered 2021-Aug-05 at 21:46

            Your code works well with your two files 1988.txt et 1989.txt. To debug, I propose to remove the cast from read_csv:

            Source https://stackoverflow.com/questions/68673517

            QUESTION

            how to set the order of zero-phase bandpass filter in obspy
            Asked 2021-May-20 at 03:22

            I have a question about setting the order of zero-phase bandpass filter in obspy.

            I want to apply a 2nd order zero-phase filter, with corner frequencies of 0.05Hz and 0.1Hz.

            I think it's right to type 'st.filter('bandpass', freqmin=0.05, freqmax=0.1, corners=2, zerophase=True)'.

            However, I am a little bit confused since it is written that setting 'zerophase=True' results in twice the filter order according to the link below.

            https://docs.obspy.org/_modules/obspy/signal/filter.html

            So I want to ask if it is correct to set 'corners=2' or 'corners=1' or etc in my case.

            It will be a great help to me if anyone gives an answer.

            Thank you.

            ...

            ANSWER

            Answered 2021-May-20 at 03:17

            You should specify corners = 1.

            The way a zero-phase filter is implemented is to run the data through the filter twice, once forwards and once backwards. This results in double the magnitude response but cancels out the phase response. Therefore, if you expect 12 dB/octave attenuation in the stopbands, as in a normal 2nd-order filter, then specify corners = 1. This will result in 6 dB/octave attenuation on the forward pass, then another 6 dB/octave on the backwards pass.

            Source https://stackoverflow.com/questions/67597064

            QUESTION

            Filename coming from other files in same folder
            Asked 2020-Aug-07 at 10:21

            I have a folder with seismogram files. Its format correspont to particle movement in three dimensions (HHE correponds to E-W, HHN correponds to N-S and HHZ corrsponds to vertical particle movement). The script to merge these three components in a file is the following:

            ...

            ANSWER

            Answered 2020-Aug-06 at 17:03
            import os
            path_folder = r"D:\test"
            
            # get list of all files in folder which end on .sac
            lst_of_filenames = [name for name in os.listdir(path_folder) if (name.endswith(".sac")]
            # only get a unqiue filename without any ending
            # r"" means raw string
            lst_of_filenames_cleaned = [name.rstrip(r".HHE.sac").rstrip(r".HHN.sac").rstrip(r".HHZ.sac") for name in lst_of_filenames]
            # get each filename only once (remove duplicates)
            lst_of_filenames_cleaned = list(set(lst_of_filenames_cleaned))
            

            Source https://stackoverflow.com/questions/63284947

            QUESTION

            Matplotlib plot x axis (data file datetime)
            Asked 2020-Apr-02 at 05:29

            I am going to display a figure graph using Python's GUI. GUI code and general code are applied differently (x-axis). I haven't put any options specifically in the plot, but the cause is unknown. Using obspy module, it is simple code to load mseed file which is earthquake data format and display graph. So far, in order to put the x-axis as the datetime, I tried using the 'arange' function and the 'for in' function to put it in the plot, but the GUI program does not run normally and ends. The problem is that the plot is normally plotted, but the x-axis is displayed as the sample rate of the data, not time.

            The full code looks like this:

            ...

            ANSWER

            Answered 2020-Apr-01 at 07:48

            Instead of creating a new ax it is necessary to just pass the Figure to the plot method:

            Source https://stackoverflow.com/questions/60964625

            QUESTION

            loop to read multiple files
            Asked 2020-Mar-05 at 11:37

            I am using Obspy _read_segy function to read a segy file using following line of code:

            ...

            ANSWER

            Answered 2020-Mar-05 at 11:37

            I'll focus on addressing the file looping, as you said you're new and I'm assuming simple loops are something you'd like to learn about (the first example is sufficient for this).

            If you'd like an answer to your second question, it might be worth providing some example data, the output result (graph) of your current attempt, and a description of your desired output. If you provide that reproducible example and clear description of the problem you're having it'd be easier to answer.

            Create a list (or other iterable) to hold the file names to read, and another container (maybe a dict) to hold the result of your read_segy.

            Source https://stackoverflow.com/questions/60543605

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install obspy

            Installation instructions can be found in the wiki.
            Read about how to get started in the wiki and in our Tutorial section in the documentation. ObsPy Tutorial notebooks -- and much more on specific seismology topics -- can also be found on Seismo-Live, both as a static preview and as interactively runnable version.

            Support

            The detailed changelog is available here, our docs can be found at docs.obspy.org.
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            Install
          • PyPI

            pip install obspy

          • CLONE
          • HTTPS

            https://github.com/obspy/obspy.git

          • CLI

            gh repo clone obspy/obspy

          • sshUrl

            git@github.com:obspy/obspy.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link

            Explore Related Topics

            Consider Popular Audio Utils Libraries

            howler.js

            by goldfire

            fingerprintjs

            by fingerprintjs

            Tone.js

            by Tonejs

            AudioKit

            by AudioKit

            sonic-pi

            by sonic-pi-net

            Try Top Libraries by obspy

            docs

            by obspyJupyter Notebook

            vcr

            by obspyPython

            branches

            by obspyC

            reporter

            by obspyPython

            mess2014

            by obspyJavaScript