def crop(arr, numcycles, precrop=0, postcrop=0):
    """Crop out some initial and final cycles in data that contains
    several cycles.

    Args:
        arr (numpy.ndarray): Sequence to operate on.
        numcycles (int): number of cycles in the total array. 
        precrop (int): number of cycles to remove from the beginning of the 
                       array
        postcrop (int): number of cycles to remove from the end of the array
    
    Returns:
        The cropped sequence, as an ndarray.
    """
    N = len(arr)
    cyclen = N/numcycles
    arr = arr[int(precrop * cyclen):]
    if postcrop * cyclen > 0:
        arr = arr[:int(-postcrop * cyclen)]
    return arr