Modify

Ticket #265 (closed enhancement: fixed)

Opened 11 months ago

Last modified 6 months ago

Differentiating/Integrating data

Reported by: anonymous Owned by:
Priority: minor Component: ObsPy library
Keywords: velocity, displacement, integrate, differentiate Cc:

Description

Hello,

I need to integrate my velocity data into displacement and/or differentiate into acceleration. I found nothing on this in the tutorials or function documentations. How can this be done?

  • Thanks

Attachments

Change History

comment:1 Changed 11 months ago by megies

  • Type changed from task to enhancement

In principle you should be able to differentiate/integrate by adjusting your PAZ dictionary before instrument correction/simulation.

Another possibility is using the available numpy/scipy routines.
You can differentiate by:

tr.data = np.gradient(tr.data, tr.stats.delta)

I had no need to integrate so far, you can have a look at  http://www.scipy.org/doc/api_docs/SciPy.integrate.html. I only used scipy.integrate.cumtrapz at some point, it changes the sampling positions and reduces trace length by 1, though.

I agree that it should be added as methods on Stream/Trace.
Hope it helps, Tobias

comment:2 Changed 10 months ago by megies

This is a common task in processing strong motion data and is usually done by dividing your velocity spectrum in the Fourier domain with jw for integration or multiplying it by jw for differentiation. You can avoid amplifying noise by applying an appropriate bandpass filter (have a look at the noise spectra for the seismic station you are looking at) and you have to make sure that your input data has sufficient zero padding on either side. That's just what I remember from the top of my head. If you need more details have a look at some strong motion processing papers or let me know and I can give you some references.

Cheers, Yannik

comment:3 Changed 6 months ago by driel

In [2969/obspy]:

  • adding convinience wrapping of differentiation to Stream/Trace?
  • keyword method included for future implementation of fourier domain differentiation
  • see #265 and #304

comment:11 Changed 6 months ago by driel

In [2970/obspy]:

  • adding convinience wrapping for integration (cumtrapz for now) to stream and trace
  • see #304 and #265

comment:12 Changed 6 months ago by barsch

  • Status changed from new to closed
  • Resolution set to fixed
View

Add a comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
The resolution will be deleted. Next status will be 'reopened'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.