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

Replacing GMT/PyGMT backend by pure Matplotlib backend #268

Merged
merged 35 commits into from
Aug 21, 2024
Merged

Commits on May 8, 2024

  1. Define hammer projection

    Defining projection helper function for Lune and Sphere data visualization.
    thurinj committed May 8, 2024
    Configuration menu
    Copy the full SHA
    9dca53a View commit details
    Browse the repository at this point in the history
  2. Helper function for lune and sphere arcs

    Define function to compute intermediate points along a line between specific coordinates pairs. This will make sure the arcs are correctly bent in the projected coordinate system (hammer projection).
    thurinj committed May 8, 2024
    Configuration menu
    Copy the full SHA
    2b3aa16 View commit details
    Browse the repository at this point in the history
  3. Lune arc definition and plotting helper functions

    Hard-coding lune arc coordinates for lambda1,2,3 = 0. Lines are populated by _compute_center_of_minimum_distance and plotted with _plot_lune_arcs using the hammer projection.
    thurinj committed May 8, 2024
    Configuration menu
    Copy the full SHA
    932f937 View commit details
    Browse the repository at this point in the history
  4. Sphere arcs and label definition and plotting helper functions

    Hard-coding sphere meridians for W - S - E directions. Lines are populated by _compute_center_of_minimum_distance and plotted with _plot_sphere_arcs using the hammer projection. Labels are added with _plot_directions_text.
    thurinj committed May 8, 2024
    Configuration menu
    Copy the full SHA
    32c26e1 View commit details
    Browse the repository at this point in the history
  5. Lune axes initialization helper function

    This function returns a figure and axes object with the lune frame, ready for plotting used by other functions.
    It uses the helper functions previously defined, and the hammer projection function.
    thurinj committed May 8, 2024
    Configuration menu
    Copy the full SHA
    9074dec View commit details
    Browse the repository at this point in the history
  6. Sphere axes initialization helper function

    This function returns a figure and axes object with the unit sphere frame, ready for plotting used by other functions. As with the lune, It uses the helper functions previously defined, and the hammer projection function.
    thurinj committed May 8, 2024
    Configuration menu
    Copy the full SHA
    0498014 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    d6e3a92 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    d0fc33f View commit details
    Browse the repository at this point in the history
  9. Adding main lune plotting routine

    Pure matplotlib implementation of the Lune plot. It uses the pre-defined helper functions implemented in previous commits. The lune plot has three different modes, contour being the equivalent to the current GMT plot. colormesh and scatter mode are implemented with sampling method and polarity misfit, respectively.
    thurinj committed May 8, 2024
    Configuration menu
    Copy the full SHA
    ead4fa6 View commit details
    Browse the repository at this point in the history
  10. Added main force sphere plotting routine

    Fairly similar in design to the lune plot backend. Disclaimer: it has been tested but not to the same extent as the lune plot. Main features seems stable, but I will review if anything comes up.
    thurinj committed May 8, 2024
    Configuration menu
    Copy the full SHA
    447c6e5 View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    2b99e90 View commit details
    Browse the repository at this point in the history

Commits on May 9, 2024

  1. Implemented in-house beachball plots

    Implemented pure-matplotlib moment tensor plot. It is based on the computation of the radiation coefficient on a 3D half-sphere, and projected on the 2D plane with lambert azimuthal equal area projection.
    Currently supports waveform plots and base beachball plot with station and piercing points.
    thurinj committed May 9, 2024
    Configuration menu
    Copy the full SHA
    27cd73e View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    38576e4 View commit details
    Browse the repository at this point in the history

Commits on May 15, 2024

  1. Added multi-beachball plotting functionality to _plot_beachball_matpl…

    …otlib
    
    This commit integrates two different features:
    Adding the option to input several moment tensors to plot on a map fashion (used in lune plot and depth plot).
    Adding a "Level of detail" kind of optimization to adapt rendering speed depending on the size of the plotted beachball (single figure, or multiple beachball on a plot).
    thurinj committed May 15, 2024
    Configuration menu
    Copy the full SHA
    e8b0db0 View commit details
    Browse the repository at this point in the history
  2. Added anti-aliasing option for contourf call and minor saving changes.

    Also removed debug prints.
    thurinj committed May 15, 2024
    Configuration menu
    Copy the full SHA
    79fff97 View commit details
    Browse the repository at this point in the history
  3. Implemented beachball plot for depth/misfit using matplotlib

    The plot requires using a double axes trick, as the beachball pattern are not converted into markers or symbol, they can be stretched if the axes are not the same order of magnitude.
    A secondary axis with unit extent (-1,1 / -1,1) is overlayed on the base figure, and the coordinates of the points (depths/values) are re-scaled accordingly, so that the beachballs are always perfect circles.
    thurinj committed May 15, 2024
    Configuration menu
    Copy the full SHA
    2a1e3e7 View commit details
    Browse the repository at this point in the history
  4. Merged main branch into uq_matplotlib to bring header changes into th…

    …is feature branch
    
    I wanted to have the feature branch with the new header modification. This is mostly as I will use the uq_matplotlib branch for the 2024 MTUQ SCOPED workshop, before opening a Pull Request.
    thurinj committed May 15, 2024
    Configuration menu
    Copy the full SHA
    5b59abd View commit details
    Browse the repository at this point in the history

Commits on Jun 4, 2024

  1. Changed title and cbar policies

    Passed title back as a kwarg and added the possibility to modify the colorbar label (which I have set to l2_misfit as default value). Reproduces all the DetailedAnalysis.py plots.
    thurinj committed Jun 4, 2024
    Configuration menu
    Copy the full SHA
    6cf078b View commit details
    Browse the repository at this point in the history

Commits on Jun 5, 2024

  1. Enabling matplotlib force plot as default backend

    Changed the call of _plot_force() to actually use the backend variable instead of the hardcoded _plot_force_gmt() function. Use the "levels" variable in the matplotlib backend instead of the fixed value as 126 (which was for testing purposes).
    thurinj committed Jun 5, 2024
    Configuration menu
    Copy the full SHA
    142bc44 View commit details
    Browse the repository at this point in the history

Commits on Jun 8, 2024

  1. Configuration menu
    Copy the full SHA
    7263f41 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    929dd10 View commit details
    Browse the repository at this point in the history
  3. Modified beachball plot to have a unique plot.

    The beachball plot now support both the "Big beachball" mode as well as polarity plotting. Some functions from the beachball plotting engine have been moved to utilities.
    thurinj committed Jun 8, 2024
    Configuration menu
    Copy the full SHA
    abd10d7 View commit details
    Browse the repository at this point in the history
  4. Implemented matplotlib latlon misfit plot.

    With improvements mades on the beachball plot, the scaling factor of various figures were also updated, and should now be consistent regardless of the axes extents. (The scale being automatically adjusted to account for the axes extent).
    thurinj committed Jun 8, 2024
    Configuration menu
    Copy the full SHA
    7530751 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    f227929 View commit details
    Browse the repository at this point in the history
  6. Changed plotting type for polarity misfit on the lune.

    This now takes advantage of the dedicated polarity mode of the matplotlib backend.
    thurinj committed Jun 8, 2024
    Configuration menu
    Copy the full SHA
    27a16ac View commit details
    Browse the repository at this point in the history

Commits on Jun 11, 2024

  1. Configuration menu
    Copy the full SHA
    a48c3e9 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    68aeca4 View commit details
    Browse the repository at this point in the history

Commits on Jul 1, 2024

  1. Update beachball.py

    Increased default marker size for better readability.
    thurinj committed Jul 1, 2024
    Configuration menu
    Copy the full SHA
    c721811 View commit details
    Browse the repository at this point in the history
  2. Fixed nomenclature in backend beachball plot

    The latitude and longitude were swapped in scatter mode of moment tensor plot. I somehow circumvented the issue by also swapping the inputs which hid the discrepancy until this fix. All MT tradeoffs figures have been re-tested.
    thurinj committed Jul 1, 2024
    Configuration menu
    Copy the full SHA
    9b9d303 View commit details
    Browse the repository at this point in the history

Commits on Jul 5, 2024

  1. Configuration menu
    Copy the full SHA
    09e3e81 View commit details
    Browse the repository at this point in the history

Commits on Aug 1, 2024

  1. Implemented warning message and reorganization

    Added a warning message that displays when the script is used.
    
    _plot_latlon_matplotlib has been moved to be right after _plot_depth_matplotlib.
    
    Implemented warning message for beachball plotting.
    
    Added a custom warning message for beachball plot, since it is not a "conventional" implementation a-la psmeca.
    thurinj committed Aug 1, 2024
    Configuration menu
    Copy the full SHA
    f808720 View commit details
    Browse the repository at this point in the history

Commits on Aug 19, 2024

  1. Added parabola fit to the depth plot

    I added a parabola to the depth plot, with an estimate of the best fitting depth at the minimum of the parabola. It will print the best value and the ± error from a 5% uncertainty threshold.
    thurinj committed Aug 19, 2024
    Configuration menu
    Copy the full SHA
    0c61540 View commit details
    Browse the repository at this point in the history
  2. Remove uncessary cluge for moment tensor orientation with respect to …

    …the 3D projection.
    
    I originally had the axes for the sphere projection be separate from the moment tensor
    thurinj committed Aug 19, 2024
    Configuration menu
    Copy the full SHA
    36404ae View commit details
    Browse the repository at this point in the history

Commits on Aug 21, 2024

  1. Removed unused functions.

    thurinj committed Aug 21, 2024
    Configuration menu
    Copy the full SHA
    91784c9 View commit details
    Browse the repository at this point in the history
  2. Updated code generator so that it fits the changes in DetailedAnalysi…

    …s.py and Waveforms+Polarities.py
    thurinj committed Aug 21, 2024
    Configuration menu
    Copy the full SHA
    a70846b View commit details
    Browse the repository at this point in the history