def report(*arrays, **kwargs):
    """
    Outputs a standalone HTML 'report card' for a
    measurement (or several grouped measurements),
    including relevant statistical information.
    """
    name = kwargs.pop("name",None)

    grouped = len(arrays) > 1
    if grouped:
        arr = N.concatenate(arrays)
        components = [PCAOrientation(a)
            for a in arrays]
    else:
        arr = arrays[0]
        components = []

    #r = LinearOrientation(arr)
    pca = PCAOrientation(arr)

    distances = list(distance_from_group(components,pca))

    kwargs = dict(
            levels=[1,2,3],
            alpha=[0.8,0.5,0.2],
            linewidth=2)

    #ellipse=error_ellipse(pca)

    kwargs = dict(n=500,levels=[1,2], ellipse=True)
    stereonet_data = dict(
        main=pca.error_coords(**kwargs),
        components=[i.error_coords(**kwargs)
            for i in components])

    t = env.get_template("report.html")

    return t.render(
        name=name,
        pca=pca,
        stereonet_data=stereonet_data,
        angular_errors=tuple(N.degrees(i)
            for i in pca.angular_errors()[::-1]),
        aligned=plot_aligned(pca),
        distances=distances)