[obspy-users] saving many files in miniseed

Lion Krischer krischer at geophysik.uni-muenchen.de
Wed Nov 15 09:59:29 CET 2017


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-0001.html>


More information about the obspy-users mailing list