I am trying to use the obspy MassDownloader to download waveforms for a catalogue of events. I don’t know yet which stations might have data, so I specified a circular domain around each event, set start and end time (and some other parameters) in the Restrictions, included a list of networks, but no restriction to certain stations.
The data is supposed to be stored in a SeisComP database, i.e. the folder structure is year/julian day/network/station/channel. The year and julian day I get from the event time, but I don’t know how to define network and station, since I don’t know yet what the MassDownloader will find. There is an option to give a string template for the mseed_storage variable of the MassDownloader, which seems to be exactly what I want, but I don’t manage to define it correctly. (My expertise in both python and obspy is still limited, I am afraid.) I always end up with an error like “NameError: name ‘network’ is not defined”.
I’ve looked through the MassDownloader-related topics, but unfortunately, everybody seems to use a simple “waveforms” directory for downloading without sub-directory structure. Therefore, it would be very nice if someone could help me out.
This part of the code looks as follows:
domain = CircularDomain(latitude=lat, longitude=lon,
restrictions = Restrictions(
starttime=evt - dt,
endtime=evt + dt,
location_priorities=[“”, “00”, “10”],
mdl = MassDownloader()
mdl.download(domain, restrictions, download_chunk_size_in_mb=50,
stationxml_storage=xml_dir, print_report = True)
Thank you very much for your help!