Skip to content

Correct moment and depth calculations for velocity model#103

Merged
lispandfound merged 9 commits into
pegasusfrom
vm_depth
May 5, 2026
Merged

Correct moment and depth calculations for velocity model#103
lispandfound merged 9 commits into
pegasusfrom
vm_depth

Conversation

@lispandfound
Copy link
Copy Markdown
Contributor

Implements two fixes:

  1. The velocity model should calculate the top depth for the velocity model and slip calculations in realisation-to-srf, but currently calculates the bottom depth.
  2. As discussed in a recent Monday meeting, the Mw column in the GCMT solutions is no good due to rounding errors and we should use provided moment directly to invert for magnitude.

This PR goes with this source modelling PR which updates the slip calculation.

Copilot AI review requested due to automatic review settings May 4, 2026 23:05
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR corrects two seismic source calculation issues in the workflow tooling: (1) fixing velocity-model depth handling for point-source slip/velocity calculations, and (2) computing magnitude from the provided seismic moment (rather than the rounded Mw column) when generating realisations from GCMT solutions.

Changes:

  • Adjust realisation-to-srf point-source velocity model depth construction to use layer top depths (instead of bottom depths).
  • Update gcmt-to-realisation to derive magnitude from solution moment (Mo / moment) via moment.moment_to_magnitude.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
workflow/scripts/realisation_to_srf.py Fixes depth array construction so slip/depth-dependent lookups use layer top depths.
workflow/scripts/gcmt_to_realisation.py Switches magnitude derivation to use provided moment, avoiding Mw rounding issues.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the magnitude calculation logic in gcmt_to_realisation.py to derive magnitude from the seismic moment and adjusts the depth calculation in realisation_to_srf.py to use the top of the velocity layers. Feedback suggests explicitly casting the seismic moment to a float for consistency and robustness, as well as using a copy of the velocity model dataframe to avoid side effects from in-place modifications.

Comment thread workflow/scripts/gcmt_to_realisation.py Outdated
Comment thread workflow/scripts/realisation_to_srf.py Outdated
lispandfound and others added 5 commits May 5, 2026 11:24
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 5 out of 6 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@lispandfound lispandfound merged commit 91478cd into pegasus May 5, 2026
11 checks passed
@lispandfound lispandfound deleted the vm_depth branch May 5, 2026 02:31
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.

4 participants