def getIndex(self): """Get the grid index""" if self._index_ is None: latlin = numpy.ma.filled(self._lataxis_) lonlin = numpy.ma.filled(self._lonaxis_) self._index_ = bindex.bindexHorizontalGrid(latlin, lonlin) return self._index_
def getIndex(self): """Get the grid index""" if self._index_ is None: # Trying to stick in Stephane Raynaud's patch for autodetection nj, ni = self._lataxis_.shape dlon = numpy.max(self._lonaxis_) - numpy.min(self._lonaxis_) dx = max(dlon / ni, dlon / nj) dlat = numpy.max(self._lataxis_) - numpy.min(self._lataxis_) dy = max(dlat / ni, dlat / nj) latlin = numpy.ravel(numpy.ma.filled(self._lataxis_)) lonlin = numpy.ravel(numpy.ma.filled(self._lonaxis_)) _bindex.setDeltas(dx, dy) self._index_ = bindex.bindexHorizontalGrid(latlin, lonlin) return self._index_
def getIndex(self): """Get the grid index""" if self._index_ is None: # Trying to stick in Stephane Raynaud's patch for autodetection nj,ni = self._lataxis_.shape dlon = numpy.max(self._lonaxis_)-numpy.min(self._lonaxis_) dx = max(dlon/ni,dlon/nj) dlat = numpy.max(self._lataxis_)-numpy.min(self._lataxis_) dy = max(dlat/ni,dlat/nj) latlin = numpy.ravel(numpy.ma.filled(self._lataxis_)) lonlin = numpy.ravel(numpy.ma.filled(self._lonaxis_)) _bindex.setDeltas(dx,dy) self._index_ = bindex.bindexHorizontalGrid(latlin, lonlin) return self._index_