hloopy/preprocess.py
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
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.
    
Crop out some initial and final cycles in data that contains
several cycles.
Crop out some initial and final cycles in data that contains several cycles .
def crop(arr, numcycles, precrop=0, postcrop=0):
    N = len(arr)
    cyclen = N/numcycles
    arr = arr[int(precrop * cyclen):]
    if postcrop * cyclen > 0:
        arr = arr[:int(-postcrop * cyclen)]
    return arr
def crop ( arr , numcycles , precrop = 0 , postcrop = 0 ) : N = len ( arr ) cyclen = N / numcycles arr = arr [ int ( precrop * cyclen ) : ] if postcrop * cyclen > 0 : arr = arr [ : int ( - postcrop * cyclen ) ] return arr
Crop out some initial and final cycles in data that contains
several cycles.
Crop out some initial and final cycles in data that contains several cycles .
"""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.
    """
The cropped sequence, as an ndarray.
The cropped sequence as an ndarray .
arr
Sequence to operate on.
Sequence to operate on .
numcycles
number of cycles in the total array.
number of cycles in the total array .
precrop
number of cycles to remove from the beginning of the
array
number of cycles to remove from the beginning of the array
postcrop
number of cycles to remove from the end of the array
number of cycles to remove from the end of the array