original_docstring: 
          Open the raster. Store the points in a Series - a labeled
          numpy array. Then in _purge array, we iterate over the masks
          and the paths_map and drop pixels where masks = 1 and pixels where bound = 0.
          
docstring: Open the raster. Store the points in a Series - a labeled
  numpy array. Then in _purge array, we iterate over the masks
  and the paths_map and drop pixels where masks = 1 and pixels where bound = 0.
docstring_tokens: Open the raster . Store the points in a Series - a labeled numpy array . Then in _purge array we iterate over the masks and the paths_map and drop pixels where masks = 1 and pixels where bound = 0 .
code: def _grid_raster_extract(self, raster, _name):
          """
          Open the raster. Store the points in a Series - a labeled
          numpy array. Then in _purge array, we iterate over the masks
          and the paths_map and drop pixels where masks = 1 and pixels where bound = 0.
          """
  
          with rasopen(raster, 'r') as rsrc:
              rass_arr = rsrc.read()
              rass_arr = rass_arr.reshape(rass_arr.shape[1], rass_arr.shape[2])
              affine = rsrc.transform
  
          s = Series(index=range(0, self.extracted_points.shape[0]), name=_name, dtype=object)
          for ind, row in self.extracted_points.iterrows():
              x, y = self._geo_point_to_projected_coords(row['X'], row['Y'])
              c, r = ~affine * (x, y)
              try:
                  ofs = self.kernel_size // 2
                  rr = int(r); cc = int(c)
                  raster_subgrid = rass_arr[rr-ofs:rr+ofs+1, cc-ofs:cc+ofs+1] # possible issues: edges of image
                  s[ind] = raster_subgrid
              except IndexError:
                  s[ind] = None
  
          return s
code_tokens: def _grid_raster_extract ( self , raster , _name ) : with rasopen ( raster , 'r' ) as rsrc : rass_arr = rsrc . read ( ) rass_arr = rass_arr . reshape ( rass_arr . shape [ 1 ] , rass_arr . shape [ 2 ] ) affine = rsrc . transform s = Series ( index = range ( 0 , self . extracted_points . shape [ 0 ] ) , name = _name , dtype = object ) for ind , row in self . extracted_points . iterrows ( ) : x , y = self . _geo_point_to_projected_coords ( row [ 'X' ] , row [ 'Y' ] ) c , r = ~ affine * ( x , y ) try : ofs = self . kernel_size // 2 rr = int ( r ) ; cc = int ( c ) raster_subgrid = rass_arr [ rr - ofs : rr + ofs + 1 , cc - ofs : cc + ofs + 1 ] s [ ind ] = raster_subgrid except IndexError : s [ ind ] = None return s
short_docstring: Open the raster.
short_docstring_tokens: Open the raster .
comment: """
          Open the raster. Store the points in a Series - a labeled
          numpy array. Then in _purge array, we iterate over the masks
          and the paths_map and drop pixels where masks = 1 and pixels where bound = 0.
          """$SEP$# possible issues: edges of image