Location: source_modelling/fsp.py:120
What happens: FspSegment.to_plane converts the great-circle strike to an NZTM bearing, but passes the segment's width as the shift distance:
120: strike_nztm = coordinates.great_circle_bearing_to_nztm_bearing(
121: self.top_centre, self.width, self.strike
122: )
The distance parameter of great_circle_bearing_to_nztm_bearing is the distance shifted along the bearing being converted (qcore/coordinates.py:193-194, "The distance to shift"; the implementation calls geo.ll_shift(x, y, distance, great_circle_bearing)). Since the bearing here is the strike, the distance should be the along-strike extent (self.length), not the down-dip width.
Why that's wrong: srf.py:608-612 performs the same conversion for a strike and correctly passes the along-strike segment_header["len"]. Within to_plane itself, self.width is legitimately the distance for the dip direction (used at :127 for projected_width_m), so the strike call is reusing the wrong extent.
How to reproduce: For any FSP segment with length != width, strike_nztm is computed from a shift of width km rather than length km along the strike bearing.
Scale, measured at origin (-43.5, 172.6) with a great-circle bearing of 45 deg:
distance = 5.0 km -> 44.826196
distance = 20.0 km -> 44.826554
distance = 60.0 km -> 44.827250
In practice the numerical impact is tiny — about 0.001 deg across a 5-60 km range, since the NZTM convergence correction is dominated by the origin latitude rather than the distance. So this is a correctness/clarity fix rather than a bug with visible consequences, and it is not urgent. Filing it because the argument is plainly the wrong quantity and will mislead the next reader.
Suggested direction: Pass self.length at :121. Naming the parameter at the call site (distance=self.length) would make the pairing with self.strike obvious.
Confidence: high (that the argument is wrong); low (that it changes any result materially)
Location:
source_modelling/fsp.py:120What happens:
FspSegment.to_planeconverts the great-circle strike to an NZTM bearing, but passes the segment's width as the shift distance:The
distanceparameter ofgreat_circle_bearing_to_nztm_bearingis the distance shifted along the bearing being converted (qcore/coordinates.py:193-194, "The distance to shift"; 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 (self.length), not the down-dip width.Why that's wrong:
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 (used at:127forprojected_width_m), so the strike call is reusing the wrong extent.How to reproduce: For any FSP segment with
length != width,strike_nztmis computed from a shift ofwidthkm rather thanlengthkm along the strike bearing.Scale, measured at origin
(-43.5, 172.6)with a great-circle bearing of 45 deg:In practice the numerical impact is tiny — about 0.001 deg across a 5-60 km range, since the NZTM convergence correction is dominated by the origin latitude rather than the distance. So this is a correctness/clarity fix rather than a bug with visible consequences, and it is not urgent. Filing it because the argument is plainly the wrong quantity and will mislead the next reader.
Suggested direction: Pass
self.lengthat:121. Naming the parameter at the call site (distance=self.length) would make the pairing withself.strikeobvious.Confidence: high (that the argument is wrong); low (that it changes any result materially)