[obspy-users] obspy-users Digest, Vol 84, Issue 14

gonzalo antonio fernandez marañon tonino.gafm at gmail.com
Wed Nov 15 14:29:46 CET 2017


Dear Lion,
Thank you for the time,
you are rigth the part of "len(s_OTIS)" is not good, it is jus "s_OTIS"
I think the part of the code:

"for da in s_OTIS:"

Iterate over the stream, I can see that it list all files with the name
"OTIS"

So to save them I need to iterarte over the list to extract the name and
write them in order to have all files.
so I tried...

for da in s_OTIS:
    for i in range(1:len(s_OTIS):
       da.write(da(i).id + ".mseed", format = 'mseed')

but it is not working, can you gime another feedback, thank you a lot for
your time.
Best regards
Gonzalo




2017-11-15 5:25 GMT-04:00 <obspy-users-request at lists.swapbytes.de>:

> Send obspy-users mailing list submissions to
>         obspy-users at lists.swapbytes.de
>
> To subscribe or unsubscribe via the World Wide Web, visit
>         http://lists.swapbytes.de/mailman/listinfo/obspy-users
> or, via email, send a message with subject or body 'help' to
>         obspy-users-request at lists.swapbytes.de
>
> You can reach the person managing the list at
>         obspy-users-owner at lists.swapbytes.de
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of obspy-users digest..."
>
>
> Today's Topics:
>
>    1. Re: obspy-users Digest, Vol 84, Issue 13
>       (gonzalo antonio fernandez mara?on)
>    2. saving many files in miniseed (gonzalo antonio fernandez mara?on)
>    3. Re: saving many files in miniseed (Lion Krischer)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Tue, 14 Nov 2017 08:46:58 -0400
> From: gonzalo antonio fernandez mara?on  <tonino.gafm at gmail.com>
> To: obspy-users at lists.swapbytes.de
> Subject: Re: [obspy-users] obspy-users Digest, Vol 84, Issue 13
> Message-ID:
>         <CAE897hjA6WSn7-fopzMbEyPXOaFYND_+eJR0RvC+
> FBBscsEQhw at mail.gmail.com>
> Content-Type: text/plain; charset="utf-8"
>
> Dear Tom,
> Thank you for the time you spent on it,a s you said I did the cross check
> and I foun my own mistake, I ask all Obspy group apologize.
> in fact "EV2_1s_LPAZ_Z.sac" has the following information:
>
>          network: GT
>          station: LPAZ
>         location: 00
>          channel: BHZ
>        starttime: 2016-12-13T19:54:39.800000Z
>          endtime: 2016-12-13T19:54:41.000000Z
>    sampling_rate: 40.0
>            delta: 0.025
>             npts: 49
>            calib: 1.0
>          _format: SAC
>
> So the date would be.
> ts=obspy.UTCDateTime('2016-12-13T19:54:41.0')
>
> Just in case I attach both files in SAC format.
> Thank you a lot for the support, have a nice day
> Gonzalo
>
>
> 2017-11-13 4:01 GMT-04:00 <obspy-users-request at lists.swapbytes.de>:
>
> > Send obspy-users mailing list submissions to
> >         obspy-users at lists.swapbytes.de
> >
> > To subscribe or unsubscribe via the World Wide Web, visit
> >         http://lists.swapbytes.de/mailman/listinfo/obspy-users
> > or, via email, send a message with subject or body 'help' to
> >         obspy-users-request at lists.swapbytes.de
> >
> > You can reach the person managing the list at
> >         obspy-users-owner at lists.swapbytes.de
> >
> > When replying, please edit your Subject line so it is more specific
> > than "Re: Contents of obspy-users digest..."
> >
> >
> > Today's Topics:
> >
> >    1. Re: Cross-Correlation not working after update (Tom Eulenfeld)
> >
> >
> > ----------------------------------------------------------------------
> >
> > Message: 1
> > Date: Mon, 13 Nov 2017 00:39:29 +0100
> > From: Tom Eulenfeld <tom.eulenfeld at gmail.com>
> > To: users at obspy.org
> > Subject: Re: [obspy-users] Cross-Correlation not working after update
> > Message-ID:
> >         <CAA9AUGGh3QebdcX-UxPeCjWawm66bZL9W-yewJ2_
> > ibYBgdndiQ at mail.gmail.com>
> > Content-Type: text/plain; charset="utf-8"
> >
> > Hi Gonzalo,
> >
> > in the script you read in events 5 and 2, but you sent only data for
> events
> > 1 and 5.
> >
> > If I change your code to read in event 1, the defined pick time is too
> late
> > and I get the same error.
> >
> > Can you double check and provide the data for event 1?
> >
> > Best regards,
> > Tom
> >
> > On Fri, Nov 10, 2017 at 9:06 PM, gonzalo antonio fernandez mara?on <
> > tonino.gafm at gmail.com> wrote:
> >
> > > Dear all,
> > > Tahnk you for the time you spend reading it,
> > > When I had the obspy.0.9 version the cross-correlation worked fine,
> since
> > > I updated to V1.1.0 i git an erro when I tried to re run my script I am
> > > working in windows 10 with python 2.7
> > >
> > > I have two waveforms from a seismic swarm, I cut them before P phase
> just
> > > a few mili seconds (they are in SAC format).
> > >
> > > I applied the scritp from the Obspy tutorial:
> > >
> > >
> > > m=read('EV5_1s_LPAZ_Z*')[0]  #master
> > > s=read('EV2_1s_LPAZ_Z*')[0]   #slave
> > > tm=obspy.UTCDateTime('2016-12-14T19:33:37.3Z')
> > > ts=obspy.UTCDateTime('2016-10-20T11:18:26.1Z')
> > > dt, coeff = xcorr_pick_correction(tm, m, ts, s, 0.05, 0.7, 0.3,
> > plot=True,
> > >                                   filter="bandpass",
> > >                                   filter_options={'freqmin': 0.8,
> > > 'freqmax': 3.5})
> > >
> > > Before the update with the same vales it worked well, attach the figure
> > > before the update.
> > > After the update I got an error.
> > >
> > > warnings.warn(msg)
> > > UserWarning: Artifacts from signal processing possible. Trace 0 should
> > > have more additional data at the start.
> > >
> > > Warning (from warnings module):
> > >   File "C:\Python27\lib\site-packages\obspy\signal\cross_
> > correlation.py",
> > > line 451
> > >     warnings.warn(msg)
> > > UserWarning: Artifacts from signal processing possible. Trace 0 should
> > > have more additional data at the end.
> > >
> > > Traceback (most recent call last):
> > >   File "G:\+0n1nO_python_obspy_scripts\python_correlation\corrsig.py",
> > > line 35, in <module>
> > >     filter_options={'freqmin': 0.8, 'freqmax': 3.5})
> > >   File "C:\Python27\lib\site-packages\obspy\signal\cross_
> > correlation.py",
> > > line 440, in xcorr_pick_correction
> > >     raise Exception(msg)
> > > Exception: Trace 1 starts too late.
> > >
> > > I modofied the t_before and t_after and it is the same.
> > > [image: Im?genes integradas 1]
> > >
> > > Thank you a lot for yoor time.
> > > Gonzalo
> > >
> > > _______________________________________________
> > > 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/20171113/9b787d8c/attachment.html>
> > -------------- next part --------------
> > A non-text attachment was scrubbed...
> > Name: LPAZ_Corr5-1.png
> > Type: image/png
> > Size: 63258 bytes
> > Desc: not available
> > URL: <http://lists.swapbytes.de/pipermail/obspy-users/
> > attachments/20171113/9b787d8c/attachment.png>
> >
> > ------------------------------
> >
> > _______________________________________________
> > obspy-users mailing list
> > obspy-users at lists.swapbytes.de
> > http://lists.swapbytes.de/mailman/listinfo/obspy-users
> >
> > End of obspy-users Digest, Vol 84, Issue 13
> > *******************************************
> >
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <http://lists.swapbytes.de/pipermail/obspy-users/
> attachments/20171114/22a956fb/attachment-0001.html>
> -------------- next part --------------
> A non-text attachment was scrubbed...
> Name: EV2_1s_LPAZ_Z.sac
> Type: application/octet-stream
> Size: 828 bytes
> Desc: not available
> URL: <http://lists.swapbytes.de/pipermail/obspy-users/
> attachments/20171114/22a956fb/attachment-0002.obj>
> -------------- next part --------------
> A non-text attachment was scrubbed...
> Name: EV1_1s_LPAZ_Z.sac
> Type: application/octet-stream
> Size: 828 bytes
> Desc: not available
> URL: <http://lists.swapbytes.de/pipermail/obspy-users/
> attachments/20171114/22a956fb/attachment-0003.obj>
>
> ------------------------------
>
> Message: 2
> Date: Tue, 14 Nov 2017 19:13:10 -0400
> From: gonzalo antonio fernandez mara?on  <tonino.gafm at gmail.com>
> To: obspy-users at lists.swapbytes.de
> Cc: obspy-users-request at lists.swapbytes.de
> Subject: [obspy-users] saving many files in miniseed
> Message-ID:
>         <CAE897hii3AOihNbqPRGfgvVQd8iHz8qU2a-fdC7uH+gwL3G-bw at mail.
> gmail.com>
> Content-Type: text/plain; charset="utf-8"
>
> Dear Obspy forum,
> Again thank you for reading it, now I have 1000 one - hour Seisan files.
>
> so I tried the following code to separe a specific station (the station is
> called OTIS):
>
> #! /bin/bash
> import os
> from obspy.core import read
>
> os.chdir('/home/tunupa/me/')
> s=read('*MAN*')  #extensio of a seisan file
>
> # here the stream s_OTIS has only OTIS channels which is good.
> s_OTIS=s.select(station='OTIS*')
>
> #here I try to save them all in miniseed channels
> for da in len(s_OTIS):
>        da.write(da.id + ".mseed" , format='MSEED' )
>
> bust i just save the last three events, if you have any feedback, I woul
> thank you a lot for your time.
>
> Thank you a lot
> Gonzalo
>
>
> st2 = st.select(station="R*")
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <http://lists.swapbytes.de/pipermail/obspy-users/
> attachments/20171114/1c47bda4/attachment-0001.html>
>
> ------------------------------
>
> Message: 3
> Date: Wed, 15 Nov 2017 09:59:29 +0100
> From: Lion Krischer <krischer at geophysik.uni-muenchen.de>
> To: users at obspy.org
> Subject: Re: [obspy-users] saving many files in miniseed
> Message-ID:
>         <99b51f73-15df-7424-cc7c-4fcfd402c295 at geophysik.uni-muenchen.de>
> Content-Type: text/plain; charset="windows-1252"
>
> Hi Gonzalo,
>
> I don't understand how this can work at all.  This is invalid Python code:
>
> #here I try to save them all in miniseed channels
> for da in len(s_OTIS):
>        da.write(da.id <http://da.id> + ".mseed" , format='MSEED' )
>
> len(s_OTIS) returns a integer and one cannot loop/iterate over an
> integer. You have to loop over the stream.
>
> I assume you actually ran a version in which this worked. I furthermore
> assume you only end up with three files because you give the same name
> to all, independent of the times at which each trace has data?
>
> Lion
>
>
>
> On 15.11.17 00:13, gonzalo antonio fernandez mara?on wrote:
> > Dear Obspy forum,
> > Again thank you for reading it, now I have 1000 one - hour Seisan files.
> >
> > so I tried the following code to separe a specific station (the
> > station is called OTIS):
> >
> > #! /bin/bash
> > import os
> > from obspy.core import read
> >
> > os.chdir('/home/tunupa/me/')
> > s=read('*MAN*')  #extensio of a seisan file
> >
> > # here the stream s_OTIS has only OTIS channels which is good.
> > s_OTIS=s.select(station='OTIS*')
> >
> > #here I try to save them all in miniseed channels
> > for da in len(s_OTIS):
> >        da.write(da.id <http://da.id> + ".mseed" , format='MSEED' )
> >
> > bust i just save the last three events, if you have any feedback, I
> > woul thank you a lot for your time.
> >
> > Thank you a lot
> > Gonzalo
> >
> >
> > st2 = st.select(station="R*")
> >
> >
> >
> >
> > _______________________________________________
> > 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/20171115/49e15dc8/attachment.html>
>
> ------------------------------
>
> _______________________________________________
> obspy-users mailing list
> obspy-users at lists.swapbytes.de
> http://lists.swapbytes.de/mailman/listinfo/obspy-users
>
> End of obspy-users Digest, Vol 84, Issue 14
> *******************************************
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.swapbytes.de/pipermail/obspy-users/attachments/20171115/723bcb82/attachment-0001.html>


More information about the obspy-users mailing list