institution=options.arclink_institution, ) for id in options.arclink_ids.split(","): net, sta, loc, cha = id.split(".") net_sta = "%s.%s" % (net, sta) if net_sta in sta_fetched: print "%s skipped! (Was already retrieved)" % net_sta.ljust(8) continue try: sys.stdout.write("\r%s ..." % net_sta.ljust(8)) sys.stdout.flush() st = client.getWaveform( network=net, station=sta, location=loc, channel=cha, starttime=t1, endtime=t2, getPAZ=getPAZ, getCoordinates=getCoordinates, ) sta_fetched.add(net_sta) sys.stdout.write("\r%s fetched.\n" % net_sta.ljust(8)) sys.stdout.flush() except Exception, e: sys.stdout.write("\r%s skipped! (Server replied: %s)\n" % (net_sta.ljust(8), e)) sys.stdout.flush() continue for tr in st: tr.stats["_format"] = "ArcLink" streams.append(st) clients["ArcLink"] = client