示例#1
0
    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_
示例#2
0
    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_
示例#3
0
文件: hgrid.py 项目: NESII/uvcdat
    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_