TgapsPercentMetric

class rubin_sim.maf.metrics.TgapsPercentMetric(times_col='observationStartMJD', all_gaps=False, min_time=0.08333333333333333, max_time=0.5833333333333334, units='percent', **kwargs)

Bases: BaseMetric

Compute the fraction of the time gaps between observations that occur in a given time range.

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 Compute the percent of gaps between specified endpoints.

This is different from the TgapsMetric in that this only looks at what percent of intervals fall into the specified range, rather than histogramming the entire set of tgaps.

Parameters:
times_colstr, opt

The column name for the exposure times. Values assumed to be in days. Default observationStartMJD.

all_gapsbool, opt

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.

min_timefloat, opt

Minimum time of gaps to include (days). Default 2/24 (2 hours).

max_timefloat, opt

Max time of gaps to include (days). Default 14/24 (14 hours).

Returns:
percentfloat

Returns a float percent of the CDF between cdfMinTime and cdfMaxTime - (# of tgaps within min_time/max_time / # of all tgaps).

Methods Summary

run(data_slice[, slice_point])

Calculate metric values.

Methods Documentation

run(data_slice, slice_point=None)

Calculate metric values.

Parameters:
data_slicenumpy.ndarray, (N,)

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.

Returns:
metricValue: int float or object

The metric value at each slice_point.