def render_aspect_ratio(aspect_ratio, use_default=False):
    '''
    Returns the aspect ratio if one is defined for the source, otherwise
    if defaults are accepted a default value of 1.0 is returned or else
    a ValueError is raised

    :param float aspect_ratio:
        Ratio of along strike-length to down-dip width of the rupture

    :param bool use_default:
        If true, when aspect_ratio is undefined will return default value of
        1.0, otherwise will raise an error.
    '''
    if aspect_ratio:
        assert aspect_ratio > 0.
        return aspect_ratio
    else:
        if use_default:
            return 1.0
        else:
            raise ValueError('Rupture aspect ratio not defined!')