# fdsn mass\_downloader

**URL:** <https://discourse.obspy.org/t/fdsn-mass-downloader/501>\
**Category:** Users Mailing List Archive\
**Tags:** archive\
**Created:** [March 4, 2016, 12:42pm UTC](https://discourse.obspy.org/t/fdsn-mass-downloader/501 "2016-03-04T12:42:27Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nikolaos\_Triantafyll](https://discourse.obspy.org/user_avatar/discourse.obspy.org/nikolaos_triantafyll/32/264_2.png) [@Nikolaos\_Triantafyll](https://discourse.obspy.org/u/Nikolaos_Triantafyll)\
**Post date:** [March 4, 2016, 12:42pm UTC](https://discourse.obspy.org/t/fdsn-mass-downloader/501/1 "2016-03-04T12:42:27Z")

</div>

Dear all,

I tried to download both HH\* and HN\* data from an fdsn service using the fdsn mass\_downloader.

I set to restrictions (channel=HH\*) so it downloaded only HH\* data.  
Then, I set (channel=HN\*) but it couldn't download them. I tried by setting channel\_priorities=("HN[ZNE]", "HN[ZNE]") and at this way, it downloaded them.

1) Is there any issue with "channel" and "channel\_priorities"?  
2) Since I run these commands individually, is there a way to merge both channels to the stations' xml?  
3) Is there a way to download both HH\* and HN\* at once?

Thank you in advance,  
Nikos

---

<div class="post-metadata">

**Author:** ![LionKrischer](https://discourse.obspy.org/user_avatar/discourse.obspy.org/lionkrischer/32/219_2.png) [@LionKrischer](https://discourse.obspy.org/u/LionKrischer)\
**Post date:** [March 4, 2016, 2:10pm UTC](https://discourse.obspy.org/t/fdsn-mass-downloader/501/2 "2016-03-04T14:10:25Z")

</div>

Hi Nikos,

> 1) Is there any issue with "channel" and "channel\_priorities"?

It works as intended. The network/station/location/channel codes are  
used for the initial availability query. The  
channel\_priority/location\_priority are later on used to filter the  
availability to restrict it to the subset of things one wants.

I agree it might be a bit confusing - if you have any ideas on how to  
improve the documentation, please open an issue on github.

> 2) Since I run these commands individually, is there a way to merge both  
> channels to the stations' xml?  
> 3) Is there a way to download both HH\* and HN\* at once?

Yes to both, this simple examples script does it. Essentially it uses a  
wildcard for the location priority list and unix pattern matching for  
the channel priorities. Thus it will now just find a lot more channels  
for the first priority item it and it will download all of them  
including the necessary station information in a single file per station.

import obspy  
from obspy.clients.fdsn.mass\_downloader import GlobalDomain, \  
&nbsp;&nbsp;&nbsp;&nbsp;Restrictions, MassDownloader

origin\_time = obspy.UTCDateTime(2011, 3, 11, 5, 47, 32)  
domain = GlobalDomain()

restrictions = Restrictions(  
&nbsp;&nbsp;&nbsp;&nbsp;network="RO", station="BMR",  
&nbsp;&nbsp;&nbsp;&nbsp;starttime=origin\_time - 60,  
&nbsp;&nbsp;&nbsp;&nbsp;endtime=origin\_time + 60,  
&nbsp;&nbsp;&nbsp;&nbsp;channel\_priorities=["H[NH][ZNE]"],  
&nbsp;&nbsp;&nbsp;&nbsp;location\_priorities=["\*"])

mdl = MassDownloader(providers=["GFZ"])  
mdl.download(domain, restrictions, mseed\_storage="waveforms",  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;stationxml\_storage="stations")

One thing to keep in mind: The documentation currently uses tuples for  
the location and channel priority lists. Python's semantics require a  
comma to actually make a tuple a tuple, thus do

channel\_priorities=("H[NH][ZNE]",) instead of

channel\_priorities=("H[NH][ZNE]") which the mass downloader would  
interpret as

channel\_priorities=("H", "[", "N", "H", "]", "[", "Z", "N", "E", "]")  
which naturally results in no matches...

Or just use a list like the example in this email

Cheers!

Lion
