Skip to content

Omega rework#341

Closed
thurinj wants to merge 3 commits intomasterfrom
omega_rework
Closed

Omega rework#341
thurinj wants to merge 3 commits intomasterfrom
omega_rework

Conversation

@thurinj
Copy link
Member

@thurinj thurinj commented Feb 12, 2026

This is a very long overdue PR for the omega angle calculation and confidence curve plot.

I just finished doing a large swath of validation test to make sure everything is right and follows the Tape and Tape 2016 and Tape and Tape 2017 papers.

Here's an example that reproduces the 2017's Figure 3, where we move the considered point vertically along the center of the lune (full moment tensor space for reference in dotted line):
vhat_isotropic_points_tapetape

and the Figure 2 (moving along the equator of the eigenvalue lune):
vhat_gamma_points_tapetape

Before the rework

The _calculate_omega appeared to yield very inconsistent result when compared with the expected analytical solution (the vertical lines are the critical ω_i for the derivative of the fractional volume curve):
vhat_validation_beta_90_old
vhat_validation_beta_60_old
vhat_validation_gamma_18_old

After the rework

The issue came from the fact that the original method tried to use the moment tensor as a 6D vector, and some of the computation were not accounting for the off-diag terms of the tensor properly. The new formulation explicitly builds the 3x3 tensor to compute the inter-tensor distance.
vhat_validation_beta_90
vhat_validation_beta_60
vhat_validation_gamma_18

This pull request also adds the confidence curve figure, with average confidence score plotted over the shaded area like in Tape and Tape 2016's Figure 1.

To this day, we had made some checks with @SeismoFelix, but only on the DC and FMT space. We now have also the checks on arbitrary coordinates on the lune.

@rmodrak, @SeismoFelix or @ammcpherson, if you want to have a look before I merge that'd be awesome.

ps: @carltape turns out there is another method to compute the critical angle, based on the angular distance between the 6 permutations around the eigensphere. Here an example, say we have $Λ^{DC}$:
$$\Lambda^{DC} = \left(\tfrac{1}{\sqrt{2}},\ 0,\ -\tfrac{1}{\sqrt{2}}\right)$$
if we compute the dot product between the 6 permutations:
(0, 1, 2), (0, 2, 1), (1, 0, 2), (1, 2, 0), (2, 0, 1), (2, 1, 0)
we get the following angles:

Pair Dot product $\omega$
$(0,1,2)\cdot(0,1,2)$ $+1$ $0°$
$(0,1,2)\cdot(0,2,1)$ $+\tfrac{1}{2}$ $60°$
$(0,1,2)\cdot(1,0,2)$ $+\tfrac{1}{2}$ $60°$
$(0,1,2)\cdot(1,2,0)$ $-\tfrac{1}{2}$ $120°$
$(0,1,2)\cdot(2,0,1)$ $-\tfrac{1}{2}$ $120°$
$(0,1,2)\cdot(2,1,0)$ $-1$ $180°$

Added a new backend function for confidence curve plotting. The default figure it produces should be a good all-around figure (used as is, or as a sub-figure in a large one like in Alvizuri and Tape 2018 a,b)
I've re-implemented the angular distance computation. The previous implementation was based on vector operation, and lead to inconsistencies (the computation based on vector was NOT equivalent to the regular distance computation from matrices).
Added the main confidence curve plotting function `plot_confidence_curve`.

The figure generated is based on the ratio between empirical green's function, and an homogeneous distribution (obtained from zeroing out the misfit value in the second `_calculate_pdf` call).
This is equivalent to estimating the fractional volume from the histogram of uniformly distributed tensor, with equal likelyhood.
@thurinj
Copy link
Member Author

thurinj commented Feb 17, 2026

Not sure why the check is failing after the hotfix in commit 53e2091. I am going to try out to close and re-open the PR to check if it solves the issue.

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

Successfully merging this pull request may close these issues.

1 participant