def getChargeIndex(chargeFlags):
    """
    Called from writeToCsv(), this function returns a list of the charges that have been selected by the user in the
    form [1,3,5] etc.

    :param chargeFlags: a list of bools, where bool at index i denotes if the user has selected to consider charge
    state i+1. That is, [True, False, False, False, True] means the user has chosen to consider +1 and +5 charge.
    :return chargeHeaers: a list of which charges are being considered. Eg: [1, 5]
    """
    chargeHeaders = [i for i, e in enumerate(chargeFlags) if e]
    return chargeHeaders