def crop_2d(array, array_e, x_start=0, x_end=-1, y_start=0, y_end=-1):
    """
    Crop the data (:py:attr:`array`) with some given start and stop point.

    Args:
        array (:py:attr:`array_like`): The intensity map collected by the 2 dimensional detector.
        array_e (:py:attr:`array_like`): Uncertainty map collected by the 2-D detector.
        x_start (:py:attr:`int`): Start point in x-axis.
        x_end (:py:attr:`int`): End point in x-axis.
        y_start (:py:attr:`int`): Start point in y-axis.
        y_end (:py:attr:`int`): End point in y-axis.

    Returns:
        :py:attr:`array_like`: A cropped intensity map.
    """
    cropped_array = array[y_start:y_end, x_start:x_end]
    if array_e is not None:
        cropped_error = array_e[y_start:y_end, x_start:x_end]
        return cropped_array, cropped_error
    return cropped_array
