

def regressionScale(comparisonFlux, targetFlux, time, ingress, egress, returncoeffs=False):
    '\n    Use a least-squares regression to stretch and offset a comparison\n    star fluxes to scale them to the relative intensity of the target\n    star. Only do this regression considering the out-of-transit\n    portions of the light curve.\n\n    Parameters\n    ----------\n    comparisonFlux : numpy.ndarray\n        Flux of a comparison star\n\n    targetFlux : numpy.ndarray\n        Flux of the target star\n\n    time : numpy.ndarray\n        List of times for each flux measurement in JD\n\n    ingress : float\n        Time of ingress (JD, assuming time list is in JD)\n\n    egress : float\n        Time of egress (JD, assuming time list is in JD)\n\n    Returns\n    -------\n    scaledVector : numpy.ndarray\n        Rescaled version of the comparisonFlux vector using the above\n        described process\n    '
    outOfTransit = ((time < ingress) + (time > egress))
    regressMatrix = np.vstack([comparisonFlux[outOfTransit]]).T
    assert (len(targetFlux[outOfTransit]) > 0), 'No fluxes marked as "out-of-transit" according to input ingress/egress'
    m = LA.lstsq(regressMatrix, targetFlux[outOfTransit])[0]
    scaledVector = (m * comparisonFlux)
    if returncoeffs:
        return (scaledVector, m)
    else:
        return scaledVector

dataset/ETHPy150Open OSCAAR/OSCAAR/oscaar/mathMethods.py regressionScale/original