read csv header, returns prop_indices dictionary, {'label' : index}
	where label is the csv column label, and index the column index

def read_header(header_labels, options, ensemble_list=None):
    """
	read csv header, returns prop_indices dictionary, {'label' : index}
	where label is the csv column label, and index the column index
	"""

    # set input variables
    filename = os.path.basename(options.inputpath)
    if ensemble_list:
        score_field = ensemble_list[0]
        ensemble_size = len(ensemble_list)
    else:
        score_field = options.score_field
        ensemble_size = options.ensemble_size


    status_field = options.status_field

    # check on score field values
    if ensemble_list:
        query_list = ensemble_list
        # verify that the input queries are in the inputfille
        if not [x for x in query_list if x in header_labels]:
            out = ' '.join(query_list)
            print("\n '{q}' are not in '{e}'\n".format(q=out, e=os.path.basename(filename)))
            sys.exit(1)
    else:
        score_field_matcher = re.compile(score_field)
        query_list = [x for x in header_labels if score_field_matcher.match(x)]

        if not query_list:
            print("\n There are no '{s}' columns in '{c}'\n".format(s=score_field, c=os.path.basename(filename)))
            sys.exit(1)

        # confirm that there are a sufficient no. of queries to generate
        # the requested ensemble size
        if len(query_list) < ensemble_size:
            print("\n '{s}' will support a maximum ensemble size of '{d}'\n".format(s=os.path.basename(filename),
                                                                              d=len(query_list)))
            sys.exit(1)

    # confirm that status field exists
    status_field_matcher = re.compile(status_field)
    if not any(x for x in header_labels if status_field_matcher.match(x)):
        print("\n The status_field column '{s}' doesn't exist\n".format(s=status_field))
        sys.exit(1)

    # initiate prop_column dictionary and csv column index
    prop_indices = {}
    index = 0

    for label in header_labels:
        prop_indices[label] = index
        index += 1

    return prop_indices