Use along-strike length when converting the FSP strike bearing - #106
Merged
Conversation
great_circle_bearing_to_nztm_bearing takes the distance shifted along the bearing being converted, but FspSegment.to_plane passed the segment's down-dip width while converting its strike. srf.py does the same conversion for a strike and correctly passes the along-strike len. The numerical effect is small -- the NZTM convergence correction varies by roughly 0.001 degrees between 5 and 60 km, being dominated by origin latitude rather than distance -- so this is a correctness and clarity fix rather than one with visible consequences. self.width remains the right distance for the dip direction a few lines below. Fixes #91 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #91
Problem
FspSegment.to_planeconverted the great-circle strike to an NZTM bearing but passed the segment's width as the shift distance:The
distanceparameter is the distance shifted along the bearing being converted (qcore/coordinates.py:193-194; the implementation callsgeo.ll_shift(x, y, distance, great_circle_bearing)). Since the bearing here is the strike, the distance should be the along-strike extent.srf.py:608-612performs the same conversion for a strike and correctly passes the along-strikesegment_header["len"]. Withinto_planeitself,self.widthis legitimately the distance for the dip direction a few lines below, which is where the confusion came from.Scale of the effect — small
Measured at origin
(-43.5, 172.6)for a great-circle bearing of 45 degrees:About 0.001 degrees across a 5-60 km range: the NZTM convergence correction is dominated by origin latitude, not by distance. So this is a correctness and clarity fix, not one with visible consequences — flagged because the argument is plainly the wrong quantity and will mislead the next reader. I would not prioritise merging it.
Changes
source_modelling/fsp.py— passself.length.No test added: the difference is far below any tolerance a meaningful assertion could use, so a test would either be vacuous or pin down floating-point noise. The
srf.pyprecedent is the real evidence.Verification
pytest tests/test_fsp.py— 158 passed.ruff check,ruff formatclean.🤖 Generated with Claude Code