code: def mmi_to_raster(self, force_flag=False, algorithm=USE_ASCII):
          LOGGER.debug('mmi_to_raster requested.')
          if algorithm is None:
              algorithm = USE_ASCII
          if self.algorithm_name:
              tif_path = os.path.join(
                  self.output_dir, '%s-%s.tif' % (
                      self.output_basename, algorithm))
          else:
              tif_path = os.path.join(
                  self.output_dir, '%s.tif' % self.output_basename)
          if os.path.exists(tif_path) and force_flag is not True:
              return tif_path
          if algorithm == USE_ASCII:
              ascii_path = self.mmi_to_ascii(True)
              command = (
                  (
                      '%(gdal_translate)s -a_srs EPSG:4326 '
                      '"%(ascii)s" "%(tif)s"'
                  ) % {
                      'gdal_translate': which('gdal_translate')[0],
                      'ascii': ascii_path,
                      'tif': tif_path
                  }
              )
              LOGGER.info('Created this gdal command:\n%s' % command)
              self._run_command(command)
          else:
              vrt_path = self.mmi_to_vrt(force_flag)
              if INVDIST in algorithm:
                  algorithm = 'invdist:power=2.0:smoothing=1.0'
              command = (
                  (
                      '%(gdal_grid)s -a %(alg)s -zfield "mmi" -txe %(xMin)s '
                      '%(xMax)s -tye %(yMin)s %(yMax)s -outsize %(dimX)i '
                      '%(dimY)i -of GTiff -ot Float16 -a_srs EPSG:4326 -l mmi '
                      '"%(vrt)s" "%(tif)s"'
                  ) % {
                      'gdal_grid': which('gdal_grid')[0],
                      'alg': algorithm,
                      'xMin': self.x_minimum,
                      'xMax': self.x_maximum,
                      'yMin': self.y_minimum,
                      'yMax': self.y_maximum,
                      'dimX': self.columns,
                      'dimY': self.rows,
                      'vrt': vrt_path,
                      'tif': tif_path
                  }
              )
              LOGGER.info('Created this gdal command:\n%s' % command)
              self._run_command(command)
              if INVDIST in algorithm:
                  algorithm = 'invdist'
          self.create_keyword_file(algorithm)
          if self.algorithm_name:
              qml_path = os.path.join(
                  self.output_dir, '%s-%s.qml' % (
                      self.output_basename, algorithm))
          else:
              qml_path = os.path.join(
                  self.output_dir, '%s.qml' % self.output_basename)
          qml_source_path = resources_path('converter_data', 'mmi.qml')
          shutil.copyfile(qml_source_path, qml_path)
          return tif_path