22"""
33BSD 3-Clause License
44
5- Copyright (c) 2023 , University of Southern California
5+ Copyright (c) 2026 , University of Southern California
66All rights reserved.
77
88Redistribution and use in source and binary forms, with or without
@@ -376,7 +376,7 @@ def write_xyz_srf(self, srf_file, xyz_srf_file, T3M):
376376 lon = float (tokens [0 ])
377377 lat = float (tokens [1 ])
378378 [x_cart , y_cart ] = self .geo2cart (lon , lat , self .min_lon , self .min_lat )
379- tmp = T3M * np .mat ([x_cart , y_cart , 0 , 1 ]).transpose ()
379+ tmp = T3M * np .asmatrix ([x_cart , y_cart , 0 , 1 ]).transpose ()
380380 tokens [0 ] = str (float (tmp [0 ]))
381381 tokens [1 ] = str (float (tmp [1 ]))
382382 outfile .write (" %s\n " % " " .join (tokens ))
@@ -411,7 +411,7 @@ def write_xyz_srf(self, srf_file, xyz_srf_file, T3M):
411411 lat = float (tokens [1 ])
412412 [x_cart , y_cart ] = self .geo2cart (lon , lat ,
413413 self .min_lon , self .min_lat )
414- tmp = T3M * np .mat ([x_cart , y_cart , 0 , 1 ]).transpose ()
414+ tmp = T3M * np .asmatrix ([x_cart , y_cart , 0 , 1 ]).transpose ()
415415 tokens [0 ] = str (float (tmp [0 ]))
416416 tokens [1 ] = str (float (tmp [1 ]))
417417 outfile .write (" %s\n " % " " .join (tokens ))
@@ -540,9 +540,9 @@ def run(self, slo, coord_out_file, fault_out_file,
540540
541541 # % matrix to translate to new minimum values (minimum is [0 0])
542542 T3 = self .translation_matrix ([- x_min , - y_min , 0 ])
543- T3M = np .mat (T3 )
543+ T3M = np .asmatrix (T3 )
544544 # % shift opposite corner in x-y
545- tmp = T3M * np .mat ([x_max , y_max , 0 , 1 ]).transpose ()
545+ tmp = T3M * np .asmatrix ([x_max , y_max , 0 , 1 ]).transpose ()
546546 bbextent = [float (tmp [0 ]), float (tmp [1 ])]
547547
548548 # Write station coord_out file
@@ -551,13 +551,13 @@ def run(self, slo, coord_out_file, fault_out_file,
551551
552552 sfile = open (coord_out_file , 'w' )
553553 for i in range (0 , n_stat ):
554- tmp = T3M * np .mat ([x_stat [i ], y_stat [i ], 0 , 1 ]).transpose ()
554+ tmp = T3M * np .asmatrix ([x_stat [i ], y_stat [i ], 0 , 1 ]).transpose ()
555555 BBx_stat .append (float (tmp [0 ]))
556556 BBy_stat .append (float (tmp [1 ]))
557557 sfile .write ("%8.4f\t %8.4f\n " % (BBx_stat [i ], BBy_stat [i ]))
558558 sfile .close ()
559559
560- tmp = T3M * np .mat ([hypo_x_cart , hypo_y_cart , 0 , 1 ]).transpose ()
560+ tmp = T3M * np .asmatrix ([hypo_x_cart , hypo_y_cart , 0 , 1 ]).transpose ()
561561 BBx_hypo = float (tmp [0 ])
562562 BBy_hypo = float (tmp [1 ])
563563
@@ -574,14 +574,14 @@ def run(self, slo, coord_out_file, fault_out_file,
574574
575575 # < put the 'where' point at the axis origin >
576576 T1 = self .translation_matrix ([- corn_x , - corn_y , 0 ])
577- T1M = np .mat (T1 )
577+ T1M = np .asmatrix (T1 )
578578
579579 # < align the fault plane to the north axis >
580580 c = np .cos (np .pi / 180 * self .f_strike [0 ])
581581 s = np .sin (np .pi / 180 * self .f_strike [0 ])
582582 T2 = np .array ([[c , - s , 0 , 0 ], [s , c , 0 , 0 ],
583583 [0 , 0 , 1 , 0 ], [0 , 0 , 0 , 1 ]])
584- T2M = np .mat (T2 )
584+ T2M = np .asmatrix (T2 )
585585
586586 # inverse matrixes for inverse transform
587587 T1M_inv = np .linalg .inv (T1M )
@@ -608,7 +608,7 @@ def run(self, slo, coord_out_file, fault_out_file,
608608 math .sin (math .radians (self .f_dip [plane ])) +
609609 j * math .sin (math .radians (self .f_dip [plane ])))
610610 tmp = (T1M_inv * T2M_inv *
611- np .mat ([x_term , y_term , 0 , 1 ]).transpose ())
611+ np .asmatrix ([x_term , y_term , 0 , 1 ]).transpose ())
612612 sub_coord [j ].append ([float (tmp [0 ]),
613613 float (tmp [1 ]),
614614 z_term ])
0 commit comments