I followed the tutorial on stationXML creation:
https://docs.obspy.org/tutorial/code_snippets/stationxml_file_from_scratch.html
Then I followed the steps to read in the station.xml using read_inventory:
https://docs.obspy.org/packages/obspy.core.inventory.html
It looks fine and I can plot the channel response, e.g., using:
resp = cha.response
resp.plot(0.001, output=“VEL”)
However, if I try to plot the inv using inv.plot(), I get the stacktrace below.
Traceback (most recent call last):
File “/usr/local/anaconda/envs/obspy_3.6/lib/python3.6/site-packages/matplotlib/colors.py”, line 101, in _sanitize_extrema
ret = np.asscalar(ex)
File “/usr/local/anaconda/envs/obspy_3.6/lib/python3.6/site-packages/numpy/lib/type_check.py”, line 480, in asscalar
return a.item()
AttributeError: ‘str’ object has no attribute ‘item’
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File “obspy-read-stationxml.py”, line 13, in
inv.plot()
File “/usr/local/anaconda/envs/obspy_3.6/lib/python3.6/site-packages/obspy/core/inventory/inventory.py”, line 749, in plot
title=None, show=False, fig=fig, **kwargs)
File “/usr/local/anaconda/envs/obspy_3.6/lib/python3.6/site-packages/obspy/imaging/maps.py”, line 766, in plot_map
return plot_basemap(*args, **kwargs)
File “/usr/local/anaconda/envs/obspy_3.6/lib/python3.6/site-packages/obspy/imaging/maps.py”, line 179, in plot_basemap
scal_map = ScalarMappable(norm=Normalize(min_color, max_color),
File “/usr/local/anaconda/envs/obspy_3.6/lib/python3.6/site-packages/matplotlib/colors.py”, line 892, in init
self.vmin = _sanitize_extrema(vmin)
File “/usr/local/anaconda/envs/obspy_3.6/lib/python3.6/site-packages/matplotlib/colors.py”, line 103, in _sanitize_extrema
ret = float(ex)
ValueError: could not convert string to float: ‘#b15928’
Here’s my anaconda env:
python 3.6.4 0 conda-forge
obspy 1.1.0 py36_1 conda-forge
matplotlib 2.2.2 py36_0 conda-forge
numpy 1.13.3 py36ha726252_3
scipy 1.0.0 py36h1de22e9_0
Cheers!
-Mike