def change_area_values(array, value, lon1, lat1, lon2, lat2):
    """
    Change the weather values in a given rectangular area.

    array is an xarray DataArray
    value is the new value
    lon1 and lat1 are the coordinates of the bottom left corner of the area
    lon2 and lat2 are the coordinates of the top right of the area
    """
    lc = array.coords['lon']
    la = array.coords['lat']
    array.loc[dict(lon_b=lc[(lc > lon1) & (lc < lon2)],
                   lat_b=la[(la > lat1) & (la < lat2)])] = value
    return array