From a7e18863f8fd5b2a8700b39afdf575e1b63c9827 Mon Sep 17 00:00:00 2001 From: lmoesing Date: Tue, 4 Sep 2018 17:19:21 +0200 Subject: [PATCH 1/2] added ulon and ulat which can be used for other functions to get the unique lon/lat values --- pygeogrids/grids.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pygeogrids/grids.py b/pygeogrids/grids.py index 5adac20..35be415 100644 --- a/pygeogrids/grids.py +++ b/pygeogrids/grids.py @@ -170,6 +170,9 @@ def __init__(self, lon, lat, gpis=None, geodatum='WGS84', subset=None, self.arrlon = lon self.arrlat = lat + self.ulon = np.unique(lon) + self.ulat = np.unique(lat) + self.shape = None if shape is not None and len(shape) == 2: @@ -720,7 +723,7 @@ def __eq__(self, other): class CellGrid(BasicGrid): """ - Grid that has lat,lon coordinates as well as cell informatin. It can find + Grid that has lat,lon coordinates as well as cell information. It can find nearest neighbour. It can also yield the gpi, lat, lon, cell information in cell order. This is important if the data on the grid is saved in cell files on disk as we can go through all grid points with optimized From 347deb013f6db9575a7f5e853680bdfd2ceb436c Mon Sep 17 00:00:00 2001 From: Lmoesinger <40267260+Lmoesinger@users.noreply.github.com> Date: Wed, 5 Sep 2018 09:59:58 +0200 Subject: [PATCH 2/2] update description --- pygeogrids/grids.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pygeogrids/grids.py b/pygeogrids/grids.py index 35be415..94f9659 100644 --- a/pygeogrids/grids.py +++ b/pygeogrids/grids.py @@ -100,6 +100,10 @@ class BasicGrid(object): 1D array of all longitudes of the grid arrlat : numpy.array 1D array of all latitudes of the grid + ulon : np.array + 1D array containing the unique longitudes of the grid + ulat : np.array + 1d array containing the unique latitudes of the grid n_gpi : int number of gpis in the grid gpidirect : boolean