Simple helper to postprocess angular outputs from StatsCollectors in the
    way we want.

def postproc_mask (stats_result):
    """Simple helper to postprocess angular outputs from StatsCollectors in the
    way we want.

    """
    n, mean, scat = stats_result

    ok = np.isfinite (mean)
    n = n[ok]
    mean = mean[ok]
    scat = scat[ok]

    mean *= 180 / np.pi # rad => deg
    scat /= n # variance-of-samples => variance-of-mean
    scat **= 0.5 # variance => stddev
    scat *= 180 / np.pi # rad => deg
    return ok, mean, scat