def get_band_index(band_name):
    """Get the write-index value for a Sentinel-2 image band

    For bands 1 through 8, we return the band number. For 8A,
    we return 9. For bands above 8A, we add one to the band
    number.

    Args:
        band_name (str): the name of the band, e.g. "nir - 8A"

    Return:
        int
    """

    name, num = band_name.split(' - ')
    if num.lower() == '8a':
        return 9
    elif int(num) > 8:
        return int(num) + 1
    else:
        return int(num)