obspy/obspy — pull request #586 by megies (2013-06-10 14:56:42+00:00)
Title: Could not find PAZ

I have a problem with getPAZ, on macos 10.6.8 using Python 2.7.5 and the latest dev with the following code

````python
#!/usr/bin/env python

from obspy.core import UTCDateTime
from obspy.arclink import Client

client = Client(user="bonaime@obspy")
station = 'SSB'
channel = 'BHZ'
network = 'G'
loc = '00'

time = UTCDateTime("2011-10-12")
paz = client.getPAZ(network, station, loc, channel, time)

print 'PAZ from:'+str(time)+'is downloaded\n\n'

time = UTCDateTime("2012-10-13")
paz = client.getPAZ(network, station, loc, channel, time)
````

the first getPAZ is working but not the second. Between the "2011-10-12" and "2011-10-13" dataless has changed.

in obspy.arclink.client I put a
````python
print result
`````
in the getInventory function, just before
````python
xml_doc = etree.fromstring(result)
`````

Here is the xml I have for the firt getPAZ
````xml

ResponseFIR#20121008134151.278971.4592

3.77162e-17 -1.69713e-10 1.71838e-08 -2.43964e-07 2.58252e-07 1.5609e-06 -1.81704e-06 2.41376e-06 -3.70491e-06 8.73276e-07 3.64235e-05 -0.000246833 -0.000393599 0.000655961 -0.00102025 0.00123051 -0.00106043 0.000288613 0.00122683 -0.00345855 0.00614628 -0.00875821 0.0105179 -0.0104955 0.00776882 -0.0016282 -0.00764096 0.0198944 -0.0387619 0.0551044 -0.0713696 0.0833036 -0.0867195 0.0628769 0.889951 0.167002 -0.128687 0.100726 -0.0755007 0.0515952 -0.0311146 0.011006 0.000476173 -0.00823882 0.0124211 -0.0131333 0.0114417 -0.00845235 0.00513644 -0.00220567 6.47577e-05 0.00117235 -0.00160962 0.00148359 -0.00106529 0.000590532 -0.000273576 -0.000321484 3.98515e-05 1.0833e-06 -4.64297e-06 2.88448e-06 -1.62081e-06 1.31617e-06 4.72519e-07 -3.29637e-07 2.71423e-08

(0.0,0.0) (0.0,0.0)
(-0.0121536,0.0121339) (-0.0121536,-0.0121339) (-32.4261,61.9769) (-32.4261,-61.9769)

````

and for the second one
````xml

ResponseFIR#20121008134151.279962.4596

3.77162e-17 -1.69713e-10 1.71838e-08 -2.43964e-07 2.58252e-07 1.5609e-06 -1.81704e-06 2.41376e-06 -3.70491e-06 8.73276e-07 3.64235e-05 -0.000246833 -0.000393599 0.000655961 -0.00102025 0.00123051 -0.00106043 0.000288613 0.00122683 -0.00345855 0.00614628 -0.00875821 0.0105179 -0.0104955 0.00776882 -0.0016282 -0.00764096 0.0198944 -0.0387619 0.0551044 -0.0713696 0.0833036 -0.0867195 0.0628769 0.889951 0.167002 -0.128687 0.100726 -0.0755007 0.0515952 -0.0311146 0.011006 0.000476173 -0.00823882 0.0124211 -0.0131333 0.0114417 -0.00845235 0.00513644 -0.00220567 6.47577e-05 0.00117235 -0.00160962 0.00148359 -0.00106529 0.000590532 -0.000273576 -0.000321484 3.98515e-05 1.0833e-06 -4.64297e-06 2.88448e-06 -1.62081e-06 1.31617e-06 4.72519e-07 -3.29637e-07 2.71423e-08

(0.0,0.0) (0.0,0.0)
(-0.01234,0.01234) (-0.01234,-0.01234) (-35.0,65.0) (-35.0,-65.0)

````
We can see some responses in both 'result'

Then I followed the code until
````python
# instruments
for stream in station.xpath('ns:' + stream_ns,
namespaces={'ns': xml_ns}):
# date / times
try:
start = UTCDateTime(stream.get('start'))
except:
start = None
try:
end = UTCDateTime(stream.get('end'))
except:
end = None
print 'start '+str(start)+ 'end '+str(end)
`````
In this 'for loop', as I understand, we are looking at the different 'streams' in result. But the 'start' and 'end' are, I think, not the right ones. I don't really understand the xpath, but, I think, we are not looking at the right elements. Here is the output of the print for the two getPAZ
````log
start 1982-05-02T00:00:00.000000Zend 2011-10-12T11:00:00.000000Z
start 1982-05-02T00:00:00.000000Zend 2011-10-12T11:00:00.000000Z
`````
We have the same start and end with two different streams.
if we look in the xml data we have for the first getPAZ
end="2011-10-12T11:00:00.0000Z"
start="2009-02-16T00:00:00.0000Z"

and for the second one
start="2011-10-12T11:00:00.0000Z
and no end because the channel is still open