Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Misfit lune plot in matplotlib backed for deviatoric solutions #273

Open
SeismoFelix opened this issue Sep 13, 2024 · 0 comments
Open

Misfit lune plot in matplotlib backed for deviatoric solutions #273

SeismoFelix opened this issue Sep 13, 2024 · 0 comments

Comments

@SeismoFelix
Copy link
Contributor

Hi!

I am having issues with plotting the lune plot in the new matplotlib visualization backend. The problem seems to arise when a deviatoric grid-search (DC + CLVD). Although in this case, we are only using the lune longitude, this feature used to be functional in the previous backend with deviatoric solutions (see attached figures).

Here is the error I am getting:

Traceback (most recent call last): File "/home/scoped/inversiones/FK_GridSearch.DEV+Magnitude+Depth_Iceland.py", line 270, in <module> plot_misfit_lune(event_id+'DEV+Z_misfit.png', results) File "/home/scoped/mtuq/mtuq/graphics/uq/lune.py", line 63, in plot_misfit_lune _plot_lune(filename, misfit, **kwargs) File "/home/scoped/mtuq/mtuq/graphics/uq/lune.py", line 261, in _plot_lune backend(filename, File "/home/scoped/mtuq/mtuq/graphics/uq/_matplotlib.py", line 85, in _plot_lune_matplotlib im = ax.contourf(x, y, values, cmap=colormap, levels=levels, zorder=10) File "/opt/conda/lib/python3.10/site-packages/matplotlib/__init__.py", line 1465, in inner return func(ax, *map(sanitize_sequence, args), **kwargs) File "/opt/conda/lib/python3.10/site-packages/matplotlib/axes/_axes.py", line 6536, in contourf contours = mcontour.QuadContourSet(self, *args, **kwargs) File "/opt/conda/lib/python3.10/site-packages/matplotlib/contour.py", line 858, in __init__ kwargs = self._process_args(*args, **kwargs) File "/opt/conda/lib/python3.10/site-packages/matplotlib/contour.py", line 1523, in _process_args x, y, z = self._contour_args(args, kwargs) File "/opt/conda/lib/python3.10/site-packages/matplotlib/contour.py", line 1563, in _contour_args x, y, z = self._check_xyz(x, y, z_orig, kwargs) File "/opt/conda/lib/python3.10/site-packages/matplotlib/contour.py", line 1591, in _check_xyz raise TypeError(f"Input z must be at least a (2, 2) shaped array, " TypeError: Input z must be at least a (2, 2) shaped array, but has shape (1, 30)

It looks like the contour function in matplotlib expects a symmetric array and a deviatoric grid search has no points in the lune latitude.

Thanks for your help,

Felix
Screenshot 2024-09-12 at 8 13 04 PM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant