uafgeotools / mtuq

moment tensor uncertainty quantification
BSD 2-Clause "Simplified" License
65 stars 22 forks source link

Spider plot update #254

Closed thurinj closed 4 months ago

thurinj commented 4 months ago

This PR is focused on "spider-plots" improvement. The goal is to provide a solid pygmt 'basic' backend that should adapt to most situations.

It features:

Most of the processing, setup, adjustments are handled through a pygmt utility function class, so as not to use some of the pygmt specific functions in a matplotlib context, by adding a contextual layer of separation (I don't expect someone to use a PyGMTUtilities.helper_function() into a matplotlib plot for instance).

I also added a high-level function to plot the normalized cross-correlation value on top of others.

thurinj commented 4 months ago

Hey @rmodrak,

Please let me review a few things before going through, there are some minor adjustments I want to make to ensure plotting consistencies regardless of the region of the globe that is plotted (especially the topography amplitude).

In the meantime, here are some of the output of the script from the 2009 example, so you can see where things are headed to:

image

and another result plotted in a different region (without having to tweak any of the plotting parameters):

image

I am foreseeing adjustments on the appearance of the beachball, and improving the topography normalization to ensure the grayscale contrast are always about the same and the topo doesn't seem too exaggerated.

thurinj commented 4 months ago

I've done some extensive rework on the docstrings which I also included in the autogenerated documentation (after checking). I was not aware of the exact text format that Sphinx expected, but know I know.

All functions, class and methods are now properly documented.

The only piece of the PR I am not too sure about is the "safety" **kwargs I have added to the _default_backend, in order to accommodate the complete stations list that is needed to plot the not-used stations in the pygmt script.

One solution would be to also include these stations as hollow triangles in the default backend, so both standard backend would need this input as argument.

The other solution is to include a check before calling the backend, but I don't want to obfuscate the function with conditional checks at this stage. It would become messy if, say someone use another external plotting backend.