code: def mmi_to_ascii(self, force_flag=False):
          
          ascii_path = os.path.join(
              self.output_dir, '%s.asc' % self.output_basename)
          # Short circuit if the tif is already created.
          if os.path.exists(ascii_path) and force_flag is not True:
              return ascii_path
  
          cell_size = (self.x_maximum - self.x_minimum) / (self.rows - 1)
          asc_file = open(ascii_path, 'w')
          asc_file.write('ncols %d\n' % self.columns)
          asc_file.write('nrows %d\n' % self.rows)
          asc_file.write('xllcorner %.3f\n' % self.x_minimum)
          asc_file.write('yllcorner %.3f\n' % self.y_minimum)
          asc_file.write('cellsize %.3f\n' % cell_size)
          asc_file.write('nodata_value -9999\n')
  
          cell_string = ''
          cell_values = np.reshape(
              [v[2] for v in self.mmi_data], (self.rows, self.columns))
          for i in range(self.rows):
              for j in range(self.columns):
                  cell_string += '%.3f ' % cell_values[i][j]
              cell_string += '\n'
  
          asc_file.write(cell_string)
  
          asc_file.close()
  
          return ascii_path
docs: Convert grid.xml mmi column to a ascii raster file.