def determine_when_sne_are_ripe_for_discovery(log, redshiftArray,
    limitingMags, observedFrameLightCurveInfo, discoverableList, plot=True):
    """
    *Given the observe frame lightcurve, determine if the SNe are discoverable by the survey or not.*

    **Key Arguments:**
        - ``log`` -- logger
        - ``redshiftArray`` -- the array of random redshifts
        - ``observedFrameLightCurveInfo`` -- the observed franme lightcurve info (dictionary)
        - ``discoverableList`` -- a list of dictionaries describing if the object is discoverable in each filter and finally if it is discoverable in any filter.
        - ``plot`` -- generate plots?

    **Return:**
        - ``ripeDayList`` -- a list of dictionaries describing the time relative to peak that the SN reaches the limiting mag of the survey
    """
    import math
    filters = ['g', 'r', 'i', 'z']
    models = ['he80', 'he100', 'he130']
    ripeDayList = []
    for item in range(len(redshiftArray)):
        ripeDayDict = {}
        if not discoverableList[item]['any']:
            ripeDayDict['any'] = False
            for ffilter in filters:
                ripeDayDict[ffilter] = False
        else:
            for ffilter in filters:
                if not discoverableList[item][ffilter]:
                    ripeDayDict[ffilter] = False
                elif observedFrameLightCurveInfo[item]['lightCurves'][ffilter
                    ] is None:
                    ripeDayDict[ffilter] = False
                else:
                    explosionDay = observedFrameLightCurveInfo[item][
                        'explosionDay']
                    lowerLimit = explosionDay
                    upperLimit = 0.0
                    ripeDay = lowerLimit
                    magGuess = observedFrameLightCurveInfo[item]['lightCurves'
                        ][ffilter](ripeDay)
                    magDiff = limitingMags[ffilter] - magGuess
                    if magGuess > limitingMags[ffilter]:
                        while math.fabs(magDiff) > 0.01:
                            if magGuess > limitingMags[ffilter]:
                                lowerLimit = ripeDay
                                ripeDay = lowerLimit + (upperLimit - lowerLimit
                                    ) / 2.0
                                magGuess = observedFrameLightCurveInfo[item][
                                    'lightCurves'][ffilter](ripeDay)
                            elif magGuess < limitingMags[ffilter]:
                                upperLimit = ripeDay
                                ripeDay = lowerLimit + (upperLimit - lowerLimit
                                    ) / 2.0
                                magGuess = observedFrameLightCurveInfo[item][
                                    'lightCurves'][ffilter](ripeDay)
                            magDiff = limitingMags[ffilter] - magGuess
                    ripeDay = float('%5.3f' % (ripeDay,))
                    ripeDayDict[ffilter] = ripeDay
            ripeDayDict['any'] = False
            for ffilter in filters:
                if ripeDayDict[ffilter]:
                    ripeDayDict['any'] = True
        ripeDayList.append(ripeDayDict)
    return ripeDayList
