def get_nchans(chanrange):
    """Determine the number of channels from a channel range

    Parameters:
        chanrange (str): Channel range
    """
    i, f = map(int, chanrange.split('~'))
    return abs(f-i) + 1