diff --git a/modules/util/lon_lat_grid.py b/modules/util/lon_lat_grid.py index f14c779e8507e4de6930d28a6a1facb97f556201..73cffdf3d19b837a75767483fbded46e9df923d6 100644 --- a/modules/util/lon_lat_grid.py +++ b/modules/util/lon_lat_grid.py @@ -44,6 +44,8 @@ class LonLatGrid: flons = flons[keep] flats = flats[keep] + self.lon_lo, self.lon_hi = flons.min(), flons.max() + self.lat_lo, self.lat_hi = flats.min(), flats.max() points = np.stack([flons, flats], axis=1) @@ -177,6 +179,9 @@ class LonLatGrid: return outv + def check_inside(self, lon, lat): + return (self.lon_lo < lon < self.lon_hi) & (self.lat_lo < lat < self.lat_hi) + DEG_TO_RAD = np.pi/180.0; RAD_TO_DEG = 180.0/np.pi;