VisitGroupsMetric

class rubin_sim.maf.metrics.VisitGroupsMetric(time_col='observationStartMJD', nights_col='night', metric_name='VisitGroups', delta_t_min=0.010416666666666666, delta_t_max=0.0625, min_n_visits=2, window=30, min_n_nights=3, **kwargs)

Bases: BaseMetric

Count the number of visits per night within delta_t_min and delta_t_max.

Methods Summary

reduce_max_seq_lunations(metricval)

Count the max number of sequential lunations (unique 30 day windows) that contain at least one 'group': a set of more than minNVisits per night, with more than minNNights of visits within 'window' time period.

reduce_median(metricval)

Reduce to median number of visits per night.

reduce_n_lunations(metricval)

Reduce to number of lunations (unique 30 day windows) that contain at least one 'group': a set of more than minNVisits per night, with more than minNNights of visits within 'window' time period.

reduce_n_nights_in_window(metricval)

Reduce to max number of nights with more than minNVisits, within 'window' over all windows.

reduce_n_nights_with_n_visits(metricval)

Reduce to total number of nights with more than 'minNVisits' visits.

reduce_n_visits_in_window(metricval)

Reduce to max number of total visits on all nights with more than minNVisits, within any 'window' (default=30 nights).

run(data_slice[, slice_point])

Return a dictionary of: the number of visits within a night (within delta tmin/tmax of another visit), and the nights with visits > minNVisits.

Methods Documentation

reduce_max_seq_lunations(metricval)

Count the max number of sequential lunations (unique 30 day windows) that contain at least one ‘group’: a set of more than minNVisits per night, with more than minNNights of visits within ‘window’ time period.

reduce_median(metricval)

Reduce to median number of visits per night.

reduce_n_lunations(metricval)

Reduce to number of lunations (unique 30 day windows) that contain at least one ‘group’: a set of more than minNVisits per night, with more than minNNights of visits within ‘window’ time period.

reduce_n_nights_in_window(metricval)

Reduce to max number of nights with more than minNVisits, within ‘window’ over all windows.

reduce_n_nights_with_n_visits(metricval)

Reduce to total number of nights with more than ‘minNVisits’ visits.

reduce_n_visits_in_window(metricval)

Reduce to max number of total visits on all nights with more than minNVisits, within any ‘window’ (default=30 nights).

run(data_slice, slice_point=None)

Return a dictionary of: the number of visits within a night (within delta tmin/tmax of another visit), and the nights with visits > minNVisits. Count two visits which are within tmin of each other, but which have another visit within tmin/tmax interval, as one and a half (instead of two).

So for example: 4 visits, where 1, 2, 3 were all within deltaTMax of each other, and 4 was later but within deltaTmax of visit 3 – would give you 4 visits. If visit 1 and 2 were closer together than deltaTmin, the two would be counted as 1.5 visits together (if only 1 and 2 existed, then there would be 0 visits as none would be within the qualifying time interval).