Correct moment and depth calculations for velocity model#103
Conversation
There was a problem hiding this comment.
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-srfpoint-source velocity model depth construction to use layer top depths (instead of bottom depths). - Update
gcmt-to-realisationto derivemagnitudefrom solution moment (Mo/moment) viamoment.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.
There was a problem hiding this comment.
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.
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>
There was a problem hiding this comment.
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.
Implements two fixes:
realisation-to-srf, but currently calculates the bottom depth.Mwcolumn 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.