[obspy-users] Problem with simulate + dateless seed

Lion Krischer krischer at geophysik.uni-muenchen.de
Thu Jan 8 20:06:13 CET 2015


Hi Florian,

you still appear to be using the ObsPy OSX Application. We chose to deprecate that as it was simply too much work to maintain. Thus your ObsPy version is at least two years old and not the same as in the documentation.

Please delete the application and install ObsPy with any of the methods described here:
https://github.com/obspy/obspy/wiki#installation <https://github.com/obspy/obspy/wiki#installation>

I strongly recommend going the Anaconda route as it likely has the least issues.

Cheers and all the best!

Lion


> On 02 Jan 2015, at 14:36, Florian Fuchs <florian.fuchs at univie.ac.at> wrote:
> 
> Dear all,
> 
> happy to new year to everyone! I think I have a problem with my ObsPy installation, since one very basic operation from your online examples is not working.
> 
> I wanted to create a ground acceleration plot which didn’t work out so I tried to follow you online examples for instrument response simulation first. These lines are my input:
> 
> from obspy import read
> from obspy.xseed import Parser
> 
> st = read("http://examples.obspy.org/BW.BGLD..EH.D.2010.037 <http://examples.obspy.org/BW.BGLD..EH.D.2010.037>")
> parser = Parser("http://examples.obspy.org/dataless.seed.BW_BGLD <http://examples.obspy.org/dataless.seed.BW_BGLD>")
> st.simulate(seedresp={'filename': parser, 'units': "DIS"})
> 
> First of all I still need to add the ‚date‘ option, otherwise it will not run. After adding the ‚date‘ option for the simulate command I get the following error message:
> 
> In [53]: testdata = read("http://examples.obspy.org/BW.BGLD..EH.D.2010.037 <http://examples.obspy.org/BW.BGLD..EH.D.2010.037>")
> 
> In [54]: testparser = Parser("http://examples.obspy.org/dataless.seed.BW_BGLD <http://examples.obspy.org/dataless.seed.BW_BGLD>")
> 
> In [57]: testdate = testdata[0].stats.starttime
> 
> In [58]: testdata.simulate(seedresp={'filename': testparser, 'date': testdate, 'units': "DIS"})
> ---------------------------------------------------------------------------
> TypeError                                 Traceback (most recent call last)
> /Users/fuchs/tests/noise_power_spectrum/<ipython-input-58-2fabac840591> in <module>()
> ----> 1 testdata.simulate(seedresp={'filename': testparser, 'date': testdate, 'units': "DIS"})
> 
> /Applications/ObsPy.app/Contents/MacOS/lib/python2.7/site-packages/obspy/core/stream.pyc in simulate(self, paz_remove, paz_simulate, remove_sensitivity, simulate_sensitivity, **kwargs)
>    1761             tr.simulate(paz_remove=paz_remove, paz_simulate=paz_simulate,
>    1762                         remove_sensitivity=remove_sensitivity,
> -> 1763                         simulate_sensitivity=simulate_sensitivity, **kwargs)
>    1764         return
>    1765 
> 
> /Applications/ObsPy.app/Contents/MacOS/lib/python2.7/site-packages/obspy/core/trace.pyc in simulate(self, paz_remove, paz_simulate, remove_sensitivity, simulate_sensitivity, **kwargs)
>    1141                 paz_remove=paz_remove, paz_simulate=paz_simulate,
>    1142                 remove_sensitivity=remove_sensitivity,
> -> 1143                 simulate_sensitivity=simulate_sensitivity, **kwargs)
>    1144 
>    1145         # add processing information to the stats dictionary
> 
> 
> /Applications/ObsPy.app/Contents/MacOS/lib/python2.7/site-packages/obspy/signal/invsim.pyc in seisSim(data, samp_rate, paz_remove, paz_simulate, remove_sensitivity, simulate_sensitivity, water_level, zero_mean, taper, taper_fraction, pre_filt, seedresp, nfft_pow2, pitsasim, sacsim, shsim, **_kwargs)
>     472         freq_response, freqs = evalresp(delta, nfft, seedresp['filename'],
>     473                                         seedresp['date'],
> --> 474                                         units=seedresp['units'], freq=True)
>     475         if not remove_sensitivity:
>     476             msg = "remove_sensitivity is set to False, but since seedresp " + \
> 
> /Applications/ObsPy.app/Contents/MacOS/lib/python2.7/site-packages/obspy/core/util/decorator.pyc in echo_func(*args, **kwargs)
>      65                         kwargs[nkw] = kwargs[kw]
>      66                     del(kwargs[kw])
> ---> 67             return func(*args, **kwargs)
>      68         return echo_func
>      69 
> 
> /Applications/ObsPy.app/Contents/MacOS/lib/python2.7/site-packages/obspy/signal/invsim.pyc in evalresp(t_samp, nfft, filename, date, station, channel, network, locid, units, freq, debug)
>     188     """
>     189     # evalresp needs files with correct line separators depending on OS
> 
> --> 190     data = open(filename, 'rb').read()
>     191     fh = NamedTemporaryFile()
>     192     tempfile = fh.name
> 
> TypeError: coercing to Unicode: need string or buffer, Parser found
> 
> 
> 
> Does anyone know what might be wrong?
> 
> Thanks in advance,
> 
> Florian
> 
> 
> _____________________________________
> 
> Florian Fuchs
> Department of Meteorology and Geophysics
> University of Vienna
> UZA II, 2D507
> Althanstraße 14
> 1090 Vienna
> Austria
> Phone: +431427753726
> www: http://imgw.univie.ac.at <http://imgw.univie.ac.at/>
> _____________________________________
> 
> _______________________________________________
> obspy-users mailing list
> obspy-users at lists.swapbytes.de
> http://lists.swapbytes.de/mailman/listinfo/obspy-users

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.swapbytes.de/pipermail/obspy-users/attachments/20150108/02df8f13/attachment-0001.html>


More information about the obspy-users mailing list