sum_over_h

rubin_sim.maf.metrics.sum_over_h(metric_values, hvalues, dndh_func=<function power_law_dndh>, **kwargs)

Calculate the sum of the metric value multiplied by the number of objects at each H value. This is equivalent to calculating the number of objects meeting X requirement in the differential completeness or fraction of objects with lightcurves, etc.

Parameters:
metric_valuesnumpy.ndarray

The metric values at each H value.

hvaluesnumpy.ndarray

The H values corresponding to each metricValue (must be the same length).

dndh_funcfunction, optional

One of the dN/dH functions defined below. Default is a simple power law.

**kwargsdict, optional

Keyword arguments to pass to dndh_func

Returns:
sum_valsnumpy.ndarray

The cumulative metric values.