# obspy.arclink

**URL:** https://discourse.obspy.org/t/obspy-arclink/48
**Category:** Users Mailing List Archive
**Tags:** archive
**Created:** [March 31, 2011, 2:58pm UTC](https://discourse.obspy.org/t/obspy-arclink/48 "2011-03-31T14:58:09Z")
**Posts on this page:** 12
**Page:** 1

<div class="post-metadata">

### Author: ![Wang\_Xiao](https://discourse.obspy.org/letter_avatar_proxy/v4/letter/w/ed8c4c/32.png) [@Wang\_Xiao](https://discourse.obspy.org/u/Wang_Xiao)
#### Post date: [March 31, 2011, 2:58pm UTC](https://discourse.obspy.org/t/obspy-arclink/48/1 "2011-03-31T14:58:09Z")

</div>

Hi,

I deploy an ArcLink server and it works when I use telnet. But it doesn’t work if I access ArcLink server by using obspy.arclink client class. There is no any message to display when I run the obspy.arclink.

Any idea?

Thanksm

Xiao

1. Following is the procedures of using telnet. It works.

xiaowang@linux-5sog:~\> telnet [dh113045.esc.liv.ac.uk](http://dh113045.esc.liv.ac.uk) 18001

Trying 138.253.113.45…

Connected to [dh113045.esc.liv.ac.uk](http://dh113045.esc.liv.ac.uk).

Escape character is ‘^]’.

user xiao

OK

request waveform format=MSEED

OK

2010,04,06,00,00,00 2010,04,06,00,05,00 YF AGUA HHE

end

21

status 21

\<?xml version="1.0"?\>

END

bye

Connection closed by foreign host.

1. Following is the file using obspy.arclink, but it doesn’t work:

from obspy.core import UTCDateTime

from obspy.arclink.client import Client

client = Client(“[dh113045.esc.liv.ac.uk](http://dh113045.esc.liv.ac.uk)”, 18001)

start = UTCDateTime(“2010-04-06 00:03:00”)

st = client.getWaveform(‘YF’, ‘AGUA’, ‘’, ‘HHE’, start - 3, start + 15)

st.plot()

---

<div class="post-metadata">

### Author: ![Wang\_Xiao](https://discourse.obspy.org/letter_avatar_proxy/v4/letter/w/ed8c4c/32.png) [@Wang\_Xiao](https://discourse.obspy.org/u/Wang_Xiao)
#### Post date: [March 31, 2011, 3:37pm UTC](https://discourse.obspy.org/t/obspy-arclink/48/2 "2011-03-31T15:37:15Z")

</div>

just dig log message from ArcLink server side and find a interesting thing:

I used st = client.getWaveform('YF', 'AGUA', '', 'HHE', start - 3, start + 15) to request waveform, but why the log message says "REQUEST ROUTING"?

Following is the log message from ArcLink server:

Mar 31 16:13:49 dh113045 arclink: 138.253.113.204:63707 : opening connection  
Mar 31 16:13:49 dh113045 arclink: 138.253.113.204:63708 : opening connection  
Mar 31 16:13:49 dh113045 arclink: 138.253.113.204:63707 : closing connection  
Mar 31 16:13:49 dh113045 arclink: 138.253.113.204:63708 : HELLO  
Mar 31 16:13:49 dh113045 arclink: 138.253.113.204:63708 : USER ObsPy client  
Mar 31 16:13:49 dh113045 arclink: 138.253.113.204:63708 : INSTITUTION Anonymous  
Mar 31 16:13:49 dh113045 arclink: 138.253.113.204:63709 : opening connection  
Mar 31 16:13:49 dh113045 arclink: 138.253.113.204:63708 : closing connection  
Mar 31 16:13:49 dh113045 arclink: 138.253.113.204:63709 : HELLO  
Mar 31 16:13:49 dh113045 arclink: 138.253.113.204:63709 : USER ObsPy client  
Mar 31 16:13:49 dh113045 arclink: 138.253.113.204:63709 : INSTITUTION Anonymous  
Mar 31 16:13:49 dh113045 arclink: 138.253.113.204:63709 : REQUEST ROUTING  
Mar 31 16:13:49 dh113045 arclink: 138.253.113.204:63709 : END  
Mar 31 16:13:49 dh113045 arclink: 138.253.113.204:63709 : invalid request: STATUS  
Mar 31 16:13:49 dh113045 arclink: 138.253.113.204:63709 : STATUS requires 1 argument  
Mar 31 16:13:49 dh113045 arclink: [8073] STATUS LINE 0 PROCESSING routing  
Mar 31 16:13:49 dh113045 arclink: [8073] STATUS LINE 0 OK  
Mar 31 16:13:49 dh113045 arclink: [8073] STATUS VOLUME routing SIZE 392  
Mar 31 16:13:49 dh113045 arclink: [8073] STATUS VOLUME routing OK  
Mar 31 16:13:49 dh113045 arclink: [8073] END

Regards,

Xiao

---

<div class="post-metadata">

### Author: ![barsch](https://discourse.obspy.org/user_avatar/discourse.obspy.org/barsch/32/7_2.png) [@barsch](https://discourse.obspy.org/u/barsch)
#### Post date: [March 31, 2011, 5:32pm UTC](https://discourse.obspy.org/t/obspy-arclink/48/3 "2011-03-31T17:32:00Z")

</div>

Hi Xiao,

unfortunately I'm not able to run the example given below because the  
ArcLink note dh113045.esc.liv.ac.uk:18001 is not public.

However, could you please initialize the obspy.arclink client with the  
debug=True flag and send me the client output, the corresponding server  
logs and the used ArcLink server version number - I will see what I can  
do ...

Also, please make sure to use the latest developer version of the  
ArcLink client - I fixed a few things in the last days but didn't had  
time to create a new package yet.

Thanks + best,  
Robert

Wang, Xiao schrieb:

---

<div class="post-metadata">

### Author: ![megies](https://discourse.obspy.org/user_avatar/discourse.obspy.org/megies/32/9_2.png) [@megies](https://discourse.obspy.org/u/megies)
#### Post date: [March 31, 2011, 5:55pm UTC](https://discourse.obspy.org/t/obspy-arclink/48/4 "2011-03-31T17:55:53Z")

</div>

Hi Xiao,

I have the feeling that it is a trivial problem:  
Could you please try the Client initialization with "http://" in front  
of the server name (like in the default for the kwarg "base\_url")?

I.e.:  
client = Client("[http://dh113045.esc.liv.ac.uk](http://dh113045.esc.liv.ac.uk)", 18001)

best,  
Tobias

Robert Barsch wrote:

---

<div class="post-metadata">

### Author: ![megies](https://discourse.obspy.org/user_avatar/discourse.obspy.org/megies/32/9_2.png) [@megies](https://discourse.obspy.org/u/megies)
#### Post date: [March 31, 2011, 6:00pm UTC](https://discourse.obspy.org/t/obspy-arclink/48/5 "2011-03-31T18:00:35Z")

</div>

Oh sorry, I mixed up the seishub and arclink clients. Please ignore the  
previous mail.

best,  
Tobias

Tobias Megies wrote:

---

<div class="post-metadata">

### Author: ![Wang\_Xiao](https://discourse.obspy.org/letter_avatar_proxy/v4/letter/w/ed8c4c/32.png) [@Wang\_Xiao](https://discourse.obspy.org/u/Wang_Xiao)
#### Post date: [April 1, 2011, 10:06am UTC](https://discourse.obspy.org/t/obspy-arclink/48/6 "2011-04-01T10:06:05Z")

</div>

Hi Robert,

> unfortunately I'm not able to run the example given below because the  
> ArcLink note dh113045.esc.liv.ac.uk:18001 is not public.

Sorry, the dh113045.esc.liv.ac.uk is within the firewall.

> However, could you please initialize the obspy.arclink client with the  
> debug=True flag and send me the client output, the corresponding server  
> logs and the used ArcLink server version number - I will see what I can  
> do ...

1. Please see the obspy.client file:

xiaowang@linux-5sog:~/Develop-Code/code-test/obspy-test\> more obspy-liv-arclink.py  
from obspy.core import UTCDateTime  
from obspy.arclink.client import Client  
client = Client(host="dh113045.esc.liv.ac.uk", port=18001, debug=True)  
start = UTCDateTime("2010-04-06 00:03:00")  
st = client.getWaveform('YF', 'AGUA', '', 'HHE', start - 3, start + 15)  
st.plot()

2. please see the debug message:

xiaowang@linux-5sog:~/Develop-Code/code-test/obspy-test\> python obspy-liv-arclink.py

> > > HELLO

... ArcLink v1.2 (2010.256)  
... SeisLiv

> > > USER ObsPy client

... OK

> > > INSTITUTION Anonymous

... OK

> > > REQUEST ROUTING  
> > > 2010,4,6,0,2,56,0 2010,4,6,0,3,16,0 YF AGUA  
> > > END

... OK

> > > STATUS

... ERROR  
...  
...  
...  
^Z  
[3]+ Stopped python obspy-liv-arclink.py

3. please see the ArcLink server log message:

Apr 1 10:48:44 dh113045 arclink: 138.253.113.204:60052 : opening connection  
Apr 1 10:48:44 dh113045 arclink: 138.253.113.204:60053 : opening connection  
Apr 1 10:48:44 dh113045 arclink: 138.253.113.204:60052 : closing connection  
Apr 1 10:48:44 dh113045 arclink: 138.253.113.204:60053 : HELLO  
Apr 1 10:48:44 dh113045 arclink: 138.253.113.204:60053 : USER ObsPy client  
Apr 1 10:48:44 dh113045 arclink: 138.253.113.204:60053 : INSTITUTION Anonymous  
Apr 1 10:48:44 dh113045 arclink: 138.253.113.204:60054 : opening connection  
Apr 1 10:48:44 dh113045 arclink: 138.253.113.204:60053 : closing connection  
Apr 1 10:48:44 dh113045 arclink: 138.253.113.204:60054 : HELLO  
Apr 1 10:48:44 dh113045 arclink: 138.253.113.204:60054 : USER ObsPy client  
Apr 1 10:48:44 dh113045 arclink: 138.253.113.204:60054 : INSTITUTION Anonymous  
Apr 1 10:48:44 dh113045 arclink: 138.253.113.204:60054 : REQUEST ROUTING  
Apr 1 10:48:44 dh113045 arclink: 138.253.113.204:60054 : END  
Apr 1 10:48:44 dh113045 arclink: 138.253.113.204:60054 : invalid request: STATUS  
Apr 1 10:48:44 dh113045 arclink: 138.253.113.204:60054 : STATUS requires 1 argument  
Apr 1 10:48:44 dh113045 arclink: [7860] STATUS LINE 0 PROCESSING routing  
Apr 1 10:48:44 dh113045 arclink: [7860] STATUS LINE 0 OK  
Apr 1 10:48:44 dh113045 arclink: [7860] STATUS VOLUME routing SIZE 392  
Apr 1 10:48:44 dh113045 arclink: [7860] STATUS VOLUME routing OK  
Apr 1 10:48:44 dh113045 arclink: [7860] END  
Apr 1 10:48:58 dh113045 dhclient: XMT: Solicit on eth0, interval 120220ms.

4. please see the ArcLink server version:

xiao@dh113045:~/seiscomp3/arclink/bin\> ./arclink -V  
ArcLink v1.2 (2010.256)

> Thanks + best,

Regards,

Xiao

---

<div class="post-metadata">

### Author: ![barsch](https://discourse.obspy.org/user_avatar/discourse.obspy.org/barsch/32/7_2.png) [@barsch](https://discourse.obspy.org/u/barsch)
#### Post date: [April 2, 2011, 7:48am UTC](https://discourse.obspy.org/t/obspy-arclink/48/7 "2011-04-02T07:48:29Z")

</div>

Hi Xiao,

seems like you use a very recent version of the ArcLink server which is  
a bit more restrictive using a STATUS request without a status id - old  
notes such as our version 1.1 note in Munich return on a plain STATUS  
request the status id - version 1.2 quits with an error.

I'm going to fix that and report back to you.

Cheers,  
Robert

- --

Dr. Robert Barsch  
Department of Earth and Environmental Sciences, Geophysics  
LMU Munich  
Theresienstr. 41/IV  
D-80333 Munich  
Germany

Tel: +49 (0) 89 2180 4201  
Fax: +49 (0) 89 2180 9942010  
Mail: barsch@lmu.de

---

<div class="post-metadata">

### Author: ![barsch](https://discourse.obspy.org/user_avatar/discourse.obspy.org/barsch/32/7_2.png) [@barsch](https://discourse.obspy.org/u/barsch)
#### Post date: [April 2, 2011, 9:45am UTC](https://discourse.obspy.org/t/obspy-arclink/48/8 "2011-04-02T09:45:19Z")

</div>

Dear Xiao,

the issue should be fixed within the latest obspy.arclink revision -  
please report back of there are still problems.

Thanks + best,  
Robert

- --

Dr. Robert Barsch  
Department of Earth and Environmental Sciences, Geophysics  
LMU Munich  
Theresienstr. 41/IV  
D-80333 Munich  
Germany

Tel: +49 (0) 89 2180 4201  
Fax: +49 (0) 89 2180 9942010  
Mail: barsch@lmu.de

---

<div class="post-metadata">

### Author: ![Wang\_Xiao](https://discourse.obspy.org/letter_avatar_proxy/v4/letter/w/ed8c4c/32.png) [@Wang\_Xiao](https://discourse.obspy.org/u/Wang_Xiao)
#### Post date: [April 4, 2011, 10:36am UTC](https://discourse.obspy.org/t/obspy-arclink/48/9 "2011-04-04T10:36:37Z")

</div>

Hi Robert,

Thanks to fix it.

Can the updated code be checked out from [https://svn.obspy.org](https://svn.obspy.org)?

I checked out from the above link, but failed to install. Please see the following message when I install it:

linux-5sog:/home/xiao/updated-obspy/obspy # /usr/lib/python/site-packages/easy\_install -N -d /usr/lib/python/site-packages/ obspy.arclink  
Searching for obspy.arclink  
Best match: obspy.arclink 0.4.5.dev-r2079  
Processing obspy.arclink-0.4.5.dev\_r2079-py2.6.egg  
obspy.arclink 0.4.5.dev-r2079 is already the active version in easy-install.pth

Using /usr/lib/python2.6/site-packages/obspy.arclink-0.4.5.dev\_r2079-py2.6.egg

Regards,

Xiao

---

<div class="post-metadata">

### Author: ![megies](https://discourse.obspy.org/user_avatar/discourse.obspy.org/megies/32/9_2.png) [@megies](https://discourse.obspy.org/u/megies)
#### Post date: [April 4, 2011, 6:01pm UTC](https://discourse.obspy.org/t/obspy-arclink/48/10 "2011-04-04T18:01:19Z")

</div>

Hi Xiao,

add option "-U" to update an already installed package and you also have  
to specify version "==dev" to get the latest developer revision.  
See [Home · obspy/obspy Wiki · GitHub](http://obspy.org/wiki/InstallationInstructions:)

easy\_install -N -U obspy.arclink==dev -d ...

..should do the trick.

best,  
Tobias

Wang, Xiao wrote:

---

<div class="post-metadata">

### Author: ![Wang\_Xiao](https://discourse.obspy.org/letter_avatar_proxy/v4/letter/w/ed8c4c/32.png) [@Wang\_Xiao](https://discourse.obspy.org/u/Wang_Xiao)
#### Post date: [April 5, 2011, 10:11am UTC](https://discourse.obspy.org/t/obspy-arclink/48/11 "2011-04-05T10:11:28Z")

</div>

I did a try, but it still request routing, not request waveform.

Any idea?

Xiao

Here is my obspy.client file:

xiao@linux-5sog:~/Develop-Code/code-test/obspy-test\> more obspy-liv-arclink.py  
from obspy.core import UTCDateTime  
from obspy.arclink.client import Client

client = Client(host="dh113045.esc.liv.ac.uk", port=18001, debug=True)  
start = UTCDateTime("2010-04-06 00:03:00")  
st = client.getWaveform('YF', 'AGUA', '', 'HHE', start - 3, start + 15)  
st.plot()

here is the output message:

xiao@linux-5sog:~/Develop-Code/code-test/obspy-test\> python obspy-liv-arclink.py

Connected to dh113045.esc.liv.ac.uk:18001

> > > HELLO

... ArcLink v1.2 (2010.256)  
... SeisLiv

> > > USER ObsPy client

... OK

> > > INSTITUTION Anonymous

... OK

> > > REQUEST ROUTING

... OK

> > > 2010,4,6,0,2,56,0 2010,4,6,0,3,16,0 YF AGUA  
> > > END

... 43

> > > STATUS 43

... \<?xml version="1.0"?\>  
\<arclink\>  
&nbsp;&nbsp;\<request id="43" type="ROUTING" label="" args="" size="0" ready="false" error="false" message=""\>  
&nbsp;&nbsp;&nbsp;&nbsp;\<volume id="UNSET" status="UNSET" size="0" message=""\>  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\<line content="2010,4,6,0,2,56,0 2010,4,6,0,3,16,0 YF AGUA" status="UNSET" size="0" message=""/\>  
&nbsp;&nbsp;&nbsp;&nbsp;\</volume\>  
&nbsp;&nbsp;\</request\>  
\</arclink\>  
END

> > > STATUS 43

... \<?xml version="1.0"?\>  
\<arclink\>  
&nbsp;&nbsp;\<request id="43" type="ROUTING" label="" args="" size="0" ready="false" error="false" message=""\>  
&nbsp;&nbsp;&nbsp;&nbsp;\<volume id="routing" status="PROCESSING" size="0" message=""\>  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\<line content="2010,4,6,0,2,56,0 2010,4,6,0,3,16,0 YF AGUA" status="PROCESSING" size="0" message=""/\>  
&nbsp;&nbsp;&nbsp;&nbsp;\</volume\>  
&nbsp;&nbsp;\</request\>  
\</arclink\>  
END

> > > STATUS 43

... \<?xml version="1.0"?\>  
\<arclink\>  
&nbsp;&nbsp;\<request id="43" type="ROUTING" label="" args="" size="0" ready="false" error="false" message=""\>  
&nbsp;&nbsp;&nbsp;&nbsp;\<volume id="routing" status="PROCESSING" size="0" message=""\>  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\<line content="2010,4,6,0,2,56,0 2010,4,6,0,3,16,0 YF AGUA" status="PROCESSING" size="0" message=""/\>  
&nbsp;&nbsp;&nbsp;&nbsp;\</volume\>  
&nbsp;&nbsp;\</request\>  
\</arclink\>  
END

> > > STATUS 43

... \<?xml version="1.0"?\>  
\<arclink\>  
&nbsp;&nbsp;\<request id="43" type="ROUTING" label="" args="" size="0" ready="false" error="false" message=""\>  
&nbsp;&nbsp;&nbsp;&nbsp;\<volume id="routing" status="PROCESSING" size="0" message=""\>  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\<line content="2010,4,6,0,2,56,0 2010,4,6,0,3,16,0 YF AGUA" status="PROCESSING" size="0" message=""/\>  
&nbsp;&nbsp;&nbsp;&nbsp;\</volume\>  
&nbsp;&nbsp;\</request\>  
\</arclink\>  
END

> > > STATUS 43

... \<?xml version="1.0"?\>  
\<arclink\>  
&nbsp;&nbsp;\<request id="43" type="ROUTING" label="" args="" size="392" ready="true" error="false" message=""\>  
&nbsp;&nbsp;&nbsp;&nbsp;\<volume id="routing" status="OK" size="392" message=""\>  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\<line content="2010,4,6,0,2,56,0 2010,4,6,0,3,16,0 YF AGUA" status="OK" size="0" message=""/\>  
&nbsp;&nbsp;&nbsp;&nbsp;\</volume\>  
&nbsp;&nbsp;\</request\>  
\</arclink\>  
END

> > > DOWNLOAD 43

\<?xml version="1.0" encoding="utf-8"?\>  
\<ns0:routing xmlns:ns0="[http://geofon.gfz-potsdam.de/ns/Routing/1.0/&quot;&gt](http://geofon.gfz-potsdam.de/ns/Routing/1.0/&quot;&gt);  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\<ns0:route locationCode="" networkCode="YF" publicID="Route/YF///" stationCode="" streamCode=""\>  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\<ns0:arclink address="localhost:18001" end="" priority="1" start="1980-01-01T00:00:00.0000Z" /\>  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\<ns0:seedlink address="localhost:18000" priority="1" /\>  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\</ns0:route\>  
\</ns0:routing\>

> > > PURGE 43  
> > > BYE

Requesting localhost:18001  
Traceback (most recent call last):  
&nbsp;&nbsp;File "obspy-liv-arclink.py", line 6, in \<module\>  
&nbsp;&nbsp;&nbsp;&nbsp;st = client.getWaveform('YF', 'AGUA', '', 'HHE', start - 3, start + 15)  
&nbsp;&nbsp;File "/usr/lib/python2.6/site-packages/obspy.core-0.4.5.dev\_r2095-py2.6.egg/obspy/core/util.py", line 427, in echo\_func  
&nbsp;&nbsp;&nbsp;&nbsp;return func(\*args, \*\*kwargs)  
&nbsp;&nbsp;File "/usr/lib/python2.6/site-packages/obspy.arclink-0.4.6.dev\_r2311-py2.6.egg/obspy/arclink/client.py", line 321, in getWaveform  
&nbsp;&nbsp;&nbsp;&nbsp;endtime, format=format, compressed=compressed)  
&nbsp;&nbsp;File "/usr/lib/python2.6/site-packages/obspy.core-0.4.5.dev\_r2095-py2.6.egg/obspy/core/util.py", line 427, in echo\_func  
&nbsp;&nbsp;&nbsp;&nbsp;return func(\*args, \*\*kwargs)  
&nbsp;&nbsp;File "/usr/lib/python2.6/site-packages/obspy.arclink-0.4.6.dev\_r2311-py2.6.egg/obspy/arclink/client.py", line 405, in saveWaveform  
&nbsp;&nbsp;&nbsp;&nbsp;data = self.\_fetch(rtype, rdata)  
&nbsp;&nbsp;File "/usr/lib/python2.6/site-packages/obspy.arclink-0.4.6.dev\_r2311-py2.6.egg/obspy/arclink/client.py", line 177, in \_fetch  
&nbsp;&nbsp;&nbsp;&nbsp;self.open(self.host, self.port, self.timeout)  
&nbsp;&nbsp;File "/usr/lib/python2.6/telnetlib.py", line 225, in open  
&nbsp;&nbsp;&nbsp;&nbsp;self.sock = socket.create\_connection((host, port), timeout)  
&nbsp;&nbsp;File "/usr/lib/python2.6/socket.py", line 514, in create\_connection  
&nbsp;&nbsp;&nbsp;&nbsp;raise error, msg  
socket.error: [Errno 111] Connection refused

---

<div class="post-metadata">

### Author: ![Wang\_Xiao](https://discourse.obspy.org/letter_avatar_proxy/v4/letter/w/ed8c4c/32.png) [@Wang\_Xiao](https://discourse.obspy.org/u/Wang_Xiao)
#### Post date: [April 5, 2011, 10:36am UTC](https://discourse.obspy.org/t/obspy-arclink/48/12 "2011-04-05T10:36:17Z")

</div>

figured out the problem: reconfigure arclink server from localhost to real hostname. So it looks working and I can display waveform.

Regards,

Xiao
