class rubin_sim.maf.metrics.NightgapsMetric(night_col='night', all_gaps=False, bins=array([0, 1, 2, 3, 4, 5, 6, 7, 8, 9]), units='nights', **kwargs)

Bases: BaseMetric

Histogram the number of nights between observations.

Measure the gaps between observations. By default, only gaps between neighboring visits are computed. If all_gaps is set to true, all gaps are computed (i.e., if there are observations at 10, 20, 30 and 40 the default will histogram [10,10,10] while all_gaps histograms [10,10,10,20,20,30])

night_colstr, optional

The column name for the night of each observation. Default ‘night’.

all_gapsbool, optional

Histogram the gaps between all observations (True) or just successive observations (False)? Default is False. If all gaps are used, this metric can become significantly slower.

binsnp.ndarray, optional

The bins to use for the histogram of time gaps (in days, or same units as timesCol). Default values are bins from 0 to 10 days, in 1 day intervals.


Returns a histogram of the deltaT between nights at each slice point; these histograms can be combined and plotted using the ‘SummaryHistogram plotter’.

Methods Summary

run(data_slice[, slice_point])

Calculate metric values.

Methods Documentation

run(data_slice, slice_point=None)

Calculate metric values.


Values passed to metric by the slicer, which the metric will use to calculate metric values at each slice_point.

slice_pointdict or None

Dictionary of slice_point metadata passed to each metric. E.g. the ra/dec of the healpix pixel or opsim fieldId.

metricValue: int float or object

The metric value at each slice_point.