From 213f20b07a53d371cd5c3f04393ec829d49a7b88 Mon Sep 17 00:00:00 2001 From: Jonathan Guinet Date: Fri, 1 Dec 2023 09:03:49 +0100 Subject: [PATCH] refac: change member of grid --- shareloc/geofunctions/localization.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/shareloc/geofunctions/localization.py b/shareloc/geofunctions/localization.py index 7a714e1..1b5037e 100755 --- a/shareloc/geofunctions/localization.py +++ b/shareloc/geofunctions/localization.py @@ -136,9 +136,10 @@ def inverse(self, lon, lat, h=None, using_geotransform=False): :rtype: Tuple(1D np.ndarray row position, 1D np.ndarray col position, 1D np.ndarray alt) """ - if not self.use_rpc and not hasattr(self.model, "pred_ofset_scale_lon"): + if not self.use_rpc: # for grids only - self.model.estimate_inverse_loc_predictor() + if self.model.pred_ofset_scale_lon is None: + self.model.estimate_inverse_loc_predictor() if h is None: h = self.default_elevation