text: import os
  import wdmerger
  import numpy as np
  import matplotlib.pyplot as plt
  
  
  
  #
  # Get the data column from a wdmerger diagnostic output file whose header name is col_name.
  #
  
  def get_column(col_name, diag_filename):
  
      # Open up the file for reading. Get the names of the columns, as well as a 2D list
      # with all the data.
  
      diag_file = open(diag_filename,'r')
  
      vc_line = 'git'
  
      # Skip the first few lines, they store the version control information
  
      line = diag_file.readline()
  
      while (line.split()[2] == vc_line):
          line = diag_file.readline()
  
      # The very next line will be the column headers
  
      col_names = line.split('  ')
  
      # Now read in the data
  
      diag_list = diag_file.readlines()
      data = []
      for line in diag_list:
          data.append( list(map(float, line[0:-1].split())) )
  
      diag_file.close()
  
      # Convert the data list into a 2D numpy array.
  
      data = np.array(data)
  
      # Let's do some cleanup.
  
      col_names.pop(0)                                        # Get rid of the # at the beginning
      col_names = [string.strip() for string in col_names]    # Remove any leading or trailing whitespace
      col_names = list(filter(None, col_names))               # Remove any remaining blank entries
  
      # Obtain the column index and then return the column with that index.
  
      col_index = col_names.index(col_name)
  
      return data[:,col_index]
  