@@ -161,17 +161,24 @@ def gcmt_to_realisation(
161161 ].set_index ("PublicID" )
162162
163163 if gcmt_event_id in gcmt_solutions .index :
164- solution = gcmt_solutions .loc [gcmt_event_id ]
165- latitude = solution ["Latitude" ]
166- longitude = solution ["Longitude" ]
167- centroid_depth = solution ["CD" ]
168- magnitude = solution ["Mw" ]
169- nodal_plane_1 = NodalPlane (
170- solution ["strike1" ], solution ["dip1" ], solution ["rake1" ]
171- )
172- nodal_plane_2 = NodalPlane (
173- solution ["strike2" ], solution ["dip2" ], solution ["rake2" ]
174- )
164+ latitude = gcmt_solutions .at [gcmt_event_id , "Latitude" ]
165+ longitude = gcmt_solutions .at [gcmt_event_id , "Longitude" ]
166+ centroid_depth = gcmt_solutions .at [gcmt_event_id , "CD" ]
167+ magnitude = gcmt_solutions .at [gcmt_event_id , "Mw" ]
168+ strike1 = gcmt_solutions .at [gcmt_event_id , "strike1" ]
169+ dip1 = gcmt_solutions .at [gcmt_event_id , "dip1" ]
170+ rake1 = gcmt_solutions .at [gcmt_event_id , "rake1" ]
171+ strike2 = gcmt_solutions .at [gcmt_event_id , "strike2" ]
172+ dip2 = gcmt_solutions .at [gcmt_event_id , "dip2" ]
173+ rake2 = gcmt_solutions .at [gcmt_event_id , "rake2" ]
174+ assert isinstance (strike1 , float | int )
175+ assert isinstance (dip1 , float | int )
176+ assert isinstance (rake1 , float | int )
177+ assert isinstance (strike2 , float | int )
178+ assert isinstance (dip2 , float | int )
179+ assert isinstance (rake2 , float | int )
180+ nodal_plane_1 = NodalPlane (strike1 , dip1 , rake1 )
181+ nodal_plane_2 = NodalPlane (strike2 , rake2 , dip2 )
175182 elif gcmt_event_id in automated_gcmt_solutions :
176183 solution = automated_gcmt_solutions [gcmt_event_id ]
177184 latitude = solution ["location" ]["latitude" ]
@@ -203,6 +210,7 @@ def gcmt_to_realisation(
203210 # Calculate dip direction from strike (strike + 90 degrees for right-hand rule)
204211 dip_direction = (selected_nodal_plane .strike + 90 ) % 360
205212
213+ assert isinstance (magnitude , float )
206214 length , width = magnitude_scaling .magnitude_to_length_width (
207215 scaling_relation , magnitude , rake
208216 )
@@ -217,6 +225,7 @@ def gcmt_to_realisation(
217225 length_m = length_km * 1000 # Convert km to meters
218226 width_m = width_km * 1000 # Convert km to meters
219227
228+ assert isinstance (centroid_depth , float )
220229 source_geometry = sources .Point .from_lat_lon_depth (
221230 point_coordinates = np .array (
222231 [latitude , longitude , centroid_depth * 1000 ]
0 commit comments