def crop_2d_using_xy_boundaries(mask, boundaries):
    """
    :mask: any 2D dataset
    :boundaries: dict{xmin,xmax,ymin,ymax}
    :return: cropped mask
    """
    b = boundaries
    return mask[b['ymin']:b['ymax'], b['xmin']:b['xmax']]