2020from geoh5py .groups .property_group import GroupTypeEnum
2121from geoh5py .objects import Curve
2222from geoh5py .workspace import Workspace
23+ from simpeg .utils .mat_utils import cartesian2amplitude_dip_azimuth
2324
2425from simpeg_drivers .components .factories import DirectivesFactory
2526from simpeg_drivers .potential_fields import (
@@ -213,7 +214,7 @@ def test_magnetic_vector_reference(
213214 tmi_uncertainty = 5.0 ,
214215 data_object = components .survey ,
215216 starting_model = components .model ,
216- reference_model = 1 .0 ,
217+ reference_model = 0 .0 ,
217218 reference_inclination = 30 ,
218219 reference_declination = 0 ,
219220 )
@@ -224,13 +225,10 @@ def test_magnetic_vector_reference(
224225 assert np .all (driver .models .reference_inclination == 30 )
225226 assert np .all (driver .models .reference_declination == 0 )
226227
227- np .allclose (
228- np .kron (
229- np .r_ [0 , np .cos (- np .deg2rad (30 )), np .sin (- np .deg2rad (30 ))],
230- np .ones (driver .models .n_active ),
231- ),
232- driver .models .reference_model ,
233- )
228+ ref_model = driver .models .reference_model
229+ ref_spherical = cartesian2amplitude_dip_azimuth (ref_model .reshape (- 1 , 3 , order = "F" ))
230+ np .allclose (ref_spherical [0 , 1 ], 30 )
231+ np .allclose (ref_spherical [0 , 2 ], 0 )
234232
235233
236234if __name__ == "__main__" :
0 commit comments