コード例 #1
0
 def nearest_point(self, point):
     assert type(point) == Location4D
     new = self._copy()
     for var in new._current_variables:
         grid = new.getgridobj(var)
         if grid != None:
             inds, inds = new.get_xyind_from_point(var, point)
             grid._xarray = _sub_by_nan2(grid._xarray, inds)
             grid._yarray = _sub_by_nan2(grid._yarray, inds)
             new._coordcache[var].xy = grid
     return new
コード例 #2
0
ファイル: c_grid.py プロジェクト: acrosby/paegan
 def nearest_point(self, point):
     assert type(point) == Location4D
     new = self._copy()
     for var in new._current_variables:
         grid = new.getgridobj(var)
         if grid != None:
             inds, inds = new.get_xyind_from_point(var, point)
             grid._xarray = _sub_by_nan2(grid._xarray, inds)
             grid._yarray = _sub_by_nan2(grid._yarray, inds)
             new._coordcache[var].xy = grid
     return new
コード例 #3
0
 def restrict_bbox(self, bbox=None, **kwargs):
     assert bbox != None
     assert len(bbox) == 4
     new = self._copy()
     for var in new._current_variables:
         grid = new.getgridobj(var)
         if grid != None:
             inds, inds = new.get_xyind_from_bbox(var, bbox)
             grid._xarray = _sub_by_nan2(grid._xarray, inds)
             grid._yarray = _sub_by_nan2(grid._yarray, inds)
             new._coordcache[var].xy = grid
     return new
コード例 #4
0
ファイル: c_grid.py プロジェクト: acrosby/paegan
 def restrict_bbox(self, bbox = None, **kwargs):
     assert bbox != None
     assert len(bbox) == 4
     new = self._copy()
     for var in new._current_variables:
         grid = new.getgridobj(var)
         if grid != None:
             inds, inds = new.get_xyind_from_bbox(var, bbox)
             grid._xarray = _sub_by_nan2(grid._xarray, inds)
             grid._yarray = _sub_by_nan2(grid._yarray, inds)
             new._coordcache[var].xy = grid
     return new