def get_scale(beam, scale):

    """
    Maps a scale factor name to the underlying beam quantity
    """
    if(scale=='charge'):
        return beam.q

    elif(scale=='number'):
        return beam['n_particle']

    else:
        raise ValueError('Could not get scale factor for plot.')