code: def LoadGDAL(filename, no_data=None):
      
    if not GDAL_AVAILABLE:
      raise Exception("richdem.LoadGDAL() requires GDAL.")
  
    allowed_types = {gdal.GDT_Byte,gdal.GDT_Int16,gdal.GDT_Int32,gdal.GDT_UInt16,gdal.GDT_UInt32,gdal.GDT_Float32,gdal.GDT_Float64}
  
    #Read in data
    src_ds  = gdal.Open(filename)
    srcband = src_ds.GetRasterBand(1)
  
    if no_data is None:
      no_data = srcband.GetNoDataValue()
      if no_data is None:
        raise Exception("The source data did not have a NoData value. Please use the no_data argument to specify one. If should not be equal to any of the actual data values. If you are using all possible data values, then the situation is pretty hopeless - sorry.")
  
    srcdata = rdarray(srcband.ReadAsArray(), no_data=no_data)
  
    # raster_srs = osr.SpatialReference()
    # raster_srs.ImportFromWkt(raster.GetProjectionRef())
  
    if not srcband.DataType in allowed_types:
      raise Exception("This datatype is not supported. Please file a bug report on RichDEM.")
  
    srcdata.projection   = src_ds.GetProjectionRef()
    srcdata.geotransform = src_ds.GetGeoTransform()
  
    srcdata.metadata = dict()
    for k,v in src_ds.GetMetadata().items():
      srcdata.metadata[k] = v
  
    _AddAnalysis(srcdata, "LoadGDAL(filename={0}, no_data={1})".format(filename, no_data))
  
    return srcdata
docs: Read a GDAL file.
  
       Opens any file GDAL can read, selects the first raster band, and loads it
       and its metadata into a RichDEM array of the appropriate data type.
  
       If you need to do something more complicated, look at the source of this
       function.
  
       Args:
           filename (str):    Name of the raster file to open
           no_data  (float):  Optionally, set the no_data value to this.
  
       Returns:
           A RichDEM array