def trim_lcs(lcs : dict, cut_requirement : int = 0) -> dict :
    """
    Remove epochs from a lightcurve that occur before object discovery, which
    is defined as the first mjd with SNR >= 3.0.

    Args:
        lcs (dict): dictionary from a lightcurve file
        cut_requirement (int, default=0): cut number to require

    Returns:
        copy of lcs with pre-discovery epochs removed from each lightcurve
    """
    out_lcs = {}
    for snid, info in lcs.items():
        
        # Skip if the lightcurve will get cut during feature extraction
        if not (info['cut'] == -1 or info['cut'] > cut_requirement):
            continue

        # Get discovery MJD, skip if light curve is never discovered
        flux = info['lightcurve']['FLUXCAL'].values.astype(float)
        fluxerr = info['lightcurve']['FLUXCALERR'].values.astype(float)
        detection_mask = ((flux / fluxerr) >= 3.0)
        if sum(detection_mask) == 0:
            continue

        mjds = info['lightcurve']['MJD'].values.astype(float)
        mjd0 = mjds[detection_mask].min()

        # Trim lightcurve
        lc = info['lightcurve'][mjds >= mjd0].copy().reset_index(drop=True)

        # Store results
        out_lcs[snid] = {'lightcurve': lc, 'cut': info['cut']}

    return out_lcs