saving many files in miniseed

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*")

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 + “.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