girs.rast.raster.Raster.get_array

Raster.get_array(band_number=1, col0=0, row0=0, n_cols=None, n_rows=None, mask=False, scale=False)

Return the raster band array

If band number is a number, return a 2D-array, else if band number is a list/tuple of numbers, return a 3D-array If mask is True, returned a numpy masked array If scale is True, scale the raster: (array - min)/(max - min)

Parameters:
  • band_number – band number. Default band_number=1
  • col0 (int) – starting x pixel
  • row0 (int) – starting y pixel
  • n_cols (int) – number of x-pixels
  • n_rows (int) – number of y-pixels
Returns:

2D- or 3D-array

Return type:

numpy.ndarray