Esempio n. 1
0
def main():
    from permafrost import draw_regions

    dm = SweDataManager(var_name="SWE")

    b, lons2d, lats2d = draw_regions.get_basemap_and_coords()

    x, y = b(dm.lons2d, dm.lats2d)

    fig = plt.figure()

    start_year = 1981
    end_year = 1997

    levels = [
        10,
    ] + list(range(20, 120, 20)) + [150, 200, 300, 500, 1000]
    cmap = mpl.cm.get_cmap(name="jet_r", lut=len(levels))
    norm = colors.BoundaryNorm(levels, cmap.N)

    gs = gridspec.GridSpec(1, 2)
    ax = fig.add_subplot(gs[0, 0])
    data = dm.get_mean(start_year, end_year, months=[3])
    img = b.contourf(x,
                     y,
                     data.copy(),
                     ax=ax,
                     cmap=cmap,
                     norm=norm,
                     levels=levels)
    divider = make_axes_locatable(ax)
    cax = divider.append_axes("right", "5%", pad="3%")
    cb = fig.colorbar(img, cax=cax)
    b.drawcoastlines(ax=ax)
    ax.set_title("SWE (not interp.), \n DJF period: {0} - {1}".format(
        start_year, end_year))

    ax = fig.add_subplot(gs[0, 1])
    data_projected = dm.interpolate_data_to(data,
                                            lons2d,
                                            lats2d,
                                            nneighbours=1)
    x, y = b(lons2d, lats2d)
    img = b.contourf(x, y, data_projected, ax=ax, levels=img.levels)

    # add pretty colorbar
    divider = make_axes_locatable(ax)
    cax = divider.append_axes("right", "5%", pad="3%")
    cb = fig.colorbar(img, cax=cax)

    b.drawcoastlines(ax=ax)
    ax.set_title("SWE ( interp.), \n DJF period: {0} - {1}".format(
        start_year, end_year))

    plt.savefig("swe_rb_djf.png")

    pass
Esempio n. 2
0
File: swe.py Progetto: guziy/RPN
def main():
    from permafrost import draw_regions

    dm = SweDataManager(var_name="SWE")

    b, lons2d, lats2d = draw_regions.get_basemap_and_coords()

    x, y = b(dm.lons2d, dm.lats2d)

    fig = plt.figure()

    start_year = 1981
    end_year = 1997

    levels = [10, ] + list(range(20, 120, 20)) + [150, 200, 300, 500, 1000]
    cmap = mpl.cm.get_cmap(name="jet_r", lut=len(levels))
    norm = colors.BoundaryNorm(levels, cmap.N)

    gs = gridspec.GridSpec(1, 2)
    ax = fig.add_subplot(gs[0, 0])
    data = dm.get_mean(start_year, end_year, months=[3])
    img = b.contourf(x, y, data.copy(), ax=ax, cmap=cmap, norm=norm, levels=levels)
    divider = make_axes_locatable(ax)
    cax = divider.append_axes("right", "5%", pad="3%")
    cb = fig.colorbar(img, cax=cax)
    b.drawcoastlines(ax=ax)
    ax.set_title("SWE (not interp.), \n DJF period: {0} - {1}".format(start_year, end_year))

    ax = fig.add_subplot(gs[0, 1])
    data_projected = dm.interpolate_data_to(data, lons2d, lats2d, nneighbours=1)
    x, y = b(lons2d, lats2d)
    img = b.contourf(x, y, data_projected, ax=ax, levels=img.levels)

    # add pretty colorbar
    divider = make_axes_locatable(ax)
    cax = divider.append_axes("right", "5%", pad="3%")
    cb = fig.colorbar(img, cax=cax)

    b.drawcoastlines(ax=ax)
    ax.set_title("SWE ( interp.), \n DJF period: {0} - {1}".format(start_year, end_year))

    plt.savefig("swe_rb_djf.png")

    pass
Esempio n. 3
0
def main():
    from permafrost import draw_regions

    dm = CRUDataManager()

    b, lons2d, lats2d = draw_regions.get_basemap_and_coords()

    x, y = b(dm.lons2d, dm.lats2d)

    fig = plt.figure()

    gs = gridspec.GridSpec(1, 2)
    ax = fig.add_subplot(gs[0, 0])
    data = dm.get_mean(1981, 2009, months=[6, 7, 8])
    img = b.contourf(x, y, data.copy(), ax=ax)
    divider = make_axes_locatable(ax)
    cax = divider.append_axes("right", "5%", pad="3%")
    cb = fig.colorbar(img, cax=cax)
    b.drawcoastlines(ax=ax)
    ax.set_title("CRU (not interp.), \n JJA period: {0} - {1}".format(
        1981, 2009))

    ax = fig.add_subplot(gs[0, 1])
    data_projected = dm.interpolate_data_to(data, lons2d, lats2d)
    x, y = b(lons2d, lats2d)
    img = b.contourf(x, y, data_projected, ax=ax, levels=img.levels)

    # add pretty colorbar
    divider = make_axes_locatable(ax)
    cax = divider.append_axes("right", "5%", pad="3%")
    cb = fig.colorbar(img, cax=cax)

    b.drawcoastlines(ax=ax)
    ax.set_title("CRU ( interp.), \n JJA period: {0} - {1}".format(1981, 2009))

    plt.show()
    plt.savefig("t_cru_jja.png")

    pass
Esempio n. 4
0
def main():
    from permafrost import draw_regions

    dm = CRUDataManager()

    b, lons2d, lats2d = draw_regions.get_basemap_and_coords()

    x, y = b(dm.lons2d, dm.lats2d)

    fig = plt.figure()

    gs = gridspec.GridSpec(1, 2)
    ax = fig.add_subplot(gs[0, 0])
    data = dm.get_mean(1981, 2009, months=[6, 7, 8])
    img = b.contourf(x, y, data.copy(), ax=ax)
    divider = make_axes_locatable(ax)
    cax = divider.append_axes("right", "5%", pad="3%")
    cb = fig.colorbar(img, cax=cax)
    b.drawcoastlines(ax=ax)
    ax.set_title("CRU (not interp.), \n JJA period: {0} - {1}".format(1981, 2009))

    ax = fig.add_subplot(gs[0, 1])
    data_projected = dm.interpolate_data_to(data, lons2d, lats2d)
    x, y = b(lons2d, lats2d)
    img = b.contourf(x, y, data_projected, ax=ax, levels=img.levels)

    # add pretty colorbar
    divider = make_axes_locatable(ax)
    cax = divider.append_axes("right", "5%", pad="3%")
    cb = fig.colorbar(img, cax=cax)

    b.drawcoastlines(ax=ax)
    ax.set_title("CRU ( interp.), \n JJA period: {0} - {1}".format(1981, 2009))

    plt.show()
    plt.savefig("t_cru_jja.png")

    pass
Esempio n. 5
0
def plot_mean(data_path="", file_prefix="pm"):
    """
    """
    var_name = "CLDP"
    means = []
    means_dict = {}
    for file in os.listdir(data_path):
        if not file.startswith(file_prefix): continue
        file_path = os.path.join(data_path, file)

        r = RPN(file_path)
        levels = r.get_all_time_records_for_name(varname=var_name)
        means_dict.update(levels)
        means.append(np.mean(list(levels.values()), axis=0))
    mean_level = np.array(means).mean(axis=0)
    b, lons2d, lats2d = draw_regions.get_basemap_and_coords(
        file_path="data/from_guillimin/vary_lake_level1/pm1985010100_00000000p",
        lon1=-68,
        lat1=52,
        lon2=16.65,
        lat2=0)

    std_level = np.std(np.array(means), axis=0)

    #plot mean
    plt.figure()
    _plot_depth(mean_level,
                lons2d,
                lats2d,
                basemap=b,
                clevels=range(0, 310, 10))
    plt.savefig("mean_lake_levels.png")

    #plot std
    plt.figure()
    _plot_depth(std_level,
                lons2d,
                lats2d,
                basemap=b,
                clevels=np.arange(0, 2.2, 0.2),
                lowest_value=1e-3)
    plt.savefig("std_lake_levels.png")

    #plot initial lake depth
    plt.figure()
    plot_initial_lake_depth(lons2d=lons2d, lats2d=lats2d, basemap=b)
    plt.savefig("initial_lake_depth.png")

    #plot lake fraction
    plt.figure()
    plot_lake_fraction(lons2d=lons2d, lats2d=lats2d, basemap=b)
    plt.savefig("lake_fraction.png")

    fig = plt.figure()
    assert isinstance(fig, Figure)
    gs = GridSpec(2, 2)

    seasons = [
        "(a) Winter (DJF)", "(b) Spring (MAM)", "(c) Summer (JJA)",
        "(d) Fall (SON)"
    ]
    months_list = [[12, 1, 2], [3, 4, 5], [6, 7, 8], [9, 10, 11]]

    i = 0
    for season, months in zip(seasons, months_list):
        ax = fig.add_subplot(gs[i // 2, i % 2])
        assert isinstance(ax, Axes)
        data = _get_seasonal_mean_anomaly(means_dict,
                                          mean_level,
                                          months=months)
        the_max = np.round(np.max(np.abs(data)) * 10) / 10.0

        data = np.ma.masked_where(mean_level < 0.1, data)

        _plot_depth(data,
                    lons2d,
                    lats2d,
                    ax=ax,
                    basemap=b,
                    clevels=np.arange(-0.5, 0.6, 0.1),
                    lowest_value=0.001)
        ax.set_title(season)
        i += 1
    fig.tight_layout()
    fig.savefig("seasonal_anomalies.png")
Esempio n. 6
0
def main():
    path = "/home/huziy/skynet3_exec1/from_guillimin/cell_area.rpn"
    r = RPN(path)
    tile = r.get_first_record_for_name("TILE")
    lkid = r.get_first_record_for_name("LKID")
    larea = r.get_first_record_for_name("AREA")
    r.close()



    #path = "/home/huziy/skynet3_exec1/from_guillimin/infocell.rpn"
    path = "infocell_260x260.rpn"
    rObj = RPN(path)
    dirs = rObj.get_first_record_for_name("FLDR")
    facc = rObj.get_first_record_for_name("FACC")
    lkfr = rObj.get_first_record_for_name("LKFR")
    lkou = rObj.get_first_record_for_name("LKOU")
    lons2d, lats2d = rObj.get_longitudes_and_latitudes()
    rObj.close()


    di_list = np.array([1,1,0,-1,-1,-1,0,1])
    dj_list = np.array([0,-1,-1,-1,0,1,1,1])

    delta_indices = np.log2(dirs[dirs > 0])
    delta_indices = delta_indices.astype(int)

    di = di_list[delta_indices].astype(float)
    dj = dj_list[delta_indices].astype(float)

    du = di / np.sqrt(di ** 2 + dj ** 2)
    dv = dj / np.sqrt(di ** 2 + dj ** 2)


    for i in range(100):
        print(du[i], dv[i], np.log2(dirs[dirs > 0][i]))

    du2d = np.ma.masked_all(dirs.shape)
    dv2d = np.ma.masked_all(dirs.shape)

    du2d[dirs>0] = du
    dv2d[dirs>0] = dv

    print(du2d[161,145],dv2d[161,145],dirs[161,145])

    iv = range(dirs.shape[0])
    jv = range(dirs.shape[1])

    jv, iv = meshgrid(jv, iv)


    iv = iv.astype(float)
    jv = jv.astype(float)

    iv -= 0.5
    jv -= 0.5

    print(iv.min(), iv.max())

    plt.figure()
    #field = np.ma.masked_where((field > 1e10) | (field < 1e7) , field)
    #tile1 = np.ma.masked_where((tile != 25) & (tile != 26), tile)
    plt.pcolormesh(iv,jv,tile,cmap = cm.get_cmap("jet", 36))
    plt.colorbar()
    plt.xlim(75, 100)
    plt.ylim(130,142)


    
    plt.figure()
    lkid = lkid.astype(int)
    print(lkid[161,146], lkid[161,145],lkid[160,145:148])

    
    for i in range(1,121):
        x = np.ma.masked_where(lkid != i, lkid)
        if x.count() == 1 or x.count() == 0:
            print(i, x.count())
    #lkid = np.ma.masked_where(~((lkid == 27)|(lkid == 28)) , lkid)

    lkid = np.ma.masked_where(lkid <= 0, lkid)
    b, lons2d, lats2d = draw_regions.get_basemap_and_coords(
        file_path=path,
        lon1=-68, lat1=52, lon2=16.65, lat2=0
    )
    x,y = b(lons2d, lats2d)
    img = b.pcolormesh(x,y,lkid,cmap = cm.get_cmap("jet", 100))
    plt.colorbar(img, ticks = MultipleLocator(base = 10))
    b.contour(x, y,tile, levels = range(48), colors = "k", linewidth = 0.5)
    b.drawcoastlines(linewidth=0.5)

    #plt.quiver(iv+0.5, jv+0.5, du2d, dv2d, scale = 30, width = 0.005, color="k", pivot="middle")
    #plt.xlim(30, 70)
    #plt.ylim(10,35)

    plt.figure()
    plt.pcolormesh(iv,jv,lkfr,cmap = cm.get_cmap("jet", 11))
    plt.colorbar()
    plt.xlim(155, 165)
    plt.ylim(140,150)


    

    plt.figure()
    d = np.ma.masked_all(dirs.shape)
    d[dirs > 0] = np.log2(dirs[dirs > 0]) 
    plt.pcolormesh(iv, jv, d,cmap = cm.get_cmap("jet", 8))
    plt.xlim(155, 165)
    plt.ylim(140,150)
    plt.colorbar(ticks = MultipleLocator(base = 1))
    plt.quiver(iv+0.5, jv+0.5, du2d, dv2d, scale = 4.5, width = 0.035, color="k", pivot="middle", units="inches")


    plt.figure()
    plt.title("Lake area")
    plt.pcolormesh(iv, jv, np.ma.masked_where( larea < 1.0e8, np.log(larea) ),cmap = cm.get_cmap("jet", 8))
    #plt.xlim(155, 165)
    #plt.ylim(140,150)
    print(larea.min(), larea.max())
    plt.colorbar(ticks = LinearLocator(numticks = 10))
    #plt.quiver(iv+0.5, jv+0.5, du2d, dv2d, scale = 4.5, width = 0.035, color="k", pivot="middle", units="inches")



    plt.show()

    pass
Esempio n. 7
0
def main():
    path = "/home/huziy/skynet3_exec1/from_guillimin/cell_area.rpn"
    r = RPN(path)
    tile = r.get_first_record_for_name("TILE")
    lkid = r.get_first_record_for_name("LKID")
    larea = r.get_first_record_for_name("AREA")
    r.close()

    #path = "/home/huziy/skynet3_exec1/from_guillimin/infocell.rpn"
    path = "infocell_260x260.rpn"
    rObj = RPN(path)
    dirs = rObj.get_first_record_for_name("FLDR")
    facc = rObj.get_first_record_for_name("FACC")
    lkfr = rObj.get_first_record_for_name("LKFR")
    lkou = rObj.get_first_record_for_name("LKOU")
    lons2d, lats2d = rObj.get_longitudes_and_latitudes()
    rObj.close()

    di_list = np.array([1, 1, 0, -1, -1, -1, 0, 1])
    dj_list = np.array([0, -1, -1, -1, 0, 1, 1, 1])

    delta_indices = np.log2(dirs[dirs > 0])
    delta_indices = delta_indices.astype(int)

    di = di_list[delta_indices].astype(float)
    dj = dj_list[delta_indices].astype(float)

    du = di / np.sqrt(di**2 + dj**2)
    dv = dj / np.sqrt(di**2 + dj**2)

    for i in range(100):
        print(du[i], dv[i], np.log2(dirs[dirs > 0][i]))

    du2d = np.ma.masked_all(dirs.shape)
    dv2d = np.ma.masked_all(dirs.shape)

    du2d[dirs > 0] = du
    dv2d[dirs > 0] = dv

    print(du2d[161, 145], dv2d[161, 145], dirs[161, 145])

    iv = range(dirs.shape[0])
    jv = range(dirs.shape[1])

    jv, iv = meshgrid(jv, iv)

    iv = iv.astype(float)
    jv = jv.astype(float)

    iv -= 0.5
    jv -= 0.5

    print(iv.min(), iv.max())

    plt.figure()
    #field = np.ma.masked_where((field > 1e10) | (field < 1e7) , field)
    #tile1 = np.ma.masked_where((tile != 25) & (tile != 26), tile)
    plt.pcolormesh(iv, jv, tile, cmap=cm.get_cmap("jet", 36))
    plt.colorbar()
    plt.xlim(75, 100)
    plt.ylim(130, 142)

    plt.figure()
    lkid = lkid.astype(int)
    print(lkid[161, 146], lkid[161, 145], lkid[160, 145:148])

    for i in range(1, 121):
        x = np.ma.masked_where(lkid != i, lkid)
        if x.count() == 1 or x.count() == 0:
            print(i, x.count())
    #lkid = np.ma.masked_where(~((lkid == 27)|(lkid == 28)) , lkid)

    lkid = np.ma.masked_where(lkid <= 0, lkid)
    b, lons2d, lats2d = draw_regions.get_basemap_and_coords(file_path=path,
                                                            lon1=-68,
                                                            lat1=52,
                                                            lon2=16.65,
                                                            lat2=0)
    x, y = b(lons2d, lats2d)
    img = b.pcolormesh(x, y, lkid, cmap=cm.get_cmap("jet", 100))
    plt.colorbar(img, ticks=MultipleLocator(base=10))
    b.contour(x, y, tile, levels=range(48), colors="k", linewidth=0.5)
    b.drawcoastlines(linewidth=0.5)

    #plt.quiver(iv+0.5, jv+0.5, du2d, dv2d, scale = 30, width = 0.005, color="k", pivot="middle")
    #plt.xlim(30, 70)
    #plt.ylim(10,35)

    plt.figure()
    plt.pcolormesh(iv, jv, lkfr, cmap=cm.get_cmap("jet", 11))
    plt.colorbar()
    plt.xlim(155, 165)
    plt.ylim(140, 150)

    plt.figure()
    d = np.ma.masked_all(dirs.shape)
    d[dirs > 0] = np.log2(dirs[dirs > 0])
    plt.pcolormesh(iv, jv, d, cmap=cm.get_cmap("jet", 8))
    plt.xlim(155, 165)
    plt.ylim(140, 150)
    plt.colorbar(ticks=MultipleLocator(base=1))
    plt.quiver(iv + 0.5,
               jv + 0.5,
               du2d,
               dv2d,
               scale=4.5,
               width=0.035,
               color="k",
               pivot="middle",
               units="inches")

    plt.figure()
    plt.title("Lake area")
    plt.pcolormesh(iv,
                   jv,
                   np.ma.masked_where(larea < 1.0e8, np.log(larea)),
                   cmap=cm.get_cmap("jet", 8))
    #plt.xlim(155, 165)
    #plt.ylim(140,150)
    print(larea.min(), larea.max())
    plt.colorbar(ticks=LinearLocator(numticks=10))
    #plt.quiver(iv+0.5, jv+0.5, du2d, dv2d, scale = 4.5, width = 0.035, color="k", pivot="middle", units="inches")

    plt.show()

    pass
Esempio n. 8
0
def main():
    stations = cehq_station.read_station_data(folder="data/cehq_levels")

    lons_s = []
    lats_s = []
    values = []
    for s in stations:
        lon, lat = s.longitude, s.latitude
        lons_s.append(lon)
        lats_s.append(lat)
        values.append(s.get_mean_value())

    lons_s = np.array(lons_s)
    lats_s = np.array(lats_s)

    b, lons2d, lats2d = draw_regions.get_basemap_and_coords(
        file_path="data/from_guillimin/vary_lake_level1/pm1985010100_00000000p",
        lon1=-68, lat1=52, lon2=16.65, lat2=0, resolution="h"
    )

    x, y = b(lons_s, lats_s)


    fig = plt.figure()
    ax = plt.gca()
    b.warpimage()
    b.scatter(x, y, c = "r", zorder = 2)
    b.drawcoastlines(linewidth = 0.2)
    #draw inset axes
    axins = zoomed_inset_axes(plt.gca(), 2, loc=1)
    b.scatter(x, y, c = "r", zorder = 2, ax = axins)
    b.warpimage(ax = axins)

    ins_ll_lon = -76
    ins_ll_lat = 45

    ins_ur_lon = -68
    ins_ur_lat = 48

    x_ll, y_ll = b(ins_ll_lon, ins_ll_lat)
    x_ur, y_ur = b(ins_ur_lon, ins_ur_lat)
    axins.set_xlim(x_ll, x_ur)
    axins.set_ylim(y_ll, y_ur)
    mark_inset(ax, axins, loc1=2, loc2=4, fc="none", ec="0.5")
    fig.savefig("cehq_level_stations.png")

    fig = plt.figure()
    ax = plt.gca()
    b.warpimage()
    b.scatter(x, y, c = values, zorder = 2)
    plt.colorbar()
    b.drawcoastlines(linewidth = 0.2)

    #draw inset axes
    axins = zoomed_inset_axes(plt.gca(), 4, loc=1)
    b.scatter(x, y, c = values, zorder = 2, ax = axins)
    b.warpimage(ax = axins)
    b.drawcoastlines(linewidth = 0.2, ax = axins)

    ins_ll_lon = -73
    ins_ll_lat = 45

    ins_ur_lon = -70
    ins_ur_lat = 47

    x_ll, y_ll = b(ins_ll_lon, ins_ll_lat)
    x_ur, y_ur = b(ins_ur_lon, ins_ur_lat)
    axins.set_xlim(x_ll, x_ur)
    axins.set_ylim(y_ll, y_ur)
    mark_inset(ax, axins, loc1=2, loc2=4, fc="none", ec="0.5")

    fig.savefig("cehq_levels.png")
def main():
    stations = cehq_station.read_station_data(folder="data/cehq_levels")

    lons_s = []
    lats_s = []
    values = []
    for s in stations:
        lon, lat = s.longitude, s.latitude
        lons_s.append(lon)
        lats_s.append(lat)
        values.append(s.get_mean_value())

    lons_s = np.array(lons_s)
    lats_s = np.array(lats_s)

    b, lons2d, lats2d = draw_regions.get_basemap_and_coords(
        file_path="data/from_guillimin/vary_lake_level1/pm1985010100_00000000p",
        lon1=-68,
        lat1=52,
        lon2=16.65,
        lat2=0,
        resolution="h")

    x, y = b(lons_s, lats_s)

    fig = plt.figure()
    ax = plt.gca()
    b.warpimage()
    b.scatter(x, y, c="r", zorder=2)
    b.drawcoastlines(linewidth=0.2)
    #draw inset axes
    axins = zoomed_inset_axes(plt.gca(), 2, loc=1)
    b.scatter(x, y, c="r", zorder=2, ax=axins)
    b.warpimage(ax=axins)

    ins_ll_lon = -76
    ins_ll_lat = 45

    ins_ur_lon = -68
    ins_ur_lat = 48

    x_ll, y_ll = b(ins_ll_lon, ins_ll_lat)
    x_ur, y_ur = b(ins_ur_lon, ins_ur_lat)
    axins.set_xlim(x_ll, x_ur)
    axins.set_ylim(y_ll, y_ur)
    mark_inset(ax, axins, loc1=2, loc2=4, fc="none", ec="0.5")
    fig.savefig("cehq_level_stations.png")

    fig = plt.figure()
    ax = plt.gca()
    b.warpimage()
    b.scatter(x, y, c=values, zorder=2)
    plt.colorbar()
    b.drawcoastlines(linewidth=0.2)

    #draw inset axes
    axins = zoomed_inset_axes(plt.gca(), 4, loc=1)
    b.scatter(x, y, c=values, zorder=2, ax=axins)
    b.warpimage(ax=axins)
    b.drawcoastlines(linewidth=0.2, ax=axins)

    ins_ll_lon = -73
    ins_ll_lat = 45

    ins_ur_lon = -70
    ins_ur_lat = 47

    x_ll, y_ll = b(ins_ll_lon, ins_ll_lat)
    x_ur, y_ur = b(ins_ur_lon, ins_ur_lat)
    axins.set_xlim(x_ll, x_ur)
    axins.set_ylim(y_ll, y_ur)
    mark_inset(ax, axins, loc1=2, loc2=4, fc="none", ec="0.5")

    fig.savefig("cehq_levels.png")
Esempio n. 10
0
def plot_mean(data_path = "", file_prefix = "pm"):
    """
    """
    var_name = "CLDP"
    means = []
    means_dict = {}
    for file in os.listdir(data_path):
        if not file.startswith(file_prefix): continue
        file_path = os.path.join(data_path, file)

        r = RPN(file_path)
        levels = r.get_all_time_records_for_name(varname=var_name)
        means_dict.update(levels)
        means.append(np.mean( list(levels.values()) , axis = 0))
    mean_level = np.array(means).mean(axis = 0)
    b, lons2d, lats2d = draw_regions.get_basemap_and_coords(
        file_path="data/from_guillimin/vary_lake_level1/pm1985010100_00000000p",
        lon1=-68, lat1=52, lon2=16.65, lat2=0
    )

    std_level = np.std( np.array(means), axis=0)


    #plot mean
    plt.figure()
    _plot_depth(mean_level, lons2d, lats2d, basemap=b, clevels=range(0,310, 10))
    plt.savefig("mean_lake_levels.png")


    #plot std
    plt.figure()
    _plot_depth(std_level, lons2d, lats2d, basemap=b, clevels=np.arange(0,2.2, 0.2), lowest_value=1e-3)
    plt.savefig("std_lake_levels.png")



    #plot initial lake depth
    plt.figure()
    plot_initial_lake_depth(lons2d=lons2d, lats2d=lats2d, basemap=b)
    plt.savefig("initial_lake_depth.png")

    #plot lake fraction
    plt.figure()
    plot_lake_fraction(lons2d=lons2d, lats2d=lats2d, basemap=b)
    plt.savefig("lake_fraction.png")

    fig = plt.figure()
    assert isinstance(fig, Figure)
    gs = GridSpec(2,2)

    seasons = ["(a) Winter (DJF)", "(b) Spring (MAM)", "(c) Summer (JJA)", "(d) Fall (SON)"]
    months_list = [[12,1,2], [3,4,5], [6,7,8], [9,10,11]]

    i = 0
    for season, months in zip(seasons, months_list):
        ax = fig.add_subplot(gs[i // 2, i % 2])
        assert isinstance(ax, Axes)
        data = _get_seasonal_mean_anomaly(means_dict, mean_level, months=months)
        the_max = np.round(np.max(np.abs(data)) * 10 ) / 10.0

        data = np.ma.masked_where(mean_level < 0.1, data)

        _plot_depth(data, lons2d, lats2d, ax = ax, basemap=b,
            clevels=np.arange(-0.5, 0.6, 0.1),
            lowest_value=0.001
        )
        ax.set_title(season)
        i += 1
    fig.tight_layout()
    fig.savefig("seasonal_anomalies.png")