@@ -2116,7 +2116,6 @@ def _get_2comp_pars_covs(self,
2116
2116
mdl_description : str ,
2117
2117
index : int ,
2118
2118
comps : tuple [int , int ],
2119
- num_mdl_comps : int ,
2120
2119
use_vars : bool ,
2121
2120
use_covs : bool
2122
2121
) -> tuple [np .ndarray , np .ndarray | None ]:
@@ -2132,10 +2131,9 @@ def _get_2comp_pars_covs(self,
2132
2131
.var [index , comps ]
2133
2132
for station in stat_list_in ], axis = 0 )
2134
2133
if use_covs :
2135
- linear_index_cov = index * num_mdl_comps
2136
2134
covlist = [station
2137
2135
.models [ts_description ][mdl_description ]
2138
- .cov [ linear_index_cov + comps [ 0 ], linear_index_cov + comps [ 1 ] ]
2136
+ .get_cov_by_index ( index )[ comps ]
2139
2137
for station in stat_list_in ]
2140
2138
covs = np .concatenate ([covs , np .array (covlist ).reshape (- 1 , 1 )], axis = 1 )
2141
2139
else :
@@ -2253,7 +2251,6 @@ def hom_velocity_field(self,
2253
2251
lat0 , lon0 = ref_stat .location [0 ], ref_stat .location [1 ]
2254
2252
linear_index = ref_stat .models [ts_description ][mdl_description ].get_exp_index (1 )
2255
2253
use_vars &= ref_stat .models [ts_description ][mdl_description ].cov is not None
2256
- num_mdl_comps = ref_stat .models [ts_description ][mdl_description ].num_parameters
2257
2254
v_pred_cols = [ref_stat [ts_description ].data_cols [c ] for c in comps ]
2258
2255
# for the inversion, we need the indices of the subsets
2259
2256
ix_in = [n in stat_names_in for n in stat_names_valid ]
@@ -2269,7 +2266,7 @@ def hom_velocity_field(self,
2269
2266
# get all velocities and weights for subset
2270
2267
vels , weights = self ._get_2comp_pars_covs (stat_list_in , ts_description ,
2271
2268
mdl_description , linear_index , comps ,
2272
- num_mdl_comps , use_vars , use_covs )
2269
+ use_vars , use_covs )
2273
2270
# calculate homogenous translation, strain, and rotation
2274
2271
v_O , epsilon , omega = get_hom_vel_strain_rot (lon_lat_in , vels , weights ,
2275
2272
utmzone = utmzone , reference = [lon0 , lat0 ])
@@ -2363,7 +2360,6 @@ def euler_rot_field(self,
2363
2360
ref_stat = stat_list_in [reference_index ]
2364
2361
linear_index = ref_stat .models [ts_description ][mdl_description ].get_exp_index (1 )
2365
2362
use_vars &= ref_stat .models [ts_description ][mdl_description ].cov is not None
2366
- num_mdl_comps = ref_stat .models [ts_description ][mdl_description ].num_parameters
2367
2363
v_pred_cols = [ref_stat [ts_description ].data_cols [c ] for c in comps ]
2368
2364
# for the inversion, we need the indices of the subsets
2369
2365
ix_in = [n in stat_names_in for n in stat_names_valid ]
@@ -2377,7 +2373,7 @@ def euler_rot_field(self,
2377
2373
# get all velocities and weights for subset
2378
2374
vels , weights = self ._get_2comp_pars_covs (stat_list_in , ts_description ,
2379
2375
mdl_description , linear_index , comps ,
2380
- num_mdl_comps , use_vars , use_covs )
2376
+ use_vars , use_covs )
2381
2377
# calculate Euler pole from input list
2382
2378
rotation_vector , rotation_covariance = \
2383
2379
estimate_euler_pole (lon_lat_in , vels , weights )
0 commit comments