AngularSpreadMetric¶
- class rubin_sim.maf.metrics.AngularSpreadMetric(col=None, period=6.283185307179586, **kwargs)¶
Bases:
BaseMetric
Compute the angular spread statistic which measures uniformity of a distribution angles accounting for 2pi periodicity.
The strategy is to first map angles into unit vectors on the unit circle, and then compute the 2D centroid of those vectors. A uniform distribution of angles will lead to a distribution of unit vectors with mean that approaches the origin. In contrast, a delta function distribution of angles leads to a delta function distribution of unit vectors with a mean that lands on the unit circle.
The angular spread statistic is then defined as 1 - R, where R is the radial offset of the mean of the unit vectors derived from the input angles. R approaches 1 for a uniform distribution of angles and 0 for a delta function distribution of angles.
The optional parameter
period
may be used to specificy periodicity other than 2 pi.Methods Summary
run
(data_slice[, slice_point])Calculate metric values.
Methods Documentation
- run(data_slice, slice_point=None)¶
Calculate metric values.
- Parameters:
- data_slice
numpy.ndarray
, (N,) Values passed to metric by the slicer, which the metric will use to calculate metric values at each slice_point.
- slice_point
dict
or None Dictionary of slice_point metadata passed to each metric. E.g. the ra/dec of the healpix pixel or opsim fieldId.
- data_slice
- Returns: