about sampling rate

24 views
Skip to first unread message

Marcillo, Omar Eduardo

unread,
Sep 21, 2015, 11:25:09 AM9/21/15
to pisc...@googlegroups.com, Maccarthy, Jonathan K
Jon,

I had an issue with the sampling rate while exporting sac files:

I found the issue in line 687 at sac.py file:

    wfdict['samprate'] = int(1.0 / header['delta'])


'int' rounds the sampling rate to the lowest integer but I think it should round to the largest as sometimes header['delta'] is not exact for example: for 20 Hz instead of displaying 0.05  it displays 0.05000001 that makes the sampling rate 19.9999 Hz instead of 20 and the final sampling rate is 19 instead of 20. 


I fixed that with:


   wfdict['samprate'] = int(numpy.round(1.0 / header['delta']))



Regards

Omar

jkmacc

unread,
Oct 21, 2016, 1:14:17 PM10/21/16
to pisces-db, jkm...@lanl.gov, omar...@lanl.gov
Reply all
Reply to author
Forward
0 new messages