#115765 Report by node derrick covering 2185 tests from 62 modules resulted into 16 errors

Report

ObsPy version
1.2.2.post0+552.g2503ab491e.d…
GitHub Pull Request
-
Report file
JSON document
Total runtime
604.4 sec
Report date/time
Jan. 9, 2022, 8:17 p.m.

System / Python

Architecture
64bit
Machine
x86_64
Node
derrick
Processor
x86_64
Python Compiler
GCC 7.3.0
Python Implementation
CPython
Python Version
3.8.5
Release
5.11.0-44-generic
System
Linux
Version
#48~20.04.2-Ubuntu SMP Tue Dec 14 15:36:44 UTC 2021

Dependencies

decorator
4.4.2
lxml
4.6.3
matplotlib
3.5.0
numpy
1.20.3
obspy
1.2.2.post0+552.g2503ab491e.dirty
requests
2.26.0
scipy
1.5.3
setuptools
59.2.0
sqlalchemy
1.4.27

Modules (62)

Module Errors / Failures Tracebacks
obspy.clients Not tested -
obspy.clients.arclink Not tested -
obspy.clients.earthworm - -
obspy.clients.fdsn 8 1 2 3 4 5 6 7 8
obspy.clients.filesystem - -
obspy.clients.iris 6 9 10 11 12 13 14
obspy.clients.neic - -
obspy.clients.nrl - -
obspy.clients.seedlink 1 15
obspy.clients.seishub Not tested -
obspy.clients.syngine - -
obspy.core - -
obspy.core.event - -
obspy.core.inventory - -
obspy.core.util - -
obspy.db Not tested -
obspy.geodetics - -
obspy.imaging - -
obspy.io.ah - -
obspy.io.arclink - -
obspy.io.ascii - -
obspy.io.cmtsolution - -
obspy.io.cnv - -
obspy.io.css - -
obspy.io.dmx - -
obspy.io.focmec - -
obspy.io.gcf - -
obspy.io.gse2 - -
obspy.io.hypodd - -
obspy.io.iaspei - -
obspy.io.json - -
obspy.io.kinemetrics - -
obspy.io.kml - -
obspy.io.mseed - -
obspy.io.ndk - -
obspy.io.nied - -
obspy.io.nlloc 1 16
obspy.io.nordic - -
obspy.io.pdas - -
obspy.io.pde - -
obspy.io.quakeml - -
obspy.io.reftek - -
obspy.io.rg16 - -
obspy.io.sac - -
obspy.io.scardec - -
obspy.io.seg2 - -
obspy.io.segy - -
obspy.io.seisan - -
obspy.io.seiscomp - -
obspy.io.sh - -
obspy.io.shapefile - -
obspy.io.stationtxt - -
obspy.io.stationxml - -
obspy.io.wav - -
obspy.io.win - -
obspy.io.xseed - -
obspy.io.y - -
obspy.io.zmap - -
obspy.realtime - -
obspy.scripts - -
obspy.signal - -
obspy.taup - -
Summary 16 16

Tracebacks (16)

026
027 A client object can be initialized either with the base URL of any FDSN web
028 service or with a shortcut name which will be mapped to a FDSN URL. All the
029 example make use of the FDSN web service at IRIS. For a list of other
030 available web service providers, see the
031 :meth:`~obspy.clients.fdsn.client.Client.__init__()` method. The currently
032 available providers are:
033
034 >>> from obspy.clients.fdsn.header import URL_MAPPINGS
035 >>> for key in sorted(URL_MAPPINGS.keys()):
Differences (unified diff with -expected +actual):
@@ -3,6 +3,6 @@
EMSC http://www.seismicportal.eu
ETH http://eida.ethz.ch
+GEOFON http://geofon.gfz-potsdam.de
GEONET http://service.geonet.org.nz
-GEOFON http://geofon.gfz-potsdam.de
GFZ http://geofon.gfz-potsdam.de
ICGC http://ws.icgc.cat
/media/data/Gits/obspy/obspy/clients/fdsn/__init__.py:35: DocTestFailure
413
414 Query the event service of the client.
415
416 >>> client = Client("IRIS")
417 >>> cat = client.get_events(eventid=609301)
418 >>> print(cat)
Expected:
1 Event(s) in Catalog:
1997-10-14T09:53:11.070000Z | -22.145, -176.720 | 7.8 mw
Got:
1 Event(s) in Catalog:
1997-10-14T09:53:11.070000Z | -22.145, -176.720 | 7.8 mw
/media/data/Gits/obspy/obspy/clients/fdsn/client.py:418: DocTestFailure
1076
1077 >>> client = Client("IRIS")
1078 >>> t1 = UTCDateTime("2010-02-27T06:30:00.000")
1079 >>> t2 = t1 + 1
1080 >>> t3 = t1 + 3
1081 >>> bulk = [("IU", "ANMO", "*", "BHZ", t1, t2),
1082 ... ("IU", "AFI", "1?", "BHE", t1, t3),
1083 ... ("GR", "GRA1", "*", "BH*", t2, t3)]
1084 >>> inv = client.get_stations_bulk(bulk)
1085 >>> print(inv) # doctest: +ELLIPSIS +NORMALIZE_WHITESPACE
Differences (unified diff with -expected +actual):
@@ -1,11 +1,12 @@
-Inventory created at ...
- Created by: IRIS WEB SERVICE: fdsnws-station | version: ...
- ...
- Sending institution: IRIS-DMC (IRIS-DMC)
- Contains:
- Networks (2):
- GR, IU
- Stations (2):
- GR.GRA1 (GRAFENBERG ARRAY, BAYERN)
- IU.ANMO (Albuquerque, New Mexico, USA)
- Channels (0):
+Inventory created at 2022-01-10T02:08:05.170000Z
+	Created by: IRIS WEB SERVICE: fdsnws-station | version: 1.1.48
+		
+	Sending institution: IRIS-DMC (IRIS-DMC)
+	Contains:
+		Networks (2):
+			GR, IU
+		Stations (2):
+			GR.GRA1 (GRAFENBERG ARRAY, BAYERN)
+			IU.ANMO (Albuquerque, New Mexico, USA)
+		Channels (0):
+<BLANKLINE>
/media/data/Gits/obspy/obspy/clients/fdsn/client.py:1085: DocTestFailure
489 Authentication
490 --------------
491
492 To make the mass downloader work for restricted data, just initialize it
493 with existing :class:`~obspy.clients.fdsn.client.Client` instances that have
494 credentials. Note that you can mix already initialized clients with varying
495 credientials and just passing the name of the FDSN services to query.
496
497 >>> from obspy.clients.fdsn import Client
498 >>> client_orfeus = Client("ORFEUS", user="random", password="some_pw")
UNEXPECTED EXCEPTION: FDSNNoServiceException("No FDSN services could be discovered at 'http://www.orfeus-eu.org'. This could be due to a temporary service outage or an invalid FDSN service address.")
Traceback (most recent call last):
File "/home/derrick/anaconda3/lib/python3.8/doctest.py", line 1336, in __run
exec(compile(example.source, filename, "single",
File "<doctest obspy.clients.fdsn.mass_downloader[19]>", line 1, in <module>
File "/media/data/Gits/obspy/obspy/clients/fdsn/client.py", line 270, in __init__
self._discover_services()
File "/media/data/Gits/obspy/obspy/clients/fdsn/client.py", line 1566, in _discover_services
raise FDSNNoServiceException(msg)
obspy.clients.fdsn.header.FDSNNoServiceException: No FDSN services could be discovered at 'http://www.orfeus-eu.org'. This could be due to a temporary service outage or an invalid FDSN service address.
/media/data/Gits/obspy/obspy/clients/fdsn/mass_downloader/__init__.py:498: UnexpectedException
self = <obspy.clients.fdsn.tests.test_client.ClientTestCase testMethod=test_eida_token_resolution>
def test_eida_token_resolution(self):
"""
Tests that EIDA tokens are resolved correctly and new credentials get
installed with the opener of the Client.
"""
token = os.path.join(self.datapath, 'eida_token.txt')
with open(token, 'rb') as fh:
token_data = fh.read().decode()
def _assert_eida_user_and_password(user, password):
# user/pass is not static for the static test token
for value in user, password:
# seems safe to assume both user and password are at least 10
# chars long
# example user/password:
# wWGgJnH4GvdVY7gDMH21xEpb wDnzlpljqdaCXlP2
re.match('^[a-zA-Z0-9]{10,}$', value)
def _get_http_digest_auth_handler(client):
handlers = [h for h in client._url_opener.handlers
if isinstance(h, urllib_request.HTTPDigestAuthHandler)]
self.assertLessEqual(len(handlers), 1)
return handlers and handlers[0] or None
def _assert_credentials(client, user, password):
handler = _get_http_digest_auth_handler(client)
self.assertIsInstance(handler,
urllib_request.HTTPDigestAuthHandler)
for user_, password_ in handler.passwd.passwd[None].values():
self.assertEqual(user, user_)
self.assertEqual(password, password_)
client = Client('GFZ')
# this is a plain client, so it should not have http digest auth
self.assertEqual(_get_http_digest_auth_handler(client), None)
# now, if we set new user/password, we should get a http digest auth
# handler
user, password = ("spam", "eggs")
client._set_opener(user=user, password=password)
_assert_credentials(client, user, password)
# now, if we resolve the EIDA token, the http digest auth handler
# should change
> user, password = client._resolve_eida_token(token=token)
clients/fdsn/tests/test_client.py:1620:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
clients/fdsn/client.py:394: in _resolve_eida_token
response = self._download(url=url, data=token.encode(),
clients/fdsn/client.py:1412: in _download
raise_on_error(code, data)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
code = 400, data = <HTTPError 400: 'Bad Request'>
def raise_on_error(code, data):
"""
Raise an error for non-200 HTTP response codes
:type code: int
:param code: HTTP response code
:type data: :class:`io.BytesIO`
:param data: Data returned by the server
"""
# get detailed server response message
if code != 200:
try:
server_info = data.read()
except Exception:
server_info = None
else:
server_info = server_info.decode('ASCII', errors='ignore')
if server_info:
server_info = "\n".join(
line for line in server_info.splitlines() if line)
# No data.
if code == 204:
raise FDSNNoDataException("No data available for request.",
server_info)
elif code == 400:
msg = ("Bad request. If you think your request was valid "
"please contact the developers.")
> raise FDSNBadRequestException(msg, server_info)
E obspy.clients.fdsn.header.FDSNBadRequestException: Bad request. If you think your request was valid please contact the developers.
E HTTP Status code: 400
E Detailed response of server:
E
E Error 400: Bad Request
E token is expired
E Usage details are available from /fdsnws/dataselect/1/
E Request:
E /fdsnws/dataselect/1/auth
E Request Submitted:
E 2022-01-10T02:08:50.552854
E Service Version:
E 1.1.0
clients/fdsn/client.py:1747: FDSNBadRequestException
self = <obspy.clients.fdsn.tests.test_client.ClientTestCase testMethod=test_trim_stream_after_get_waveform>
def test_trim_stream_after_get_waveform(self):
"""
Tests that stream is properly trimmed to user requested times after
fetching from datacenter, see #1887
"""
c = Client(
service_mappings={'dataselect':
'http://ws.ipgp.fr/fdsnws/dataselect/1'})
starttime = UTCDateTime('2016-11-01T00:00:00')
endtime = UTCDateTime('2016-11-01T00:00:10')
> stream = c.get_waveforms('G', 'PEL', '*', 'LHZ', starttime, endtime)
clients/fdsn/tests/test_client.py:353:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
clients/fdsn/client.py:859: in get_waveforms
data_stream = self._download(url, use_gzip=False)
clients/fdsn/client.py:1412: in _download
raise_on_error(code, data)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
code = 204, data = <_io.BytesIO object at 0x7ff242edc130>
def raise_on_error(code, data):
"""
Raise an error for non-200 HTTP response codes
:type code: int
:param code: HTTP response code
:type data: :class:`io.BytesIO`
:param data: Data returned by the server
"""
# get detailed server response message
if code != 200:
try:
server_info = data.read()
except Exception:
server_info = None
else:
server_info = server_info.decode('ASCII', errors='ignore')
if server_info:
server_info = "\n".join(
line for line in server_info.splitlines() if line)
# No data.
if code == 204:
> raise FDSNNoDataException("No data available for request.",
E obspy.clients.fdsn.header.FDSNNoDataException: No data available for request.
E HTTP Status code: 204
E Detailed response of server:
clients/fdsn/client.py:1742: FDSNNoDataException
self = <obspy.clients.fdsn.tests.test_eidaws_routing_client.EIDAWSRoutingClientTestCase testMethod=test_get_waveforms_integration_test>
def test_get_waveforms_integration_test(self):
"""
Integration test that does not mock anything but actually downloads
things.
"""
st = self.client.get_waveforms(
network="B*", station="*", location="*", channel="LHZ",
starttime=obspy.UTCDateTime(2017, 1, 1),
endtime=obspy.UTCDateTime(2017, 1, 1, 0, 1))
# This yields 1 channel at the time of writing this test - I assume
# it is unlikely to every yield less. So this test should be fairly
# stable.
> self.assertGreaterEqual(len(st), 1)
E AssertionError: 0 not greater than or equal to 1
clients/fdsn/tests/test_eidaws_routing_client.py:326: AssertionError
self = <obspy.clients.fdsn.tests.test_mass_downloader.ClientDownloadHelperTestCase testMethod=test_download_mseed>, patch_check_data = <MagicMock name='_check_downloaded_data' id='140678621470928'>
patch_download_mseed = <MagicMock name='download_and_split_mseed_bulk' id='140678621454880'>
@mock.patch("obspy.clients.fdsn.mass_downloader."
"utils.download_and_split_mseed_bulk")
@mock.patch("obspy.clients.fdsn.mass_downloader."
"download_helpers.ClientDownloadHelper._check_downloaded_data")
def test_download_mseed(self, patch_check_data, patch_download_mseed):
"""
Test the helper object that downloads from a client.
"""
patch_check_data.return_value = (20, 5)
st = obspy.UTCDateTime(2015, 1, 1)
time_intervals = [
TimeInterval(st + _i * 1800, st + (_i + 1) * 1800)
for _i in range(10)]
for _i in time_intervals:
_i.status = STATUS.NEEDS_DOWNLOADING
c1 = Channel(location="", channel="BHZ",
intervals=copy.copy(time_intervals))
c2 = Channel(location="00", channel="EHE",
intervals=copy.copy(time_intervals))
channels = [c1, c2]
# Create a client with a number of stations and channels.
c = self._init_client()
c.stations = {
("A", "A"): Station("A", "A", 0, 10, copy.deepcopy(channels)),
("B", "B"): Station("B", "B", 0, 20, copy.deepcopy(channels)),
("C", "C"): Station("C", "C", 0, 30, copy.deepcopy(channels)),
("D", "D"): Station("D", "D", 0, 40, copy.deepcopy(channels)),
("E", "E"): Station("E", "E", 0, 40, copy.deepcopy(channels)),
("F", "F"): Station("F", "F", 0, 40, copy.deepcopy(channels))}
c.download_mseed()
# Check data should be called once, and download mseed at least once
# with each chunk all in all.
self.assertEqual(patch_check_data.call_count, 1)
self.assertTrue(patch_download_mseed.call_count >= 1)
# 6 stations with 2 channels with 10 time intervals each.
bulk_count = sum([
len(_i[0][2]) for _i in patch_download_mseed.call_args_list])
self.assertEqual(bulk_count, 120)
# Exotic band codes to trigger some rarer code paths.
patch_check_data.reset_mock()
patch_download_mseed.reset_mock()
st = obspy.UTCDateTime(2015, 1, 1)
time_intervals = [
TimeInterval(st + _i * 1800, st + (_i + 1) * 1800)
for _i in range(10)]
# Only the first five will require downloading.
for _i in time_intervals[:5]:
_i.status = STATUS.NEEDS_DOWNLOADING
c1 = Channel(location="", channel="XHZ",
intervals=copy.copy(time_intervals))
c2 = Channel(location="00", channel="EHE",
intervals=copy.copy(time_intervals))
channels = [c1, c2]
# Create a client with a number of stations and channels.
c = self._init_client()
c.stations = {
("A", "A"): Station("A", "A", 0, 10, copy.deepcopy(channels)),
("B", "B"): Station("B", "B", 0, 20, copy.deepcopy(channels)),
("C", "C"): Station("C", "C", 0, 30, copy.deepcopy(channels)),
("D", "D"): Station("D", "D", 0, 40, copy.deepcopy(channels)),
("E", "E"): Station("E", "E", 0, 40, copy.deepcopy(channels)),
("F", "F"): Station("F", "F", 0, 40, copy.deepcopy(channels))}
c.download_mseed()
# Check data should be called once, and download mseed at least once
# with each chunk all in all.
self.assertEqual(patch_check_data.call_count, 1)
self.assertTrue(patch_download_mseed.call_count >= 1)
# 6 stations with 2 channels with 10 time intervals each. But only 5
# intervals require downloading for each.
bulk_count = sum([
len(_i[0][2]) for _i in patch_download_mseed.call_args_list])
self.assertEqual(bulk_count, 60)
# Nothing to do when no stations exist.
patch_check_data.reset_mock()
patch_download_mseed.reset_mock()
c = self._init_client()
c.download_mseed()
self.assertEqual(patch_check_data.call_count, 0)
self.assertEqual(patch_download_mseed.call_count, 0)
# Last one to trigger a bit of exception handling.
patch_check_data.reset_mock()
patch_download_mseed.reset_mock()
c = self._init_client()
c.stations = {
("A", "A"): Station("A", "A", 0, 10, copy.deepcopy(channels))
}
patch_download_mseed.side_effect = socket_timeout("Nooooo")
c.download_mseed()
self.assertEqual(patch_check_data.call_count, 1)
self.assertEqual(patch_download_mseed.call_count, 1)
# The error logger should have been called once
self.assertEqual(c.logger.error.call_count, 1)
patch_check_data.reset_mock()
patch_download_mseed.reset_mock()
c.logger.reset_mock()
c = self._init_client()
c.stations = {
("A", "A"): Station("A", "A", 0, 10, copy.deepcopy(channels))
}
patch_download_mseed.side_effect = socket_timeout("no data available")
c.download_mseed()
self.assertEqual(patch_check_data.call_count, 1)
self.assertEqual(patch_download_mseed.call_count, 1)
# The error logger should not have been called as no data available
# is just an info message.
self.assertEqual(c.logger.error.call_count, 0)
patch_check_data.reset_mock()
patch_download_mseed.reset_mock()
c = self._init_client()
c.stations = {
("A", "A"): Station("A", "A", 0, 10, copy.deepcopy(channels))
}
patch_download_mseed.side_effect = HTTPException("disconnected")
> c.download_mseed()
clients/fdsn/tests/test_mass_downloader.py:2181:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
clients/fdsn/mass_downloader/download_helpers.py:867: in download_mseed
pool.map(
/home/derrick/anaconda3/lib/python3.8/multiprocessing/pool.py:364: in map
return self._map_async(func, iterable, mapstar, chunksize).get()
/home/derrick/anaconda3/lib/python3.8/multiprocessing/pool.py:771: in get
raise self._value
/home/derrick/anaconda3/lib/python3.8/multiprocessing/pool.py:125: in worker
result = (True, func(*args, **kwds))
/home/derrick/anaconda3/lib/python3.8/multiprocessing/pool.py:48: in mapstar
return list(map(*args))
clients/fdsn/mass_downloader/download_helpers.py:853: in star_download_mseed
ret_val = utils.download_and_split_mseed_bulk(
/home/derrick/anaconda3/lib/python3.8/unittest/mock.py:1081: in __call__
return self._mock_call(*args, **kwargs)
/home/derrick/anaconda3/lib/python3.8/unittest/mock.py:1085: in _mock_call
return self._execute_mock_call(*args, **kwargs)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <MagicMock name='download_and_split_mseed_bulk' id='140678621454880'>
args = (<MagicMock id='140678624130240'>, 'Test', [('A', 'A', '', 'XHZ', UTCDateTime(2015, 1, 1, 0, 0), UTCDateTime(2015, 1, ... 1, 1, 2, 30), ...), ('A', 'A', '00', 'EHE', UTCDateTime(2015, 1, 1, 0, 0), UTCDateTime(2015, 1, 1, 0, 30), ...), ...])
kwargs = {'logger': <MagicMock id='140678621381296'>}, effect = HTTPException('disconnected')
def _execute_mock_call(self, /, *args, **kwargs):
# separate from _increment_mock_call so that awaited functions are
# executed separately from their call, also AsyncMock overrides this method
effect = self.side_effect
if effect is not None:
if _is_exception(effect):
> raise effect
E http.client.HTTPException: disconnected
/home/derrick/anaconda3/lib/python3.8/unittest/mock.py:1140: HTTPException
923 .. rubric:: Examples
924
925 (1) Returning frequency, amplitude, phase of first point.
926
927 >>> from obspy.clients.iris import Client
928 >>> client = Client()
929 >>> dt = UTCDateTime("2005-01-01")
930 >>> data = client.evalresp("IU", "ANMO", "00", "BHZ", dt,
931 ... output='fap')
932 >>> data[0] # frequency, amplitude, phase of first point
Expected:
array([ 1.00000000e-05, 1.05599900e+04, 1.79200700e+02])
Got:
array([ 1.00000000e-05, 1.05593400e+04, 1.79200700e+02])
/media/data/Gits/obspy/obspy/clients/iris/client.py:932: DocTestFailure
474 is given.
475
476 .. rubric:: Example
477
478 >>> from obspy.clients.iris import Client
479 >>> from obspy import UTCDateTime
480 >>> client = Client()
481 >>> dt = UTCDateTime("2005-01-01")
482 >>> sacpz = client.sacpz("IU", "ANMO", "00", "BHZ", dt)
483 >>> print(sacpz.decode()) # doctest: +ELLIPSIS +NORMALIZE_WHITESPACE
Differences (unified diff with -expected +actual):
@@ -4,10 +4,10 @@
* LOCATION (KHOLE): 00
* CHANNEL (KCMPNM): BHZ
-* CREATED : ...
+* CREATED : 2022-01-10T02:12:12
* START : 2002-11-19T21:07:00
* END : 2008-06-30T00:00:00
* DESCRIPTION : Albuquerque, New Mexico, USA
-* LATITUDE : 34.945980
-* LONGITUDE : -106.457130
+* LATITUDE : 34.945981
+* LONGITUDE : -106.457133
* ELEVATION : 1671.0
* DEPTH : 145.0
@@ -19,21 +19,22 @@
* INSTTYPE : Geotech KS-54000 Borehole Seismometer
* INSTGAIN : 1.935000e+03 (M/S)
-* COMMENT :
-* SENSITIVITY : 8.115970e+08 (M/S)
-* A0 : 8.608300e+04
+* COMMENT :
+* SENSITIVITY : 8.115480e+08 (M/S)
+* A0 : 8.607770e+04
* **********************************
-ZEROS 3
- +0.000000e+00 +0.000000e+00
- +0.000000e+00 +0.000000e+00
- +0.000000e+00 +0.000000e+00
-POLES 5
- -5.943130e+01 +0.000000e+00
- -2.271210e+01 +2.710650e+01
- -2.271210e+01 -2.710650e+01
- -4.800400e-03 +0.000000e+00
- -7.319900e-02 +0.000000e+00
-CONSTANT 6.986470e+13
+ZEROS	3
+	+0.000000e+00	+0.000000e+00	
+	+0.000000e+00	+0.000000e+00	
+	+0.000000e+00	+0.000000e+00	
+POLES	5
+	-4.800400e-03	+0.000000e+00	
+	-7.319900e-02	+0.000000e+00	
+	-2.271210e+01	-2.710650e+01	
+	-2.271210e+01	+2.710650e+01	
+	-5.943130e+01	+0.000000e+00	
+CONSTANT	6.985619e+13
<BLANKLINE>
<BLANKLINE>
<BLANKLINE>
-...
+<BLANKLINE>
+<BLANKLINE>
/media/data/Gits/obspy/obspy/clients/iris/client.py:483: DocTestFailure
302 >>> from obspy.clients.iris import Client
303 >>> from obspy import UTCDateTime
304 >>> dt = UTCDateTime("2005-01-01T00:00:00")
305 >>> client = Client()
306 >>> st = client.timeseries("IU", "ANMO", "00", "BHZ", dt, dt+10)
307 >>> print(st[0].data) # doctest: +ELLIPSIS
308 [ 24 20 19 19 19 15 10 4 -4 -11 ...
309 >>> st = client.timeseries("IU", "ANMO", "00", "BHZ", dt, dt+10,
310 ... filter=["correct", "demean", "lp=2.0"])
311 >>> print(st[0].data) # doctest: +ELLIPSIS
Expected:
[ -1.57488682e-06 -1.26318002e-06 -7.84807128e-07 ...
Got:
[ -1.57498380e-06 -1.26325779e-06 -7.84855445e-07 -2.73597749e-07
1.49651157e-07 4.15160798e-07 5.13905604e-07 4.83453846e-07
3.82808793e-07 2.68396462e-07 1.78712199e-07 1.29611124e-07
1.18055056e-07 1.30188894e-07 1.49717962e-07 1.63909334e-07
1.66248356e-07 1.56169492e-07 1.37032302e-07 1.13625617e-07
9.01527812e-08 6.91435815e-08 5.12837559e-08 3.58787240e-08
2.15880380e-08 7.12111747e-09 -8.30076807e-09 -2.47867753e-08
-4.18850163e-08 -5.88481193e-08 -7.49276197e-08 -8.95957797e-08
-1.02641835e-07 -1.14140065e-07 -1.24328977e-07 -1.33465406e-07
-1.41714565e-07 -1.49109766e-07 -1.55579201e-07 -1.61010249e-07
-1.65313111e-07 -1.68455784e-07 -1.70464261e-07 -1.71401581e-07
-1.71345818e-07 -1.70377618e-07 -1.68577216e-07 -1.66025856e-07
-1.62806785e-07 -1.59002880e-07 -1.54692586e-07 -1.49950907e-07
-1.44858731e-07 -1.39513119e-07 -1.34025541e-07 -1.28505050e-07
-1.23038518e-07 -1.17682283e-07 -1.12466232e-07 -1.07400879e-07
-1.02480548e-07 -9.76858487e-08 -9.29923942e-08 -8.83872104e-08
-8.38864977e-08 -7.95416781e-08 -7.54220366e-08 -7.15768351e-08
-6.79996646e-08 -6.46219007e-08 -6.13424831e-08 -5.80760755e-08
-5.47916663e-08 -5.15201179e-08 -4.83238480e-08 -4.52400428e-08
-4.22268691e-08 -3.91482295e-08 -3.58147858e-08 -3.20657350e-08
-2.78491150e-08 -2.32567050e-08 -1.84924538e-08 -1.37877505e-08
-9.30553679e-09 -5.08293407e-09 -1.04185749e-09 2.94031643e-09
6.94010183e-09 1.09256426e-08 1.47523451e-08 1.82121269e-08
2.11040430e-08 2.32887629e-08 2.47070222e-08 2.53666883e-08
2.53170054e-08 2.46268197e-08 2.33717188e-08 2.16230269e-08
1.94298995e-08 1.67974488e-08 1.36770684e-08 9.98366367e-09
5.63695890e-09 6.05533790e-10 -5.07076026e-09 -1.12896599e-08
-1.79169195e-08 -2.48200855e-08 -3.18936770e-08 -3.90750259e-08
-4.63542804e-08 -5.37781659e-08 -6.14443394e-08 -6.94850399e-08
-7.80407845e-08 -8.72237038e-08 -9.70718688e-08 -1.07505542e-07
-1.18305088e-07 -1.29127912e-07 -1.39567632e-07 -1.49241075e-07
-1.57875803e-07 -1.65368178e-07 -1.71790631e-07 -1.77345939e-07
-1.82285021e-07 -1.86816635e-07 -1.91038268e-07 -1.94909887e-07
-1.98274606e-07 -2.00912226e-07 -2.02602905e-07 -2.03182779e-07
-2.02579315e-07 -2.00817880e-07 -1.97997124e-07 -1.94244009e-07
-1.89668327e-07 -1.84332833e-07 -1.78246282e-07 -1.71378986e-07
-1.63693031e-07 -1.55171691e-07 -1.45833766e-07 -1.35728754e-07
-1.24919623e-07 -1.13462782e-07 -1.01392523e-07 -8.87162628e-08
-7.54257243e-08 -6.15244531e-08 -4.70620378e-08 -3.21568336e-08
-1.69910290e-08 -1.77754611e-09 1.32849225e-08 2.80474115e-08
4.24236646e-08 5.63785001e-08 6.98959539e-08 8.29372269e-08
9.54061861e-08 1.07142199e-07 1.17947948e-07 1.27638174e-07
1.36082292e-07 1.43220930e-07 1.49057399e-07 1.53640656e-07
1.57056789e-07 1.59433057e-07 1.60944580e-07 1.61806696e-07
1.62240426e-07 1.62410657e-07 1.62353814e-07 1.61927488e-07
1.60818345e-07 1.58627600e-07 1.55018085e-07 1.49873983e-07
1.43409324e-07 1.36168694e-07 1.28890449e-07 1.22247044e-07
1.16532007e-07 1.11410550e-07 1.05866313e-07 9.84378161e-08
8.77439135e-08 7.31660279e-08 5.54251933e-08 3.67202624e-08
2.01523722e-08 8.42484038e-09 2.32815922e-09 3.11318193e-10]
/media/data/Gits/obspy/obspy/clients/iris/client.py:311: DocTestFailure
self = <obspy.clients.iris.tests.test_client.ClientTestCase testMethod=test_evalresp>
def test_evalresp(self):
"""
Tests evaluating instrument response information.
"""
client = Client()
dt = UTCDateTime("2005-01-01")
# plot as PNG file
with NamedTemporaryFile() as tf:
tempfile = tf.name
client.evalresp(network="IU", station="ANMO", location="00",
channel="BHZ", time=dt, output='plot',
filename=tempfile)
with open(tempfile, 'rb') as fp:
self.assertEqual(fp.read(4)[1:4], b'PNG')
# plot-amp as PNG file
with NamedTemporaryFile() as tf:
tempfile = tf.name
client.evalresp(network="IU", station="ANMO", location="00",
channel="BHZ", time=dt, output='plot-amp',
filename=tempfile)
with open(tempfile, 'rb') as fp:
self.assertEqual(fp.read(4)[1:4], b'PNG')
# plot-phase as PNG file
with NamedTemporaryFile() as tf:
tempfile = tf.name
client.evalresp(network="IU", station="ANMO", location="00",
channel="BHZ", time=dt, output='plot-phase',
filename=tempfile)
with open(tempfile, 'rb') as fp:
self.assertEqual(fp.read(4)[1:4], b'PNG')
# fap as ASCII file
with NamedTemporaryFile() as tf:
tempfile = tf.name
client.evalresp(network="IU", station="ANMO", location="00",
channel="BHZ", time=dt, output='fap',
filename=tempfile)
with open(tempfile, 'rt') as fp:
> self.assertEqual(fp.readline(),
'1.000000E-05 1.055999E+04 1.792007E+02\n')
E AssertionError: '1.000000E-05 1.055934E+04 1.792007E+02\n' != '1.000000E-05 1.055999E+04 1.792007E+02\n'
E - 1.000000E-05 1.055934E+04 1.792007E+02
E ? ^^
E + 1.000000E-05 1.055999E+04 1.792007E+02
E ? ^^
clients/iris/tests/test_client.py:167: AssertionError
self = <obspy.clients.iris.client.Client object at 0x7ff24b5e8a30>, network = 'UW', station = 'LON', location = '', channel = 'EHZ', starttime = None, endtime = None, filename = None
kwargs = {'channel': 'EHZ', 'location': '--', 'network': 'UW', 'station': 'LON'}, msg = 'No response data available (HTTPError: HTTP Error 404: )'
def resp(self, network, station, location="*", channel="*",
starttime=None, endtime=None, filename=None, **kwargs):
"""
Low-level interface for `resp` Web service of IRIS
(http://service.iris.edu/irisws/resp/) - 1.4.1 (2011-04-14).
This method provides access to channel response information in the SEED
`RESP <https://ds.iris.edu/ds/nodes/dmc/kb/questions/60>`_
format (as used by evalresp). Users can query for channel response by
network, station, channel, location and time.
:type network: str
:param network: Network code, e.g. ``'IU'``.
:type station: str
:param station: Station code, e.g. ``'ANMO'``.
:type location: str, optional
:param location: Location code, e.g. ``'00'``, wildcards allowed.
Defaults to ``'*'``.
:type channel: str, optional
:param channel: Channel code, e.g. ``'BHZ'``, wildcards allowed.
Defaults to ``'*'``.
**Temporal constraints**
The following three parameters impose time constraints on the query.
Time may be requested through the use of either time OR the start and
end times. If no time is specified, then the current time is assumed.
:type time: :class:`~obspy.core.utcdatetime.UTCDateTime`, optional
:param time: Find the response for the given time. Time cannot be used
with ``starttime`` or ``endtime`` parameters
:type starttime: :class:`~obspy.core.utcdatetime.UTCDateTime`, optional
:param starttime: Start time, may be used in conjunction with
``endtime``.
:type endtime: :class:`~obspy.core.utcdatetime.UTCDateTime`, optional
:param endtime: End time, may be used in conjunction with
``starttime``.
:type filename: str, optional
:param filename: Name of a output file. If this parameter is given
nothing will be returned. Default is ``None``.
:rtype: str or ``None``
:return: SEED RESP file as string if no ``filename`` is given..
.. rubric:: Example
>>> from obspy.clients.iris import Client
>>> from obspy import UTCDateTime
>>> client = Client()
>>> dt = UTCDateTime("2010-02-27T06:30:00.000")
>>> data = client.resp("IU", "ANMO", "00", "BHZ", dt)
>>> print(data.decode()) # doctest: +ELLIPSIS
#
####################################################################...
#
B050F03 Station: ANMO
B050F16 Network: IU
B052F03 Location: 00
B052F04 Channel: BHZ
...
"""
kwargs['network'] = str(network)
kwargs['station'] = str(station)
if location:
kwargs['location'] = str(location)[0:2]
else:
kwargs['location'] = '--'
kwargs['channel'] = str(channel)
# convert UTCDateTime to string for query
if starttime and endtime:
try:
kwargs['starttime'] = \
UTCDateTime(starttime).format_iris_web_service()
except Exception:
kwargs['starttime'] = starttime
try:
kwargs['endtime'] = \
UTCDateTime(endtime).format_iris_web_service()
except Exception:
kwargs['endtime'] = endtime
elif 'time' in kwargs:
try:
kwargs['time'] = \
UTCDateTime(kwargs['time']).format_iris_web_service()
except Exception:
pass
# build up query
try:
> data = self._fetch("resp", **kwargs)
clients/iris/client.py:437:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <obspy.clients.iris.client.Client object at 0x7ff24b5e8a30>, service = 'resp', data = None
headers = {'User-Agent': 'ObsPy/1.2.2.post0+552.g2503ab491e.dirty (Linux-5.11.0-44-generic-x86_64-with-glibc2.10, Python 3.8.5)'}, param_list = []
params = {'channel': 'EHZ', 'location': '--', 'network': 'UW', 'station': 'LON'}, remoteaddr = 'http://service.iris.edu/irisws/resp/1/query?network=UW&station=LON&location=--&channel=EHZ'
options = 'network=UW&station=LON&location=--&channel=EHZ', req = <urllib.request.Request object at 0x7ff24b3ca760>
def _fetch(self, service, data=None, headers={}, param_list=[], **params):
"""
Send a HTTP request via urllib2.
:type service: str
:param service: Name of service
:type data: str
:param data: Channel list as returned by `availability` Web service
:type headers: dict, optional
:param headers: Additional header information for request
"""
headers['User-Agent'] = self.user_agent
# replace special characters
remoteaddr = "/".join([self.base_url.rstrip("/"), service,
str(self.major_versions[service]), "query"])
options = '&'.join(param_list)
if params:
if options:
options += '&'
options += urlencode(params)
if options:
remoteaddr = "%s?%s" % (remoteaddr, options)
if self.debug:
print('\nRequesting %s' % (remoteaddr))
req = urllib_request.Request(url=remoteaddr, data=data,
headers=headers)
> response = urllib_request.urlopen(req, timeout=self.timeout)
clients/iris/client.py:124:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
url = <urllib.request.Request object at 0x7ff24b3ca760>, data = None, timeout = 20
def urlopen(url, data=None, timeout=socket._GLOBAL_DEFAULT_TIMEOUT,
*, cafile=None, capath=None, cadefault=False, context=None):
'''Open the URL url, which can be either a string or a Request object.
*data* must be an object specifying additional data to be sent to
the server, or None if no such data is needed. See Request for
details.
urllib.request module uses HTTP/1.1 and includes a "Connection:close"
header in its HTTP requests.
The optional *timeout* parameter specifies a timeout in seconds for
blocking operations like the connection attempt (if not specified, the
global default timeout setting will be used). This only works for HTTP,
HTTPS and FTP connections.
If *context* is specified, it must be a ssl.SSLContext instance describing
the various SSL options. See HTTPSConnection for more details.
The optional *cafile* and *capath* parameters specify a set of trusted CA
certificates for HTTPS requests. cafile should point to a single file
containing a bundle of CA certificates, whereas capath should point to a
directory of hashed certificate files. More information can be found in
ssl.SSLContext.load_verify_locations().
The *cadefault* parameter is ignored.
This function always returns an object which can work as a context
manager and has methods such as
* geturl() - return the URL of the resource retrieved, commonly used to
determine if a redirect was followed
* info() - return the meta-information of the page, such as headers, in the
form of an email.message_from_string() instance (see Quick Reference to
HTTP Headers)
* getcode() - return the HTTP status code of the response. Raises URLError
on errors.
For HTTP and HTTPS URLs, this function returns a http.client.HTTPResponse
object slightly modified. In addition to the three new methods above, the
msg attribute contains the same information as the reason attribute ---
the reason phrase returned by the server --- instead of the response
headers as it is specified in the documentation for HTTPResponse.
For FTP, file, and data URLs and requests explicitly handled by legacy
URLopener and FancyURLopener classes, this function returns a
urllib.response.addinfourl object.
Note that None may be returned if no handler handles the request (though
the default installed global OpenerDirector uses UnknownHandler to ensure
this never happens).
In addition, if proxy settings are detected (for example, when a *_proxy
environment variable like http_proxy is set), ProxyHandler is default
installed and makes sure the requests are handled through the proxy.
'''
global _opener
if cafile or capath or cadefault:
import warnings
warnings.warn("cafile, capath and cadefault are deprecated, use a "
"custom context instead.", DeprecationWarning, 2)
if context is not None:
raise ValueError(
"You can't pass both context and any of cafile, capath, and "
"cadefault"
)
if not _have_ssl:
raise ValueError('SSL support not available')
context = ssl.create_default_context(ssl.Purpose.SERVER_AUTH,
cafile=cafile,
capath=capath)
https_handler = HTTPSHandler(context=context)
opener = build_opener(https_handler)
elif context:
https_handler = HTTPSHandler(context=context)
opener = build_opener(https_handler)
elif _opener is None:
_opener = opener = build_opener()
else:
opener = _opener
> return opener.open(url, data, timeout)
/home/derrick/anaconda3/lib/python3.8/urllib/request.py:222:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <urllib.request.OpenerDirector object at 0x7ff24b5e8dc0>, fullurl = <urllib.request.Request object at 0x7ff24b3ca760>, data = None, timeout = 20
def open(self, fullurl, data=None, timeout=socket._GLOBAL_DEFAULT_TIMEOUT):
# accept a URL or a Request object
if isinstance(fullurl, str):
req = Request(fullurl, data)
else:
req = fullurl
if data is not None:
req.data = data
req.timeout = timeout
protocol = req.type
# pre-process request
meth_name = protocol+"_request"
for processor in self.process_request.get(protocol, []):
meth = getattr(processor, meth_name)
req = meth(req)
sys.audit('urllib.Request', req.full_url, req.data, req.headers, req.get_method())
response = self._open(req, data)
# post-process response
meth_name = protocol+"_response"
for processor in self.process_response.get(protocol, []):
meth = getattr(processor, meth_name)
> response = meth(req, response)
/home/derrick/anaconda3/lib/python3.8/urllib/request.py:531:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <urllib.request.HTTPErrorProcessor object at 0x7ff24b3c62b0>, request = <urllib.request.Request object at 0x7ff24b3ca760>, response = <http.client.HTTPResponse object at 0x7ff24b3ca490>
def http_response(self, request, response):
code, msg, hdrs = response.code, response.msg, response.info()
# According to RFC 2616, "2xx" code indicates that the client's
# request was successfully received, understood, and accepted.
if not (200 <= code < 300):
> response = self.parent.error(
'http', request, response, code, msg, hdrs)
/home/derrick/anaconda3/lib/python3.8/urllib/request.py:640:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <urllib.request.OpenerDirector object at 0x7ff24b5e8dc0>, proto = 404
args = ({'default': [<urllib.request.HTTPDefaultErrorHandler object at 0x7ff24b5e8310>], 301: [<urllib.request.HTTPRedirectHa...ult', <urllib.request.Request object at 0x7ff24b3ca760>, <http.client.HTTPResponse object at 0x7ff24b3ca490>, 404, ...)
dict = {'default': [<urllib.request.HTTPDefaultErrorHandler object at 0x7ff24b5e8310>], 301: [<urllib.request.HTTPRedirectHan...PRedirectHandler object at 0x7ff24b5e8520>], 303: [<urllib.request.HTTPRedirectHandler object at 0x7ff24b5e8520>], ...}
meth_name = 'http_error_404', http_err = 1
def error(self, proto, *args):
if proto in ('http', 'https'):
# XXX http[s] protocols are special-cased
dict = self.handle_error['http'] # https is not different than http
proto = args[2] # YUCK!
meth_name = 'http_error_%s' % proto
http_err = 1
orig_args = args
else:
dict = self.handle_error
meth_name = proto + '_error'
http_err = 0
args = (dict, proto, meth_name) + args
result = self._call_chain(*args)
if result:
return result
if http_err:
args = (dict, 'default', 'http_error_default') + orig_args
> return self._call_chain(*args)
/home/derrick/anaconda3/lib/python3.8/urllib/request.py:569:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <urllib.request.OpenerDirector object at 0x7ff24b5e8dc0>
chain = {'default': [<urllib.request.HTTPDefaultErrorHandler object at 0x7ff24b5e8310>], 301: [<urllib.request.HTTPRedirectHan...PRedirectHandler object at 0x7ff24b5e8520>], 303: [<urllib.request.HTTPRedirectHandler object at 0x7ff24b5e8520>], ...}
kind = 'default', meth_name = 'http_error_default'
args = (<urllib.request.Request object at 0x7ff24b3ca760>, <http.client.HTTPResponse object at 0x7ff24b3ca490>, 404, '', <http.client.HTTPMessage object at 0x7ff24b3d7430>)
handlers = [<urllib.request.HTTPDefaultErrorHandler object at 0x7ff24b5e8310>], handler = <urllib.request.HTTPDefaultErrorHandler object at 0x7ff24b5e8310>
func = <bound method HTTPDefaultErrorHandler.http_error_default of <urllib.request.HTTPDefaultErrorHandler object at 0x7ff24b5e8310>>
def _call_chain(self, chain, kind, meth_name, *args):
# Handlers raise an exception if no one else should try to handle
# the request, or return None if they can't but another handler
# could. Otherwise, they return the response.
handlers = chain.get(kind, ())
for handler in handlers:
func = getattr(handler, meth_name)
> result = func(*args)
/home/derrick/anaconda3/lib/python3.8/urllib/request.py:502:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <urllib.request.HTTPDefaultErrorHandler object at 0x7ff24b5e8310>, req = <urllib.request.Request object at 0x7ff24b3ca760>, fp = <http.client.HTTPResponse object at 0x7ff24b3ca490>, code = 404, msg = ''
hdrs = <http.client.HTTPMessage object at 0x7ff24b3d7430>
def http_error_default(self, req, fp, code, msg, hdrs):
> raise HTTPError(req.full_url, code, msg, hdrs, fp)
E urllib.error.HTTPError: HTTP Error 404:
/home/derrick/anaconda3/lib/python3.8/urllib/request.py:649: HTTPError
During handling of the above exception, another exception occurred:
self = <obspy.clients.iris.tests.test_client.ClientTestCase testMethod=test_resp>
def test_resp(self):
"""
Tests resp Web service interface.
Examples are inspired by https://service.iris.edu/irisws/resp/1/.
"""
client = Client()
# 1
t1 = UTCDateTime("2005-001T00:00:00")
t2 = UTCDateTime("2008-001T00:00:00")
result = client.resp("IU", "ANMO", "00", "BHZ", t1, t2)
self.assertIn(b'B050F03 Station: ANMO', result)
# 2 - empty location code
> result = client.resp("UW", "LON", "", "EHZ")
clients/iris/tests/test_client.py:238:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <obspy.clients.iris.client.Client object at 0x7ff24b5e8a30>, network = 'UW', station = 'LON', location = '', channel = 'EHZ', starttime = None, endtime = None, filename = None
kwargs = {'channel': 'EHZ', 'location': '--', 'network': 'UW', 'station': 'LON'}, msg = 'No response data available (HTTPError: HTTP Error 404: )'
def resp(self, network, station, location="*", channel="*",
starttime=None, endtime=None, filename=None, **kwargs):
"""
Low-level interface for `resp` Web service of IRIS
(http://service.iris.edu/irisws/resp/) - 1.4.1 (2011-04-14).
This method provides access to channel response information in the SEED
`RESP <https://ds.iris.edu/ds/nodes/dmc/kb/questions/60>`_
format (as used by evalresp). Users can query for channel response by
network, station, channel, location and time.
:type network: str
:param network: Network code, e.g. ``'IU'``.
:type station: str
:param station: Station code, e.g. ``'ANMO'``.
:type location: str, optional
:param location: Location code, e.g. ``'00'``, wildcards allowed.
Defaults to ``'*'``.
:type channel: str, optional
:param channel: Channel code, e.g. ``'BHZ'``, wildcards allowed.
Defaults to ``'*'``.
**Temporal constraints**
The following three parameters impose time constraints on the query.
Time may be requested through the use of either time OR the start and
end times. If no time is specified, then the current time is assumed.
:type time: :class:`~obspy.core.utcdatetime.UTCDateTime`, optional
:param time: Find the response for the given time. Time cannot be used
with ``starttime`` or ``endtime`` parameters
:type starttime: :class:`~obspy.core.utcdatetime.UTCDateTime`, optional
:param starttime: Start time, may be used in conjunction with
``endtime``.
:type endtime: :class:`~obspy.core.utcdatetime.UTCDateTime`, optional
:param endtime: End time, may be used in conjunction with
``starttime``.
:type filename: str, optional
:param filename: Name of a output file. If this parameter is given
nothing will be returned. Default is ``None``.
:rtype: str or ``None``
:return: SEED RESP file as string if no ``filename`` is given..
.. rubric:: Example
>>> from obspy.clients.iris import Client
>>> from obspy import UTCDateTime
>>> client = Client()
>>> dt = UTCDateTime("2010-02-27T06:30:00.000")
>>> data = client.resp("IU", "ANMO", "00", "BHZ", dt)
>>> print(data.decode()) # doctest: +ELLIPSIS
#
####################################################################...
#
B050F03 Station: ANMO
B050F16 Network: IU
B052F03 Location: 00
B052F04 Channel: BHZ
...
"""
kwargs['network'] = str(network)
kwargs['station'] = str(station)
if location:
kwargs['location'] = str(location)[0:2]
else:
kwargs['location'] = '--'
kwargs['channel'] = str(channel)
# convert UTCDateTime to string for query
if starttime and endtime:
try:
kwargs['starttime'] = \
UTCDateTime(starttime).format_iris_web_service()
except Exception:
kwargs['starttime'] = starttime
try:
kwargs['endtime'] = \
UTCDateTime(endtime).format_iris_web_service()
except Exception:
kwargs['endtime'] = endtime
elif 'time' in kwargs:
try:
kwargs['time'] = \
UTCDateTime(kwargs['time']).format_iris_web_service()
except Exception:
pass
# build up query
try:
data = self._fetch("resp", **kwargs)
except urllib_request.HTTPError as e:
msg = "No response data available (%s: %s)"
msg = msg % (e.__class__.__name__, e)
> raise Exception(msg)
E Exception: No response data available (HTTPError: HTTP Error 404: )
clients/iris/client.py:441: Exception
self = <obspy.clients.iris.tests.test_client.ClientTestCase testMethod=test_sacpz>
def test_sacpz(self):
"""
Fetches SAC poles and zeros information.
"""
client = Client()
# 1
t1 = UTCDateTime("2005-01-01")
t2 = UTCDateTime("2008-01-01")
result = client.sacpz("IU", "ANMO", "00", "BHZ", t1, t2)
# drop lines with creation date (current time during request)
result = result.splitlines()
sacpz_file = os.path.join(self.path, 'data', 'IU.ANMO.00.BHZ.sacpz')
with open(sacpz_file, 'rb') as fp:
expected = fp.read().splitlines()
result.pop(5)
expected.pop(5)
> self.assertEqual(result, expected)
E AssertionError: Lists differ: [b'* [330 chars]945981', b'* LONGITUDE : -106.457133',[842 chars] b''] != [b'* [330 chars]945980', b'* LONGITUDE : -106.457130',[832 chars] b'']
E
E First differing element 8:
E b'* LATITUDE : 34.945981'
E b'* LATITUDE : 34.945980'
E
E First list contains 2 additional elements.
E First extra element 36:
E b''
E
E Diff is 2012 characters long. Set self.maxDiff to None to see it.
clients/iris/tests/test_client.py:42: AssertionError
self = <obspy.clients.seedlink.tests.test_basic_client.ClientTestCase testMethod=test_get_waveform>
def test_get_waveform(self):
def _test_offset_from_realtime(offset):
t = UTCDateTime() - offset
for request in [["G", "FDFM", "00", "LHN", t, t + 20],
["G", "CLF", "00", "BHZ", t, t + 10]]:
st = self.client.get_waveforms(*request)
self.assertGreater(len(st), 0)
for tr in st:
self.assertEqual(tr.id, ".".join(request[:4]))
self.assertTrue(any([len(tr) > 0 for tr in st]))
st.merge(1)
self.assertTrue(abs(tr.stats.starttime - request[4]) < 1)
self.assertTrue(abs(tr.stats.endtime - request[5]) < 1)
for tr in st:
self.assertEqual(tr.stats.network, request[0])
self.assertEqual(tr.stats.station, request[1])
self.assertEqual(tr.stats.location, request[2])
self.assertEqual(tr.stats.channel, request[3])
# getting a result depends on two things.. how long backwards the ring
# buffer stores data and how close to realtime the data is available,
# so check some different offsets and see if we get some data
for offset in (3600, 2000, 1000, 500):
try:
> _test_offset_from_realtime(offset)
clients/seedlink/tests/test_basic_client.py:44:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
clients/seedlink/tests/test_basic_client.py:25: in _test_offset_from_realtime
st = self.client.get_waveforms(*request)
clients/seedlink/basic_client.py:149: in get_waveforms
return self._multiselect_request(multiselect, starttime, endtime)
clients/seedlink/basic_client.py:188: in _multiselect_request
self._slclient.run(packet_handler=self._packet_handler)
clients/seedlink/slclient.py:229: in run
slpack = self.slconn.collect()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <obspy.clients.seedlink.client.seedlinkconnection.SeedLinkConnection object at 0x7ff2149a43a0>
def collect(self):
"""
Manage a connection to a SeedLink server based on the values
given in this SeedLinkConnection, and to collect data.
Designed to run in a tight loop at the heart of a client program, this
function will return every time a packet is received.
If the SeedLinkConnection was initialized with a timeout, the collect()
call will be terminated if it takes longer than `self.timeout` seconds
to finish.
:return: an SLPacket when something is received.
:return: null when the connection was closed by
the server or the termination sequence completed.
:raise SeedLinkException: on error.
"""
start_ = UTCDateTime()
self.terminate_flag = False
# Check if the infoRequestString was set
if self.info_request_string is not None:
self.state.query_mode = SLState.INFO_QUERY
# If the connection is not up check this SeedLinkConnection and reset
# the timing variables
if self.socket is None or not self.is_connected():
if not self.check_slcd():
msg = "problems with the connection description"
logger.critical(msg)
> raise SeedLinkException(msg)
E obspy.clients.seedlink.seedlinkexception.SeedLinkException: 'problems with the connection description'
clients/seedlink/client/seedlinkconnection.py:740: SeedLinkException
x = array([ 4477.152 , 4477.0894, 4477.115 , 4477.3 , 4477.044 ,
4477.1665, 4476.369 , 4476.978 , 4477.3403, 4476.255 ,
4477.1504, 4476.718 ], dtype=float32)
y = array([ 5320.766 , 5320.7983, 5320.833 , 5320.5244, 5320.751 ,
5320.4287, 5321.2935, 5320.94 , 5320.359 , 5321.2085,
5320.2456, 5321.1436], dtype=float32)
z = array([ 3.2803066, 3.4327607, 3.1002367, 2.8132093, 3.6364615,
2.6630187, 3.7214792, 2.8879526, 3.237501 , 3.6953907,
3.0125103, 3.9025726], dtype=float32)
def _coordinate_conversion(x, y, z):
try:
> transformer = pyproj.Transformer.from_crs("epsg:31468", "epsg:4326",
always_xy=True)
io/nlloc/tests/test_util.py:19:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
crs_from = 'epsg:31468', crs_to = 'epsg:4326', skip_equivalent = False, always_xy = True, area_of_interest = None
@staticmethod
def from_crs(
crs_from: Any,
crs_to: Any,
skip_equivalent: bool = False,
always_xy: bool = False,
area_of_interest: Optional[AreaOfInterest] = None,
) -> "Transformer":
"""Make a Transformer from a :obj:`pyproj.crs.CRS` or input used to create one.
.. versionadded:: 2.1.2 skip_equivalent
.. versionadded:: 2.2.0 always_xy
.. versionadded:: 2.3.0 area_of_interest
Parameters
----------
crs_from: pyproj.crs.CRS or input used to create one
Projection of input data.
crs_to: pyproj.crs.CRS or input used to create one
Projection of output data.
skip_equivalent: bool, optional
If true, will skip the transformation operation if input and output
projections are equivalent. Default is false.
always_xy: bool, optional
If true, the transform method will accept as input and return as output
coordinates using the traditional GIS order, that is longitude, latitude
for geographic CRS and easting, northing for most projected CRS.
Default is false.
area_of_interest: :class:`pyproj.transformer.AreaOfInterest`, optional
The area of interest to help select the transformation.
Returns
-------
Transformer
"""
return Transformer(
_Transformer.from_crs(
> CRS.from_user_input(crs_from),
CRS.from_user_input(crs_to),
skip_equivalent=skip_equivalent,
always_xy=always_xy,
area_of_interest=area_of_interest,
)
)
/home/derrick/anaconda3/lib/python3.8/site-packages/pyproj/transformer.py:311:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
value = 'epsg:31468', kwargs = {}
@staticmethod
def from_user_input(value: Any, **kwargs) -> "CRS":
"""
Initialize a CRS class instance with:
- PROJ string
- Dictionary of PROJ parameters
- PROJ keyword arguments for parameters
- JSON string with PROJ parameters
- CRS WKT string
- An authority string [i.e. 'epsg:4326']
- An EPSG integer code [i.e. 4326]
- A tuple of ("auth_name": "auth_code") [i.e ('epsg', '4326')]
- An object with a `to_wkt` method.
- A :class:`pyproj.crs.CRS` class
Parameters
----------
value : obj
A Python int, dict, or str.
Returns
-------
CRS
"""
if isinstance(value, CRS):
return value
> return CRS(value, **kwargs)
/home/derrick/anaconda3/lib/python3.8/site-packages/pyproj/crs/crs.py:440:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <[TypeError("object of type 'NoneType' has no len()") raised in repr()] CRS object at 0x7ff1e425e220>, projparams = 'epsg:31468', kwargs = {}, projstring = 'epsg:31468'
def __init__(self, projparams: Any = None, **kwargs) -> None:
"""
Initialize a CRS class instance with:
- PROJ string
- Dictionary of PROJ parameters
- PROJ keyword arguments for parameters
- JSON string with PROJ parameters
- CRS WKT string
- An authority string [i.e. 'epsg:4326']
- An EPSG integer code [i.e. 4326]
- A tuple of ("auth_name": "auth_code") [i.e ('epsg', '4326')]
- An object with a `to_wkt` method.
- A :class:`pyproj.crs.CRS` class
Example usage:
>>> from pyproj import CRS
>>> crs_utm = CRS.from_user_input(26915)
>>> crs_utm
<Projected CRS: EPSG:26915>
Name: NAD83 / UTM zone 15N
Axis Info [cartesian]:
- E[east]: Easting (metre)
- N[north]: Northing (metre)
Area of Use:
- name: North America - 96°W to 90°W and NAD83 by country
- bounds: (-96.0, 25.61, -90.0, 84.0)
Coordinate Operation:
- name: UTM zone 15N
- method: Transverse Mercator
Datum: North American Datum 1983
- Ellipsoid: GRS 1980
- Prime Meridian: Greenwich
<BLANKLINE>
>>> crs_utm.area_of_use.bounds
(-96.0, 25.61, -90.0, 84.0)
>>> crs_utm.ellipsoid
ELLIPSOID["GRS 1980",6378137,298.257222101,
LENGTHUNIT["metre",1],
ID["EPSG",7019]]
>>> crs_utm.ellipsoid.inverse_flattening
298.257222101
>>> crs_utm.ellipsoid.semi_major_metre
6378137.0
>>> crs_utm.ellipsoid.semi_minor_metre
6356752.314140356
>>> crs_utm.prime_meridian
PRIMEM["Greenwich",0,
ANGLEUNIT["degree",0.0174532925199433],
ID["EPSG",8901]]
>>> crs_utm.prime_meridian.unit_name
'degree'
>>> crs_utm.prime_meridian.unit_conversion_factor
0.017453292519943295
>>> crs_utm.prime_meridian.longitude
0.0
>>> crs_utm.datum
DATUM["North American Datum 1983",
ELLIPSOID["GRS 1980",6378137,298.257222101,
LENGTHUNIT["metre",1]],
ID["EPSG",6269]]
>>> crs_utm.coordinate_system
CS[Cartesian,2],
AXIS["(E)",east,
ORDER[1],
LENGTHUNIT["metre",1,
ID["EPSG",9001]]],
AXIS["(N)",north,
ORDER[2],
LENGTHUNIT["metre",1,
ID["EPSG",9001]]]
>>> print(crs_utm.coordinate_operation.to_wkt(pretty=True))
CONVERSION["UTM zone 15N",
METHOD["Transverse Mercator",
ID["EPSG",9807]],
PARAMETER["Latitude of natural origin",0,
ANGLEUNIT["degree",0.0174532925199433],
ID["EPSG",8801]],
PARAMETER["Longitude of natural origin",-93,
ANGLEUNIT["degree",0.0174532925199433],
ID["EPSG",8802]],
PARAMETER["Scale factor at natural origin",0.9996,
SCALEUNIT["unity",1],
ID["EPSG",8805]],
PARAMETER["False easting",500000,
LENGTHUNIT["metre",1],
ID["EPSG",8806]],
PARAMETER["False northing",0,
LENGTHUNIT["metre",1],
ID["EPSG",8807]],
ID["EPSG",16015]]
>>> crs = CRS(proj='utm', zone=10, ellps='WGS84')
>>> print(crs.to_wkt(pretty=True))
PROJCRS["unknown",
BASEGEOGCRS["unknown",
DATUM["Unknown based on WGS84 ellipsoid",
ELLIPSOID["WGS 84",6378137,298.257223563,
LENGTHUNIT["metre",1],
ID["EPSG",7030]]],
PRIMEM["Greenwich",0,
ANGLEUNIT["degree",0.0174532925199433],
ID["EPSG",8901]]],
CONVERSION["UTM zone 10N",
METHOD["Transverse Mercator",
ID["EPSG",9807]],
PARAMETER["Latitude of natural origin",0,
ANGLEUNIT["degree",0.0174532925199433],
ID["EPSG",8801]],
PARAMETER["Longitude of natural origin",-123,
ANGLEUNIT["degree",0.0174532925199433],
ID["EPSG",8802]],
PARAMETER["Scale factor at natural origin",0.9996,
SCALEUNIT["unity",1],
ID["EPSG",8805]],
PARAMETER["False easting",500000,
LENGTHUNIT["metre",1],
ID["EPSG",8806]],
PARAMETER["False northing",0,
LENGTHUNIT["metre",1],
ID["EPSG",8807]],
ID["EPSG",16010]],
CS[Cartesian,2],
AXIS["(E)",east,
ORDER[1],
LENGTHUNIT["metre",1,
ID["EPSG",9001]]],
AXIS["(N)",north,
ORDER[2],
LENGTHUNIT["metre",1,
ID["EPSG",9001]]]]
>>> geod = crs.get_geod()
>>> "+a={:.0f} +f={:.8f}".format(geod.a, geod.f)
'+a=6378137 +f=0.00335281'
>>> crs.is_projected
True
>>> crs.is_geographic
False
"""
projstring = ""
if projparams:
if isinstance(projparams, str):
projstring = _prepare_from_string(projparams)
elif isinstance(projparams, dict):
projstring = _prepare_from_dict(projparams)
elif isinstance(projparams, int):
projstring = _prepare_from_epsg(projparams)
elif isinstance(projparams, (list, tuple)) and len(projparams) == 2:
projstring = _prepare_from_authority(*projparams)
elif hasattr(projparams, "to_wkt"):
projstring = projparams.to_wkt() # type: ignore
else:
raise CRSError("Invalid CRS input: {!r}".format(projparams))
if kwargs:
projkwargs = _prepare_from_dict(kwargs, allow_json=False)
projstring = _prepare_from_string(" ".join((projstring, projkwargs)))
> super().__init__(projstring)
/home/derrick/anaconda3/lib/python3.8/site-packages/pyproj/crs/crs.py:296:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
> ???
E pyproj.exceptions.CRSError: Invalid projection: epsg:31468: (Internal Proj Error: proj_create: SQLite error on SELECT name, coordinate_system_auth_name, coordinate_system_code, geodetic_crs_auth_name, geodetic_crs_code, conversion_auth_name, conversion_code, area_of_use_auth_name, area_of_use_code, text_definition, deprecated FROM projected_crs WHERE auth_name = ? AND code = ?: no such column: area_of_use_auth_name)
pyproj/_crs.pyx:2338: CRSError
During handling of the above exception, another exception occurred:
self = <obspy.io.nlloc.tests.test_util.NLLOCTestCase testMethod=test_read_nlloc_scatter_coordinate_conversion>
@unittest.skipIf(not HAS_PYPROJ, 'pyproj not installed')
def test_read_nlloc_scatter_coordinate_conversion(self):
"""
Test reading NLLoc scatter file including coordinate conversion.
"""
# test including coordinate manipulation
filename = os.path.join(self.datapath, "nlloc.scat")
> got = read_nlloc_scatter(
filename, coordinate_converter=_coordinate_conversion)
io/nlloc/tests/test_util.py:58:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
io/nlloc/util.py:47: in read_nlloc_scatter
data["x"], data["y"], data["z"] = coordinate_converter(
io/nlloc/tests/test_util.py:23: in _coordinate_conversion
proj_wgs84 = pyproj.Proj(init="epsg:4326")
/home/derrick/anaconda3/lib/python3.8/site-packages/pyproj/proj.py:107: in __init__
self.crs = CRS.from_user_input(projparams, **kwargs)
/home/derrick/anaconda3/lib/python3.8/site-packages/pyproj/crs/crs.py:440: in from_user_input
return CRS(value, **kwargs)
/home/derrick/anaconda3/lib/python3.8/site-packages/pyproj/crs/crs.py:296: in __init__
super().__init__(projstring)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
> ???
E pyproj.exceptions.CRSError: Invalid projection: +init=epsg:4326 +type=crs: (Internal Proj Error: proj_create: SQLite error on SELECT name, type, coordinate_system_auth_name, coordinate_system_code, datum_auth_name, datum_code, area_of_use_auth_name, area_of_use_code, text_definition, deprecated FROM geodetic_crs WHERE auth_name = ? AND code = ?: no such column: area_of_use_auth_name)
pyproj/_crs.pyx:2338: CRSError

Skipped tests (38)

Submodule Test Skip message
clients.seedlink obspy/clients/seedlink/tests/test_slclient.py::SLClientTestCase::test_info Skipped: test must be started manually
clients.seedlink obspy/clients/seedlink/tests/test_slclient.py::SLClientTestCase::test_issue708 Skipped: test must be started manually
clients.seedlink obspy/clients/seedlink/tests/test_slclient.py::SLClientTestCase::test_time_window Skipped: test must be started manually
core obspy/core/stream.py::obspy.core.stream._is_pickle Skipped: all tests skipped by +SKIP option
core obspy/core/tests/test_event.py::TestEvent::test_plot_farfield_without_quiver_with_maps Skipped: basemap not installed
core obspy/core/tests/test_event.py::TestBasemap::test_catalog_plot_global Skipped: basemap not installed
core obspy/core/tests/test_event.py::TestBasemap::test_catalog_plot_ortho Skipped: basemap not installed
core obspy/core/tests/test_event.py::TestBasemap::test_catalog_plot_ortho_longitude_wrap Skipped: basemap not installed
core obspy/core/tests/test_event.py::TestBasemap::test_catalog_plot_local Skipped: basemap not installed
core obspy/core/tests/test_event.py::TestBasemap::test_plot_catalog_before_1900 Skipped: basemap not installed
core obspy/core/tests/test_network.py::TestNetworkBasemap::test_location_plot_global Skipped: no or invalid basemap installation
core obspy/core/tests/test_network.py::TestNetworkBasemap::test_location_plot_ortho Skipped: no or invalid basemap installation
core obspy/core/tests/test_network.py::TestNetworkBasemap::test_location_plot_local Skipped: no or invalid basemap installation
core.util obspy/core/util/misc.py::obspy.core.util.misc.CatchOutput Skipped: all tests skipped by +SKIP option
core.util obspy/core/util/misc.py::obspy.core.util.misc.SuppressOutput Skipped: all tests skipped by +SKIP option
core.util obspy/core/util/misc.py::obspy.core.util.misc.TemporaryWorkingDirectory Skipped: all tests skipped by +SKIP option
geodetics obspy/geodetics/tests/test_util_geodetics.py::TestUtilGeodetics::test_gps_2_dist_azimuth_with_geographiclib Skipped: Module geographiclib is not installed
geodetics obspy/geodetics/tests/test_util_geodetics.py::TestUtilGeodetics::test_issue_375 Skipped: Module geographiclib is not installed
imaging obspy/imaging/tests/test_mopad_script.py::TestMopad::test_script_plot Skipped: Currently broken until further review.
io.ascii obspy/io/ascii/core.py::obspy.io.ascii.core._is_slist Skipped: all tests skipped by +SKIP option
io.ascii obspy/io/ascii/core.py::obspy.io.ascii.core._is_tspair Skipped: all tests skipped by +SKIP option
io.nordic obspy/io/nordic/utils.py::obspy.io.nordic.utils._evmagtonor Skipped: all tests skipped by +SKIP option
io.nordic obspy/io/nordic/utils.py::obspy.io.nordic.utils._nortoevmag Skipped: all tests skipped by +SKIP option
io.pde obspy/io/pde/mchedr.py::obspy.io.pde.mchedr._is_mchedr Skipped: all tests skipped by +SKIP option
io.quakeml obspy/io/quakeml/core.py::obspy.io.quakeml.core._is_quakeml Skipped: all tests skipped by +SKIP option
io.seisan obspy/io/seisan/core.py::obspy.io.seisan.core._is_seisan Skipped: all tests skipped by +SKIP option
io.sh obspy/io/sh/core.py::obspy.io.sh.core._is_asc Skipped: all tests skipped by +SKIP option
io.sh obspy/io/sh/core.py::obspy.io.sh.core._is_q Skipped: all tests skipped by +SKIP option
io.wav obspy/io/wav/core.py::obspy.io.wav.core._is_wav Skipped: all tests skipped by +SKIP option
io.y obspy/io/y/core.py::obspy.io.y.core._is_y Skipped: all tests skipped by +SKIP option
signal obspy/signal/quality_control.py::obspy.signal.quality_control.MSEEDMetadata Skipped: all tests skipped by +SKIP option
signal obspy/signal/tests/test_spectral_estimation.py::TestPsd::test_ppsd_spectrogram_plot Skipped: matplotlib >= 3 shifts labels
taup obspy/taup/tests/test_ray_paths.py::TestRayPathCalculations::test_compute_ray_paths Skipped: test needs geographiclib >= 1.34
taup obspy/taup/tests/test_tau.py::TestTauPyModel::test_p_iasp91_geo_manual Skipped: Module geographiclib is not installed
taup obspy/taup/tests/test_tau.py::TestTauPyModel::test_pierce_p_iasp91_geo Skipped: test needs geographiclib >= 1.34
taup obspy/taup/tests/test_tau.py::TestTauPyModel::test_single_path_geo_iasp91 Skipped: test needs geographiclib >= 1.34
taup obspy/taup/tests/test_taup_geo.py::TestTaupGeo::test_path_geo Skipped: Module geographiclib is not installed or too old.
taup obspy/taup/tests/test_taup_geo.py::TestTaupGeo::test_path_resampling Skipped: Module geographiclib is not installed or too old.

Slowest tests (20)

Runtime Test
74.869s obspy/clients/fdsn/tests/test_eidaws_routing_client.py::EIDAWSRoutingClientTestCase::test_get_stations_integration_test
44.988s obspy/clients/seedlink/basic_client.py::obspy.clients.seedlink.basic_client.Client.get_waveforms
44.042s obspy/clients/seedlink/tests/test_basic_client.py::ClientTestCase::test_multiple_waveform_requests_with_multiple_info_requests
41.434s obspy/clients/seedlink/basic_client.py::obspy.clients.seedlink.basic_client.Client.get_info
28.590s obspy/clients/fdsn/tests/test_eidaws_routing_client.py::EIDAWSRoutingClientTestCase::test_proper_no_data_exception_on_out_of_epoch_dates
20.531s obspy/clients/seedlink/tests/test_basic_client.py::ClientTestCase::test_get_info
8.985s obspy/clients/fdsn/tests/test_client.py::ClientTestCase::test_irisph5_event
8.377s obspy/clients/syngine/tests/test_client.py::ClientTestCase::test_get_available_models
7.069s obspy/clients/fdsn/tests/test_client.py::ClientTestCase::test_dataselect_bulk
6.403s obspy/taup/__init__.py::obspy.taup
5.236s obspy/taup/tests/test_seismic_phase.py::TestTauPySeismicPhase::test_shoot_existing_ray_param
4.530s obspy/clients/fdsn/tests/test_client.py::ClientTestCase::test_iris_example_queries_dataselect_discover_services_false
4.483s obspy/clients/fdsn/tests/test_client.py::ClientTestCase::test_iris_example_queries_dataselect
4.467s obspy/io/xseed/tests/test_core.py::CoreTestCase::test_response_calculation_from_seed_and_xseed
4.441s obspy/clients/fdsn/client.py::obspy.clients.fdsn.client.Client.get_waveforms_bulk
4.012s obspy/clients/fdsn/client.py::obspy.clients.fdsn.client.Client.get_waveforms
3.603s obspy/clients/syngine/tests/test_client.py::ClientTestCase::test_get_waveforms
3.354s obspy/clients/syngine/__init__.py::obspy.clients.syngine
3.213s obspy/signal/tests/test_calibration.py::CalibrationTestCase::test_relcal_different_overlaps
2.951s obspy/clients/earthworm/__init__.py::obspy.clients.earthworm

Warnings (44)

Stage Filename Category Message
runtest /media/data/Gits/obspy/obspy/core/event/resourceid.py:348 UserWarning The object with identity of: 140678623212400 and id of obspy.org/tests/test_resource_doc_example no longer exists, trying to find an object with the same id
runtest /media/data/Gits/obspy/obspy/imaging/beachball.py:246 RuntimeWarning More than 20 figures have been opened. Figures created through the pyplot interface (`matplotlib.pyplot.figure`) are retained until explicitly closed and may consume too much memory. (To control this warning, see the rcParam `figure.max_open_warning`).
runtest /media/data/Gits/obspy/obspy/taup/tau.py:244 UserWarning Matplotlib is currently using agg, which is a non-GUI backend, so cannot show the figure.
runtest /media/data/Gits/obspy/obspy/imaging/scripts/mopad.py:242 PendingDeprecationWarning the matrix subclass is not the recommended way to represent matrices or deal with linear algebra (see https://docs.scipy.org/doc/numpy/user/numpy-for-matlab-users.html). Please adjust your code to use regular ndarray.
runtest /media/data/Gits/obspy/obspy/imaging/beachball.py:275 UserWarning Matplotlib is currently using agg, which is a non-GUI backend, so cannot show the figure.
runtest /media/data/Gits/obspy/obspy/io/quakeml/core.py:1898 UserWarning Could not validate QuakeML - try using a newer lxml version
runtest /media/data/Gits/obspy/obspy/core/event/resourceid.py:348 UserWarning The object with identity of: 140678623213456 and id of obspy.org/tests/test_resource_doc_example no longer exists, trying to find an object with the same id
runtest /media/data/Gits/obspy/obspy/io/seiscomp/inventory.py:514 UserWarning Something went hopelessly wrong, found sampling-rate of 0!
runtest /media/data/Gits/obspy/obspy/signal/spectral_estimation.py:2043 UserWarning Attempting to set identical left == right == 52.49999950000001 results in singular transformations; automatically expanding.
runtest <doctest obspy.signal._sosfilt._sosfilt[13]>:1 UserWarning Matplotlib is currently using agg, which is a non-GUI backend, so cannot show the figure.
runtest /media/data/Gits/obspy/obspy/imaging/scripts/mopad.py:1586 PendingDeprecationWarning the matrix subclass is not the recommended way to represent matrices or deal with linear algebra (see https://docs.scipy.org/doc/numpy/user/numpy-for-matlab-users.html). Please adjust your code to use regular ndarray.
runtest /media/data/Gits/obspy/obspy/imaging/scripts/scan.py:436 UserWarning Matplotlib is currently using agg, which is a non-GUI backend, so cannot show the figure.
runtest /home/derrick/anaconda3/lib/python3.8/site-packages/numpy/matrixlib/defmatrix.py:71 PendingDeprecationWarning the matrix subclass is not the recommended way to represent matrices or deal with linear algebra (see https://docs.scipy.org/doc/numpy/user/numpy-for-matlab-users.html). Please adjust your code to use regular ndarray.
runtest /media/data/Gits/obspy/obspy/clients/fdsn/wadl_parser.py:107 UserWarning The 'event' service at 'http://service.iris.edu/ph5/event/1/' cannot deal with the following required parameters: mindepth, maxdepth, orderby They will not be available for any requests. Any attempt to use them will result in an error.
runtest /media/data/Gits/obspy/obspy/signal/spectral_estimation.py:2125 MatplotlibDeprecationWarning The 'b' parameter of grid() has been renamed 'visible' since Matplotlib 3.5; support for the old name will be dropped two minor releases later.
runtest /media/data/Gits/obspy/obspy/imaging/scripts/mopad.py:821 PendingDeprecationWarning the matrix subclass is not the recommended way to represent matrices or deal with linear algebra (see https://docs.scipy.org/doc/numpy/user/numpy-for-matlab-users.html). Please adjust your code to use regular ndarray.
runtest /media/data/Gits/obspy/obspy/core/event/resourceid.py:622 UserWarning overwritting the id attribute of a ResourceIdentifierobject is very dangerous and will raise an exception in a future version of obspy
runtest /media/data/Gits/obspy/obspy/signal/spectral_estimation.py:2043 UserWarning Attempted to set non-positive right xlim on a log-scaled axis. Invalid limit will be ignored.
runtest /media/data/Gits/obspy/obspy/signal/spectral_estimation.py:2043 UserWarning Attempting to set identical left == right == 9.223855751103727 results in singular transformations; automatically expanding.
runtest /media/data/Gits/obspy/obspy/signal/spectral_estimation.py:1542 UserWarning 4/4 segments omitted in file '/tmp/obspy-jtl5veaf.npz' (time ranges already covered).
collect /media/data/Gits/obspy/obspy/clients/arclink/__init__.py:31 ObsPyDeprecationWarning ArcLink protocol has been officially deprecated and some main servers have been shut down already. Please consider using other methods like FDSN web services to fetch data. ArcLink functionality is now untested in ObsPy.
runtest /media/data/Gits/obspy/obspy/io/nordic/utils.py:184 UserWarning Lines of type I have not been implemented yet, please submit a development request
runtest /media/data/Gits/obspy/obspy/taup/tau.py:975 UserWarning Matplotlib is currently using agg, which is a non-GUI backend, so cannot show the figure.
runtest /media/data/Gits/obspy/obspy/signal/spectral_estimation.py:2106 MatplotlibDeprecationWarning Auto-removal of grids by pcolor() and pcolormesh() is deprecated since 3.5 and will be removed two minor releases later; please call grid(False) first.
runtest /home/derrick/anaconda3/lib/python3.8/site-packages/pyproj/crs/crs.py:294 FutureWarning '+init=<authority>:<code>' syntax is deprecated. '<authority>:<code>' is the preferred initialization method. When making the change, be mindful of axis order changes: https://pyproj4.github.io/pyproj/stable/gotchas.html#axis-order-changes-in-proj-6
runtest /media/data/Gits/obspy/obspy/imaging/scripts/mopad.py:1643 PendingDeprecationWarning the matrix subclass is not the recommended way to represent matrices or deal with linear algebra (see https://docs.scipy.org/doc/numpy/user/numpy-for-matlab-users.html). Please adjust your code to use regular ndarray.
runtest <doctest obspy.core.event.resourceid.ResourceIdentifier[37]>:1 ObsPyDeprecationWarning Converts the current ID to a valid QuakeML URI. This method is deprecated, use :meth:`get_quakeml_id` instead. Only an invalid QuakeML ResourceIdentifier string it will be converted to a valid one. Otherwise nothing will happen but after calling this method the user can be sure that the ID is a valid QuakeML URI. The resulting ID will be of the form smi:authority_id/prefix/resource_id :type authority_id: str, optional :param authority_id: The base url of the resulting string. Defaults to ``"local"``.
runtest /media/data/Gits/obspy/obspy/core/utcdatetime.py:1084 ObsPyDeprecationWarning Comparing UTCDateTime objects of different precision is not defined will raise an Exception in a future version of obspy
runtest /home/derrick/anaconda3/lib/python3.8/_collections_abc.py:997 MatplotlibDeprecationWarning The modification of the Axes.collections property was deprecated in Matplotlib 3.5 and will be removed two minor releases later. Use Artist.remove() instead.
runtest /media/data/Gits/obspy/obspy/signal/spectral_estimation.py:2126 MatplotlibDeprecationWarning The 'b' parameter of grid() has been renamed 'visible' since Matplotlib 3.5; support for the old name will be dropped two minor releases later.
runtest /home/derrick/anaconda3/lib/python3.8/site-packages/pyproj/crs/crs.py:53 FutureWarning '+init=<authority>:<code>' syntax is deprecated. '<authority>:<code>' is the preferred initialization method. When making the change, be mindful of axis order changes: https://pyproj4.github.io/pyproj/stable/gotchas.html#axis-order-changes-in-proj-6
runtest /media/data/Gits/obspy/obspy/imaging/scripts/mopad.py:1624 PendingDeprecationWarning the matrix subclass is not the recommended way to represent matrices or deal with linear algebra (see https://docs.scipy.org/doc/numpy/user/numpy-for-matlab-users.html). Please adjust your code to use regular ndarray.
runtest /media/data/Gits/obspy/obspy/taup/tau.py:513 UserWarning Matplotlib is currently using agg, which is a non-GUI backend, so cannot show the figure.
runtest /media/data/Gits/obspy/obspy/core/event/resourceid.py:348 UserWarning The object with identity of: 140678622164640 and id of smi:local/95104230-7ff6-43ac-8cd3-86cf94bd3fd9 no longer exists, trying to find an object with the same id
runtest /media/data/Gits/obspy/obspy/imaging/scripts/mopad.py:211 PendingDeprecationWarning the matrix subclass is not the recommended way to represent matrices or deal with linear algebra (see https://docs.scipy.org/doc/numpy/user/numpy-for-matlab-users.html). Please adjust your code to use regular ndarray.
runtest /media/data/Gits/obspy/obspy/taup/tau.py:1084 UserWarning Matplotlib is currently using agg, which is a non-GUI backend, so cannot show the figure.
runtest /media/data/Gits/obspy/obspy/imaging/scripts/mopad.py:775 PendingDeprecationWarning the matrix subclass is not the recommended way to represent matrices or deal with linear algebra (see https://docs.scipy.org/doc/numpy/user/numpy-for-matlab-users.html). Please adjust your code to use regular ndarray.
runtest /media/data/Gits/obspy/obspy/signal/spectral_estimation.py:2043 UserWarning Attempting to set identical left == right == 10.4999995 results in singular transformations; automatically expanding.
runtest /media/data/Gits/obspy/obspy/taup/tau.py:340 RuntimeWarning More than 20 figures have been opened. Figures created through the pyplot interface (`matplotlib.pyplot.figure`) are retained until explicitly closed and may consume too much memory. (To control this warning, see the rcParam `figure.max_open_warning`).
runtest /media/data/Gits/obspy/obspy/signal/cross_correlation.py:1002 UserWarning Matplotlib is currently using agg, which is a non-GUI backend, so cannot show the figure.
runtest /media/data/Gits/obspy/obspy/imaging/scripts/mopad.py:780 PendingDeprecationWarning the matrix subclass is not the recommended way to represent matrices or deal with linear algebra (see https://docs.scipy.org/doc/numpy/user/numpy-for-matlab-users.html). Please adjust your code to use regular ndarray.
runtest /media/data/Gits/obspy/obspy/io/seiscomp/inventory.py:496 UserWarning Clock drift division by sample rate of 0: using sec/sample
runtest /media/data/Gits/obspy/obspy/clients/fdsn/routing/routing_client.py:113 UserWarning No FDSN services could be discovered at 'http://www.orfeus-eu.org'. This could be due to a temporary service outage or an invalid FDSN service address.It will not be used for routing. Try again later?
runtest /media/data/Gits/obspy/obspy/imaging/source.py:153 UserWarning Tight layout not applied. The left and right margins cannot be made large enough to accommodate all axes decorations.