Coverage for python/lsst/sims/maf/metrics/longGapAGNMetric.py : 30%

Hot-keys on this page
r m x p toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
"""max delta-t and average of the top-10 longest gaps. """
mjdcol='observationStartMJD', units='days', xgaps=10, badval=-666, **kwargs): """ Instantiate metric. mjdcol = column name for exposure time dates """ cols = [mjdcol] super(LongGapAGNMetric, self).__init__(cols, metricName, units=units, **kwargs) self.badval = badval self.mjdcol = mjdcol self.xgaps = xgaps self.units = units
metricval = np.diff(dataslice[self.mjdcol]) return metricval
if metricval.size > 0: result = np.max(metricval) else: result = self.badval return result
if np.size(metricval)-self.xgaps > 0: return np.average(np.sort(metricval)[np.size(metricval)-self.xgaps:]) else: return self.badval |