@@ -2135,7 +2135,6 @@ def _get_2comp_pars_covs(self,
2135
2135
mdl_description : str ,
2136
2136
index : int ,
2137
2137
comps : tuple [int , int ],
2138
- num_mdl_comps : int ,
2139
2138
use_vars : bool ,
2140
2139
use_covs : bool
2141
2140
) -> tuple [np .ndarray , np .ndarray | None ]:
@@ -2151,10 +2150,9 @@ def _get_2comp_pars_covs(self,
2151
2150
.var [index , comps ]
2152
2151
for station in stat_list_in ], axis = 0 )
2153
2152
if use_covs :
2154
- linear_index_cov = index * num_mdl_comps
2155
2153
covlist = [station
2156
2154
.models [ts_description ][mdl_description ]
2157
- .cov [ linear_index_cov + comps [ 0 ], linear_index_cov + comps [ 1 ] ]
2155
+ .get_cov_by_index ( index )[ comps ]
2158
2156
for station in stat_list_in ]
2159
2157
covs = np .concatenate ([covs , np .array (covlist ).reshape (- 1 , 1 )], axis = 1 )
2160
2158
else :
@@ -2272,7 +2270,6 @@ def hom_velocity_field(self,
2272
2270
lat0 , lon0 = ref_stat .location [0 ], ref_stat .location [1 ]
2273
2271
linear_index = ref_stat .models [ts_description ][mdl_description ].get_exp_index (1 )
2274
2272
use_vars &= ref_stat .models [ts_description ][mdl_description ].cov is not None
2275
- num_mdl_comps = ref_stat .models [ts_description ][mdl_description ].num_parameters
2276
2273
v_pred_cols = [ref_stat [ts_description ].data_cols [c ] for c in comps ]
2277
2274
# for the inversion, we need the indices of the subsets
2278
2275
ix_in = [n in stat_names_in for n in stat_names_valid ]
@@ -2288,7 +2285,7 @@ def hom_velocity_field(self,
2288
2285
# get all velocities and weights for subset
2289
2286
vels , weights = self ._get_2comp_pars_covs (stat_list_in , ts_description ,
2290
2287
mdl_description , linear_index , comps ,
2291
- num_mdl_comps , use_vars , use_covs )
2288
+ use_vars , use_covs )
2292
2289
# calculate homogenous translation, strain, and rotation
2293
2290
v_O , epsilon , omega = get_hom_vel_strain_rot (lon_lat_in , vels , weights ,
2294
2291
utmzone = utmzone , reference = [lon0 , lat0 ])
@@ -2382,7 +2379,6 @@ def euler_rot_field(self,
2382
2379
ref_stat = stat_list_in [reference_index ]
2383
2380
linear_index = ref_stat .models [ts_description ][mdl_description ].get_exp_index (1 )
2384
2381
use_vars &= ref_stat .models [ts_description ][mdl_description ].cov is not None
2385
- num_mdl_comps = ref_stat .models [ts_description ][mdl_description ].num_parameters
2386
2382
v_pred_cols = [ref_stat [ts_description ].data_cols [c ] for c in comps ]
2387
2383
# for the inversion, we need the indices of the subsets
2388
2384
ix_in = [n in stat_names_in for n in stat_names_valid ]
@@ -2396,7 +2392,7 @@ def euler_rot_field(self,
2396
2392
# get all velocities and weights for subset
2397
2393
vels , weights = self ._get_2comp_pars_covs (stat_list_in , ts_description ,
2398
2394
mdl_description , linear_index , comps ,
2399
- num_mdl_comps , use_vars , use_covs )
2395
+ use_vars , use_covs )
2400
2396
# calculate Euler pole from input list
2401
2397
rotation_vector , rotation_covariance = \
2402
2398
estimate_euler_pole (lon_lat_in , vels , weights )
0 commit comments