def in_box(x, y, box_lims):
    """check if an x, y position falls within a set of limits
    
    Args:
        x: first index
        y: second index
        box_lims: [[x low,x high], [y low,y high]]
    Returns: True if (x,y) is in box_lims, otherwise False 
    
    """
    if x > box_lims[0, 0] and y > box_lims[1, 0]:
        if x < box_lims[0, 1] and y < box_lims[1, 1]:
            return True
    return False