Open Thomas-Ulrich opened 4 years ago
Hi Thomas,
this bug is due to newer numpy versions no longer accepting floating point numbers in the np.linspace
call for the number of desired array elements.
This has to be changed in the whiten()
function in the Ambient Seismic Noise/NoiseCorrelation
notebook.
ok thx, I can write a pull request. Next error:
------------------
from obspy import read, read_inventory
st = read("data/GR.FUR..BHN.D.2015.361")
inv = read_inventory("data/station_FUR.stationxml")
print(st)
print(inv)
inv.plot(projection="ortho");
------------------
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
<ipython-input-2-5bbf216cc9f8> in <module>
6 print(st)
7 print(inv)
----> 8 inv.plot(projection="ortho");
~/Downloads/seismo_live/envSeismoLive/lib/python3.7/site-packages/obspy/core/inventory/inventory.py in plot(self, projection, resolution, continent_fill_color, water_fill_color, marker, size, label, color, color_per_network, colormap, legend, time, show, outfile, method, fig, **kwargs)
1003 water_fill_color=water_fill_color,
1004 colormap=None, colorbar=False, marker=marker,
-> 1005 title=None, show=False, fig=fig, **kwargs)
1006
1007 if legend is not None and color_per_network:
~/Downloads/seismo_live/envSeismoLive/lib/python3.7/site-packages/obspy/imaging/maps.py in plot_map(method, *args, **kwargs)
793 return plot_basemap(*args, **kwargs)
794 elif HAS_CARTOPY:
--> 795 return plot_cartopy(*args, **kwargs)
796 else:
797 raise ImportError('Neither Basemap nor Cartopy could be imported.')
~/Downloads/seismo_live/envSeismoLive/lib/python3.7/site-packages/obspy/imaging/maps.py in plot_cartopy(lons, lats, size, color, labels, projection, resolution, continent_fill_color, water_fill_color, colormap, colorbar, marker, title, colorbar_ticklabel_format, show, proj_kwargs, **kwargs)
735 scatter = map_ax.scatter(lons, lats, marker=marker, s=size, c=color,
736 zorder=10, cmap=colormap,
--> 737 transform=ccrs.Geodetic())
738
739 if title:
~/Downloads/seismo_live/envSeismoLive/lib/python3.7/site-packages/cartopy/mpl/geoaxes.py in wrapper(self, *args, **kwargs)
305 raise ValueError('Invalid transform: Spherical {} '
306 'is not supported - consider using '
--> 307 'PlateCarree/RotatedPole.'.format(func.__name__))
308
309 kwargs['transform'] = transform
ValueError: Invalid transform: Spherical scatter is not supported - consider using PlateCarree/RotatedPole.
ValueError: Invalid transform: Spherical scatter is not supported - consider using PlateCarree/RotatedPole.
I guess this notebook was written for basemap.
Hmm - what is your basemap version?
Edit: Sorry not basemap
but cartopy
.
I feel like this should work.
0.18.0
@megies Do you know what's going on here?
Just wanted to see if I can complete the build to the end using basemap: But no, I get another error (time-out?).
(envSeismoLive) (base) ulrich@ulrich-ThinkPad-T490s:~/Downloads/seismo_live$ python conf/convert_to_ipynb.py notebooks built_notebooks
Convert to .ipynb file.
[jupytext] Reading built_notebooks/notebooks/Data Visualization/Intro_to_visualization.py
[jupytext] Writing built_notebooks/notebooks/Data Visualization/Intro_to_visualization.ipynb
Running .ipynb file: built_notebooks/notebooks/Data Visualization/Intro_to_visualization.ipynb
[NbConvertApp] Converting notebook built_notebooks/notebooks/Data Visualization/Intro_to_visualization.ipynb to notebook
[NbConvertApp] Executing notebook with kernel: python3
[NbConvertApp] Writing 791190 bytes to built_notebooks/notebooks/Data Visualization/Intro_to_visualization.ipynb
Converting to HTML: built_notebooks/notebooks/Data Visualization/Intro_to_visualization.ipynb
[NbConvertApp] Converting notebook built_notebooks/notebooks/Data Visualization/Intro_to_visualization.ipynb to html
[NbConvertApp] Writing 1105096 bytes to built_notebooks/html/Data Visualization/Intro_to_visualization.html
Convert to .ipynb file.
[jupytext] Reading built_notebooks/notebooks/Ambient Seismic Noise/NoiseCorrelation.py
[jupytext] Writing built_notebooks/notebooks/Ambient Seismic Noise/NoiseCorrelation.ipynb
Running .ipynb file: built_notebooks/notebooks/Ambient Seismic Noise/NoiseCorrelation.ipynb
[NbConvertApp] Converting notebook built_notebooks/notebooks/Ambient Seismic Noise/NoiseCorrelation.ipynb to notebook
[NbConvertApp] Executing notebook with kernel: python3
[NbConvertApp] Writing 109734 bytes to built_notebooks/notebooks/Ambient Seismic Noise/NoiseCorrelation.ipynb
Converting to HTML: built_notebooks/notebooks/Ambient Seismic Noise/NoiseCorrelation.ipynb
[NbConvertApp] Converting notebook built_notebooks/notebooks/Ambient Seismic Noise/NoiseCorrelation.ipynb to html
[NbConvertApp] Writing 427469 bytes to built_notebooks/html/Ambient Seismic Noise/NoiseCorrelation.html
Convert to .ipynb file.
[jupytext] Reading built_notebooks/notebooks/Ambient Seismic Noise/Probabilistic Power Spectral Densities.py
[jupytext] Writing built_notebooks/notebooks/Ambient Seismic Noise/Probabilistic Power Spectral Densities.ipynb
Running .ipynb file: built_notebooks/notebooks/Ambient Seismic Noise/Probabilistic Power Spectral Densities.ipynb
[NbConvertApp] Converting notebook built_notebooks/notebooks/Ambient Seismic Noise/Probabilistic Power Spectral Densities.ipynb to notebook
[NbConvertApp] Executing notebook with kernel: python3
[NbConvertApp] ERROR | Kernel died while waiting for execute reply.
Traceback (most recent call last):
File "/home/ulrich/Downloads/seismo_live/envSeismoLive/lib/python3.7/site-packages/nbconvert/preprocessors/execute.py", line 478, in _poll_for_reply
msg = self.kc.shell_channel.get_msg(timeout=timeout)
File "/home/ulrich/Downloads/seismo_live/envSeismoLive/lib/python3.7/site-packages/jupyter_client/blocking/channels.py", line 57, in get_msg
raise Empty
_queue.Empty
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/ulrich/Downloads/seismo_live/envSeismoLive/bin/jupyter-nbconvert", line 8, in <module>
sys.exit(main())
File "/home/ulrich/Downloads/seismo_live/envSeismoLive/lib/python3.7/site-packages/jupyter_core/application.py", line 270, in launch_instance
return super(JupyterApp, cls).launch_instance(argv=argv, **kwargs)
File "/home/ulrich/Downloads/seismo_live/envSeismoLive/lib/python3.7/site-packages/traitlets/config/application.py", line 664, in launch_instance
app.start()
File "/home/ulrich/Downloads/seismo_live/envSeismoLive/lib/python3.7/site-packages/nbconvert/nbconvertapp.py", line 340, in start
self.convert_notebooks()
File "/home/ulrich/Downloads/seismo_live/envSeismoLive/lib/python3.7/site-packages/nbconvert/nbconvertapp.py", line 510, in convert_notebooks
self.convert_single_notebook(notebook_filename)
File "/home/ulrich/Downloads/seismo_live/envSeismoLive/lib/python3.7/site-packages/nbconvert/nbconvertapp.py", line 481, in convert_single_notebook
output, resources = self.export_single_notebook(notebook_filename, resources, input_buffer=input_buffer)
File "/home/ulrich/Downloads/seismo_live/envSeismoLive/lib/python3.7/site-packages/nbconvert/nbconvertapp.py", line 410, in export_single_notebook
output, resources = self.exporter.from_filename(notebook_filename, resources=resources)
File "/home/ulrich/Downloads/seismo_live/envSeismoLive/lib/python3.7/site-packages/nbconvert/exporters/exporter.py", line 179, in from_filename
return self.from_file(f, resources=resources, **kw)
File "/home/ulrich/Downloads/seismo_live/envSeismoLive/lib/python3.7/site-packages/nbconvert/exporters/exporter.py", line 197, in from_file
return self.from_notebook_node(nbformat.read(file_stream, as_version=4), resources=resources, **kw)
File "/home/ulrich/Downloads/seismo_live/envSeismoLive/lib/python3.7/site-packages/nbconvert/exporters/notebook.py", line 32, in from_notebook_node
nb_copy, resources = super(NotebookExporter, self).from_notebook_node(nb, resources, **kw)
File "/home/ulrich/Downloads/seismo_live/envSeismoLive/lib/python3.7/site-packages/nbconvert/exporters/exporter.py", line 139, in from_notebook_node
nb_copy, resources = self._preprocess(nb_copy, resources)
File "/home/ulrich/Downloads/seismo_live/envSeismoLive/lib/python3.7/site-packages/nbconvert/exporters/exporter.py", line 316, in _preprocess
nbc, resc = preprocessor(nbc, resc)
File "/home/ulrich/Downloads/seismo_live/envSeismoLive/lib/python3.7/site-packages/nbconvert/preprocessors/base.py", line 47, in __call__
return self.preprocess(nb, resources)
File "/home/ulrich/Downloads/seismo_live/envSeismoLive/lib/python3.7/site-packages/nbconvert/preprocessors/execute.py", line 405, in preprocess
nb, resources = super(ExecutePreprocessor, self).preprocess(nb, resources)
File "/home/ulrich/Downloads/seismo_live/envSeismoLive/lib/python3.7/site-packages/nbconvert/preprocessors/base.py", line 69, in preprocess
nb.cells[index], resources = self.preprocess_cell(cell, resources, index)
File "/home/ulrich/Downloads/seismo_live/envSeismoLive/lib/python3.7/site-packages/nbconvert/preprocessors/execute.py", line 438, in preprocess_cell
reply, outputs = self.run_cell(cell, cell_index, store_history)
File "/home/ulrich/Downloads/seismo_live/envSeismoLive/lib/python3.7/site-packages/nbconvert/preprocessors/execute.py", line 578, in run_cell
exec_reply = self._poll_for_reply(parent_msg_id, cell, timeout)
File "/home/ulrich/Downloads/seismo_live/envSeismoLive/lib/python3.7/site-packages/nbconvert/preprocessors/execute.py", line 483, in _poll_for_reply
self._check_alive()
File "/home/ulrich/Downloads/seismo_live/envSeismoLive/lib/python3.7/site-packages/nbconvert/preprocessors/execute.py", line 510, in _check_alive
raise DeadKernelError("Kernel died")
nbconvert.preprocessors.execute.DeadKernelError: Kernel died
Traceback (most recent call last):
File "conf/convert_to_ipynb.py", line 249, in <module>
html_folder=html_folder,
File "conf/convert_to_ipynb.py", line 223, in convert_folder
html_folder=html_folder,
File "conf/convert_to_ipynb.py", line 186, in convert_file
check=True,
File "/home/ulrich/miniconda3/lib/python3.7/subprocess.py", line 487, in run
output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command '['jupyter', 'nbconvert', '--to', 'notebook', '--ExecutePreprocessor.timeout=600', '--execute', '--inplace', 'built_notebooks/notebooks/Ambient Seismic Noise/Probabilistic Power Spectral Densities.ipynb']' returned non-zero exit status 1.
You can try to increase the timeout in the script: just set --ExecutePreprocessor.timeout=600
to something higher.
no it does not work. Tried with --ExecutePreprocessor.timeout=6000000000
@megies Do you know what's going on here?
sorry, never seen that and still doing most of my stuff in basemap.. slow on the transition :blush:
Hi,
For some reason (we were trying to create a new seismology exercise derived for rupture_2D), I tried to build the notebooks. And it turns out that I cannot build them.
Here is what I did:
(Python 3.7.4)
and here is what I get:
Any idea what could be the problem? Seems like a problem in obspy?