From 1ba573f8325a8024253b400dae42d5fada7f7681 Mon Sep 17 00:00:00 2001 From: taddyb Date: Wed, 14 Feb 2024 09:29:38 -0500 Subject: [PATCH 1/4] removing basemap --- environment.yml | 1 - hydroDL/post/plot.py | 934 ++++++++++++++++++++----------------------- requirements.txt | 6 +- 3 files changed, 433 insertions(+), 508 deletions(-) diff --git a/environment.yml b/environment.yml index a27f6b9..7de5a1f 100644 --- a/environment.yml +++ b/environment.yml @@ -18,7 +18,6 @@ dependencies: - backports=1.0=py36_1 - backports.os=0.1.1=py36_0 - backports.shutil_get_terminal_size=1.0.0=py36_2 - - basemap=1.2.0=py36h705c2d8_0 - beautifulsoup4=4.7.1=py36_1 - bitarray=0.9.0=py36h7b6447c_0 - bkcharts=0.2=py36_0 diff --git a/hydroDL/post/plot.py b/hydroDL/post/plot.py index 3dce9d7..599de90 100644 --- a/hydroDL/post/plot.py +++ b/hydroDL/post/plot.py @@ -2,39 +2,34 @@ import scipy import matplotlib.pyplot as plt import statsmodels.api as sm - -# from matplotlib.collections import PatchCollection -# from matplotlib.patches import Rectangle +from matplotlib.collections import PatchCollection +from matplotlib.patches import Rectangle import matplotlib.gridspec as gridspec from hydroDL import utils import string +import cartopy.crs as ccrs +import cartopy.feature as cfeature +import matplotlib.pyplot as plt -import os - - -os.environ['PROJ_LIB'] = r'/opt/anaconda/pkgs/proj4-5.2.0-he6710b0_1/share/proj/' -from mpl_toolkits import basemap +# from mpl_toolkits import basemap -def plotBoxFig( - data, - label1=None, - label2=None, - colorLst="rbkgcmywrbkgcmyw", - title=None, - figsize=(10, 8), - sharey=True, - xticklabel=None, - axin=None, - ylim=None, - ylabel=None, - widths=0.5, -): +def plotBoxFig(data, + label1=None, + label2=None, + colorLst='rbkgcmywrbkgcmyw', + title=None, + figsize=(10, 8), + sharey=True, + xticklabel=None, + axin=None, + ylim=None, + ylabel=None, + widths=0.5, + ): nc = len(data) if axin is None: - fig, axes = plt.subplots( - ncols=nc, sharey=sharey, figsize=figsize, constrained_layout=True - ) + fig, axes = plt.subplots(ncols=nc, sharey=sharey, figsize=figsize, constrained_layout=True) else: axes = axin @@ -51,11 +46,9 @@ def plotBoxFig( temp[kk] = [] else: temp = temp[~np.isnan(temp)] - bp = ax.boxplot( - temp, patch_artist=True, notch=True, showfliers=False, widths=widths - ) - for kk in range(0, len(bp["boxes"])): - plt.setp(bp["boxes"][kk], facecolor=colorLst[kk]) + bp = ax.boxplot(temp, patch_artist=True, notch=True, showfliers=False, widths = widths) + for kk in range(0, len(bp['boxes'])): + plt.setp(bp['boxes'][kk], facecolor=colorLst[kk]) if label1 is not None: ax.set_xlabel(label1[k]) @@ -64,7 +57,7 @@ def plotBoxFig( if xticklabel is None: ax.set_xticks([]) else: - ax.set_xticks([y + 1 for y in range(0, len(data[k]), 2)]) + ax.set_xticks([y+1 for y in range(0,len(data[k]),2)]) ax.set_xticklabels(xticklabel) # ax.ticklabel_format(axis='y', style='sci') if ylabel is not None: @@ -79,16 +72,9 @@ def plotBoxFig( ax.set_ylim(ylim) if label2 is not None: if nc == 1: - ax.legend(bp["boxes"], label2, loc="lower center", frameon=False, ncol=2) + ax.legend(bp['boxes'], label2, loc='lower center', frameon=False, ncol=2) else: - axes[-1].legend( - bp["boxes"], - label2, - loc="lower center", - frameon=False, - ncol=2, - fontsize=12, - ) + axes[-1].legend(bp['boxes'], label2, loc='lower center', frameon=False, ncol=2, fontsize=12) if title is not None: # fig.suptitle(title) ax.set_title(title) @@ -98,43 +84,36 @@ def plotBoxFig( return ax, bp -def plotBoxF( - data, - label1=None, - label2=None, - colorLst="rbkgcmy", - title=None, - figsize=(10, 8), - sharey=True, - xticklabel=None, - ylabel=None, - subtitles=None, -): +def plotBoxF(data, + label1=None, + label2=None, + colorLst='rbkgcmy', + title=None, + figsize=(10, 8), + sharey=True, + xticklabel=None, + ylabel=None, + subtitles=None + ): nc = len(data) - fig, axes = plt.subplots( - nrows=3, ncols=2, sharey=sharey, figsize=figsize, constrained_layout=True - ) + fig, axes = plt.subplots(nrows=3, ncols=2, sharey=sharey, figsize=figsize, constrained_layout=True) axes = axes.flat for k in range(0, nc): ax = axes[k] if nc > 1 else axes # ax = axes[k] - bp = ax.boxplot(data[k], patch_artist=True, notch=True, showfliers=False) - for kk in range(0, len(bp["boxes"])): - plt.setp(bp["boxes"][kk], facecolor=colorLst[0]) + bp = ax.boxplot( + data[k], patch_artist=True, notch=True, showfliers=False) + for kk in range(0, len(bp['boxes'])): + plt.setp(bp['boxes'][kk], facecolor=colorLst[0]) if k == 2: yrange = ax.get_ylim() if k == 3: ax.set(ylim=yrange) - ax.axvline( - len(data[k]) - 3 + 0.5, - ymin=0, - ymax=1, - color="k", - linestyle="dashed", - linewidth=1, - ) - if ylabel[k] not in ["NSE", "Corr", "RMSE", "KGE"]: - ax.axhline(0, xmin=0, xmax=1, color="k", linestyle="dashed", linewidth=1) + ax.axvline(len(data[k])-3+0.5, ymin=0, ymax=1, color='k', + linestyle='dashed', linewidth=1) + if ylabel[k] not in ['NSE', 'Corr', 'RMSE', 'KGE']: + ax.axhline(0, xmin=0, xmax=1,color='k', + linestyle='dashed', linewidth=1) if label1 is not None: ax.set_xlabel(label1[k]) @@ -143,59 +122,47 @@ def plotBoxF( if xticklabel is None: ax.set_xticks([]) else: - ax.set_xticks([y + 1 for y in range(0, len(data[k]))]) + ax.set_xticks([y+1 for y in range(0,len(data[k]))]) ax.set_xticklabels(xticklabel) if subtitles is not None: - ax.set_title(subtitles[k], loc="left") + ax.set_title(subtitles[k], loc='left') # ax.ticklabel_format(axis='y', style='sci') if label2 is not None: if nc == 1: - ax.legend(bp["boxes"], label2, loc="best", frameon=False, ncol=2) + ax.legend(bp['boxes'], label2, loc='best', frameon=False, ncol=2) else: - axes[-1].legend( - bp["boxes"], label2, loc="best", frameon=False, ncol=2, fontsize=12 - ) + axes[-1].legend(bp['boxes'], label2, loc='best', frameon=False, ncol=2, fontsize=12) if title is not None: fig.suptitle(title) return fig - -def plotMultiBoxFig( - data, - *, - axes=None, - label1=None, - label2=None, - colorLst="grbkcmy", - title=None, - figsize=(10, 8), - sharey=True, - xticklabel=None, - position=None, - ylabel=None, - ylim=None, -): +def plotMultiBoxFig(data, + *, + axes=None, + label1=None, + label2=None, + colorLst='grbkcmy', + title=None, + figsize=(10, 8), + sharey=True, + xticklabel=None, + position=None, + ylabel=None, + ylim = None, + ): nc = len(data) if axes is None: - fig, axes = plt.subplots( - ncols=nc, sharey=sharey, figsize=figsize, constrained_layout=True - ) + fig, axes = plt.subplots(ncols=nc, sharey=sharey, figsize=figsize, constrained_layout=True) nv = len(data[0]) - ndays = len(data[0][1]) - 1 + ndays = len(data[0][1])-1 for k in range(0, nc): ax = axes[k] if nc > 1 else axes - bp = [None] * nv + bp = [None]*nv for ii in range(nv): bp[ii] = ax.boxplot( - data[k][ii], - patch_artist=True, - notch=True, - showfliers=False, - positions=position[ii], - widths=0.2, - ) - for kk in range(0, len(bp[ii]["boxes"])): - plt.setp(bp[ii]["boxes"][kk], facecolor=colorLst[ii]) + data[k][ii], patch_artist=True, notch=True, showfliers=False, positions=position[ii], widths=0.2) + for kk in range(0, len(bp[ii]['boxes'])): + plt.setp(bp[ii]['boxes'][kk], facecolor=colorLst[ii]) if label1 is not None: ax.set_xlabel(label1[k]) @@ -206,7 +173,7 @@ def plotMultiBoxFig( if xticklabel is None: ax.set_xticks([]) else: - ax.set_xticks([-0.7] + [y for y in range(0, len(data[k][1]) + 1)]) + ax.set_xticks([-0.7]+[y for y in range(0,len(data[k][1])+1)]) # ax.set_xticks([y for y in range(0, len(data[k][1]) + 1)]) # xtickloc = [0.25, 0.75] + np.arange(1.625, 5, 1.25).tolist() + [5.5, 5.5+0.25*6] # ax.set_xticks([y for y in xtickloc]) @@ -218,30 +185,27 @@ def plotMultiBoxFig( # vlabel = [0.5] + np.arange(1.0, 5, 1.25).tolist() + [4.75+0.25*6, 4.75+0.25*12] vlabel = np.arange(-0.5, len(data[k][1]) + 1) for xv in vlabel: - ax.axvline(xv, ymin=0, ymax=1, color="k", linestyle="dashed", linewidth=1) + ax.axvline(xv, ymin=0, ymax=1, color='k', + linestyle='dashed', linewidth=1) yh0 = np.nanmedian(data[k][0][0]) - ax.axhline(yh0, xmin=0, xmax=1, color="grey", linestyle="dashed", linewidth=2) + ax.axhline(yh0, xmin=0, xmax=1, color='grey', + linestyle='dashed', linewidth=2) yh = np.nanmedian(data[k][0][1]) - ax.axhline(yh, xmin=0, xmax=1, color="r", linestyle="dashed", linewidth=2) + ax.axhline(yh, xmin=0, xmax=1, color='r', + linestyle='dashed', linewidth=2) yh1 = np.nanmedian(data[k][1][0]) - ax.axhline(yh1, xmin=0, xmax=1, color="b", linestyle="dashed", linewidth=2) + ax.axhline(yh1, xmin=0, xmax=1, color='b', + linestyle='dashed', linewidth=2) if ylim is not None: ax.set_ylim(ylim) labelhandle = list() for ii in range(nv): - labelhandle.append(bp[ii]["boxes"][0]) + labelhandle.append(bp[ii]['boxes'][0]) if label2 is not None: if nc == 1: - ax.legend(labelhandle, label2, loc="lower center", frameon=False, ncol=2) + ax.legend(labelhandle, label2, loc='lower center', frameon=False, ncol=2) else: - axes[-1].legend( - labelhandle, - label2, - loc="lower center", - frameon=False, - ncol=1, - fontsize=12, - ) + axes[-1].legend(labelhandle, label2, loc='lower center', frameon=False, ncol=1, fontsize=12) if title is not None: # fig.suptitle(title) ax.set_title(title) @@ -251,21 +215,19 @@ def plotMultiBoxFig( return ax, labelhandle -def plotTS( - t, - y, - *, - ax=None, - tBar=None, - figsize=(12, 4), - cLst="rbkgcmy", - markerLst=None, - linespec=None, - legLst=None, - title=None, - linewidth=2, - ylabel=None, -): +def plotTS(t, + y, + *, + ax=None, + tBar=None, + figsize=(12, 4), + cLst='rbkgcmy', + markerLst=None, + linespec=None, + legLst=None, + title=None, + linewidth=2, + ylabel=None): newFig = False if ax is None: fig = plt.figure(figsize=figsize) @@ -282,24 +244,19 @@ def plotTS( legStr = legLst[k] if markerLst is None: if True in np.isnan(yy): - ax.plot(tt, yy, "*", color=cLst[k], label=legStr) + ax.plot(tt, yy, '*', color=cLst[k], label=legStr) else: - ax.plot(tt, yy, color=cLst[k], label=legStr, linewidth=linewidth) + ax.plot( + tt, yy, color=cLst[k], label=legStr, linewidth=linewidth) else: - if markerLst[k] is "-": + if markerLst[k] == '-': if linespec is not None: - ax.plot( - tt, - yy, - color=cLst[k], - label=legStr, - linestyle=linespec[k], - lw=1.5, - ) + ax.plot(tt, yy, color=cLst[k], label=legStr, linestyle=linespec[k], lw=1.5) else: ax.plot(tt, yy, color=cLst[k], label=legStr, lw=1.5) else: - ax.plot(tt, yy, color=cLst[k], label=legStr, marker=markerLst[k]) + ax.plot( + tt, yy, color=cLst[k], label=legStr, marker=markerLst[k]) if ylabel is not None: ax.set_ylabel(ylabel) # ax.set_xlim([np.min(tt), np.max(tt)]) @@ -307,31 +264,29 @@ def plotTS( ylim = ax.get_ylim() tBar = [tBar] if type(tBar) is not list else tBar for tt in tBar: - ax.plot([tt, tt], ylim, "-k") + ax.plot([tt, tt], ylim, '-k') if legLst is not None: - ax.legend(loc="upper right", frameon=False) + ax.legend(loc='upper right', frameon=False) if title is not None: - ax.set_title(title, loc="center") + ax.set_title(title, loc='center') if newFig is True: return fig, ax else: return ax -def plotVS( - x, - y, - *, - ax=None, - title=None, - xlabel=None, - ylabel=None, - titleCorr=True, - plot121=True, - doRank=False, - figsize=(8, 6), -): +def plotVS(x, + y, + *, + ax=None, + title=None, + xlabel=None, + ylabel=None, + titleCorr=True, + plot121=True, + doRank=False, + figsize=(8, 6)): if doRank is True: x = scipy.stats.rankdata(x) y = scipy.stats.rankdata(y) @@ -347,45 +302,42 @@ def plotVS( fig = None if title is not None: if titleCorr is True: - title = title + " " + r"$\rho$={:.2f}".format(corr) + title = title + ' ' + r'$\rho$={:.2f}'.format(corr) ax.set_title(title) else: if titleCorr is True: - ax.set_title(r"$\rho$=" + "{:.2f}".format(corr)) + ax.set_title(r'$\rho$=' + '{:.2f}'.format(corr)) if xlabel is not None: ax.set_xlabel(xlabel) if ylabel is not None: ax.set_ylabel(ylabel) # corr = np.corrcoef(x, y)[0, 1] - ax.plot(x, y, "b.") - ax.plot(xLr, yLr, "r-") + ax.plot(x, y, 'b.') + ax.plot(xLr, yLr, 'r-') if plot121 is True: plot121Line(ax) return fig, ax - -def plotxyVS( - x, - y, - *, - ax=None, - title=None, - xlabel=None, - ylabel=None, - titleCorr=True, - plot121=True, - plotReg=False, - corrType="Pearson", - figsize=(8, 6), - markerType="ob", -): - if corrType is "Pearson": +def plotxyVS(x, + y, + *, + ax=None, + title=None, + xlabel=None, + ylabel=None, + titleCorr=True, + plot121=True, + plotReg=False, + corrType='Pearson', + figsize=(8, 6), + markerType = 'ob'): + if corrType == 'Pearson': corr = scipy.stats.pearsonr(x, y)[0] - elif corrType is "Spearman": + elif corrType == 'Spearman': corr = scipy.stats.spearmanr(x, y)[0] - rmse = np.sqrt(np.nanmean((x - y) ** 2)) + rmse = np.sqrt(np.nanmean((x - y)**2)) pLr = np.polyfit(x, y, 1) xLr = np.array([np.min(x), np.max(x)]) yLr = np.poly1d(pLr)(xLr) @@ -397,31 +349,23 @@ def plotxyVS( fig = None if title is not None: if titleCorr is True: - title = ( - title - + " " - + r"$\rho$={:.2f}".format(corr) - + " " - + r"$RMSE$={:.3f}".format(rmse) - ) + title = title + ' ' + r'$\rho$={:.2f}'.format(corr) + ' ' + r'$RMSE$={:.3f}'.format(rmse) ax.set_title(title) else: if titleCorr is True: - ax.set_title( - r"$\rho$=" + "{:.2f}".format(corr) - ) + " " + r"$RMSE$={:.3f}".format(rmse) + ax.set_title(r'$\rho$=' + '{:.2f}'.format(corr)) + ' ' + r'$RMSE$={:.3f}'.format(rmse) if xlabel is not None: ax.set_xlabel(xlabel) if ylabel is not None: ax.set_ylabel(ylabel) - ax.plot(x, y, markerType, markerfacecolor="none") + ax.plot(x, y, markerType, markerfacecolor='none') # ax.set_xlim(min(np.min(x), np.min(y))-0.1, max(np.max(x), np.max(y))+0.1) # ax.set_ylim(min(np.min(x), np.min(y))-0.1, max(np.max(x), np.max(y))+0.1) ax.set_xlim(np.min(x), np.max(x)) ax.set_ylim(np.min(x), np.max(x)) if plotReg is True: - ax.plot(xLr, yLr, "r-") - ax.set_aspect("equal", "box") + ax.plot(xLr, yLr, 'r-') + ax.set_aspect('equal', 'box') if plot121 is True: plot121Line(ax) # xyline = np.linspace(*ax.get_xlim()) @@ -429,8 +373,7 @@ def plotxyVS( return fig, ax - -def plot121Line(ax, spec="k-"): +def plot121Line(ax, spec='k-'): xlim = ax.get_xlim() ylim = ax.get_ylim() vmin = np.min([xlim[0], ylim[0]]) @@ -438,23 +381,22 @@ def plot121Line(ax, spec="k-"): ax.plot([vmin, vmax], [vmin, vmax], spec) -def plotMap( - data, - *, - ax=None, - lat=None, - lon=None, - title=None, - cRange=None, - shape=None, - pts=None, - figsize=(8, 4), - clbar=True, - cRangeint=False, - cmap=plt.cm.jet, - bounding=None, - prj="cyl", -): +def plotMap(data, + *, + fig=None, + ax=None, + lat=None, + lon=None, + title=None, + cRange=None, + shape=None, + pts=None, + figsize=(8, 4), + clbar=True, + cRangeint=False, + cmap=plt.cm.jet, + bounding=None, + prj='cyl'): if cRange is not None: vmin = cRange[0] @@ -469,34 +411,41 @@ def plotMap( if ax is None: fig = plt.figure(figsize=figsize) ax = fig.subplots() + if len(data.squeeze().shape) == 1: isGrid = False else: isGrid = True if bounding is None: - bounding = [ - np.min(lat) - 0.5, - np.max(lat) + 0.5, - np.min(lon) - 0.5, - np.max(lon) + 0.5, - ] - - mm = basemap.Basemap( - llcrnrlat=bounding[0], - urcrnrlat=bounding[1], - llcrnrlon=bounding[2], - urcrnrlon=bounding[3], - projection=prj, - resolution="c", - ax=ax, - ) - mm.drawcoastlines() - mm.drawstates(linestyle="dashed") - mm.drawcountries(linewidth=1.0, linestyle="-.") - x, y = mm(lon, lat) + bounding = [np.min(lon)-0.5, np.max(lon)+0.5, + np.min(lat)-0.5,np.max(lat)+0.5] + # bounding = [np.min(lat)-0.5, np.max(lat)+0.5, + # np.min(lon)-0.5,np.max(lon)+0.5] + + ax.set_extent(bounding, crs=ccrs.Geodetic()) + ax.add_feature(cfeature.OCEAN) # ocean backgroud + ax.add_feature(cfeature.COASTLINE) + ax.add_feature(cfeature.STATES, linestyle = ':') + # ax.add_feature(cfeature.STATES.with_scale('110m')) + + # mm = basemap.Basemap( + # llcrnrlat=bounding[0], + # urcrnrlat=bounding[1], + # llcrnrlon=bounding[2], + # urcrnrlon=bounding[3], + # projection=prj, + # resolution='c', + # ax=ax) + # mm.drawcoastlines() + # mm.drawstates(linestyle='dashed') + # mm.drawcountries(linewidth=1.0, linestyle='-.') + # x, y = mm(lon, lat) + x, y = lon, lat if isGrid is True: xx, yy = np.meshgrid(x, y) - cs = mm.pcolormesh(xx, yy, data, cmap=cmap, vmin=vmin, vmax=vmax) + # cs = mm.pcolormesh(xx, yy, data, cmap=cmap, vmin=vmin, vmax=vmax) + cs = ax.pcolormesh(lon, lat, data, rasterized=True, ) + # cs = mm.imshow( # np.flipud(data), # cmap=plt.cm.jet(np.arange(0, 1, 0.1)), @@ -504,98 +453,136 @@ def plotMap( # vmax=vmax, # extent=[x[0], x[-1], y[0], y[-1]]) else: - cs = mm.scatter(x, y, c=data, s=30, cmap=cmap, vmin=vmin, vmax=vmax) + + # cs = mm.scatter( + # x, y, c=data, s=30, cmap=plt.cm.jet, vmin=vmin, vmax=vmax) + cs = ax.scatter( + x, y, c=data, s=30, cmap=plt.cm.jet, vmin=vmin, vmax=vmax) + if shape is not None: crd = np.array(shape.points) par = shape.parts if len(par) > 1: for k in range(0, len(par) - 1): - x = crd[par[k] : par[k + 1], 0] - y = crd[par[k] : par[k + 1], 1] - mm.plot(x, y, color="r", linewidth=3) + x = crd[par[k]:par[k + 1], 0] + y = crd[par[k]:par[k + 1], 1] + # mm.plot(x, y, color='r', linewidth=3) + ax.plot(x, y, color='r', linewidth=3) else: y = crd[:, 0] x = crd[:, 1] - mm.plot(x, y, color="r", linewidth=3) + # mm.plot(x, y, color='r', linewidth=3) + ax.plot(x, y, color='r', linewidth=3) if pts is not None: - mm.plot(pts[1], pts[0], "k*", markersize=4) + # mm.plot(pts[1], pts[0], 'k*', markersize=4) + ax.plot(pts[1], pts[0], 'k*', markersize=4) npt = len(pts[0]) for k in range(npt): - plt.text(pts[1][k], pts[0][k], string.ascii_uppercase[k], fontsize=18) + plt.text( + pts[1][k], + pts[0][k], + string.ascii_uppercase[k], + fontsize=18) if clbar is True: - mm.colorbar(cs, pad="5%", location="bottom") + fig.colorbar(cs, ax=[ax],location="bottom", pad=.05,aspect=40,) + ax.set_aspect('auto', adjustable=None) + # fig.colorbar(cs, ax=ax, orientation="horizontal", pad=.05) if title is not None: ax.set_title(title) if ax is None: - return fig, ax, mm + # return fig, ax, mm + return fig, ax, ax else: - return mm, cs + # return mm, cs + return ax, cs def plotlocmap( - lat, lon, ax=None, baclat=None, baclon=None, title=None, shape=None, txtlabel=None -): + lat, + lon, + ax=None, + baclat=None, + baclon=None, + title=None, + shape=None, + txtlabel=None, + fig=None): if ax is None: fig = plt.figure(figsize=(8, 4)) ax = fig.subplots() - mm = basemap.Basemap( - llcrnrlat=min(np.min(baclat), np.min(lat)) - 2.0, - urcrnrlat=max(np.max(baclat), np.max(lat)) + 2.0, - llcrnrlon=min(np.min(baclon), np.min(lon)) - 1.0, - urcrnrlon=max(np.max(baclon), np.max(lon)) + 1.0, - projection="cyl", - resolution="c", - ax=ax, - ) - mm.drawcoastlines() - mm.drawstates(linestyle="dashed") - mm.drawcountries(linewidth=1.0, linestyle="-.") - # x, y = mm(baclon, baclat) - # bs = mm.scatter( - # x, y, c='k', s=30) - x, y = mm(lon, lat) - ax.plot(x, y, "k*", markersize=12) + # crsProj = ccrs.PlateCarree() + # ax = plt.axes(projection=crsProj) + bounding = [np.min(baclon) - 0.5, np.max(baclon) + 0.5, + np.min(baclat) - 0.5, np.max(baclat) + 0.5] + + ax.set_extent(bounding, crs=ccrs.Geodetic()) + ax.add_feature(cfeature.OCEAN) # + ax.add_feature(cfeature.COASTLINE) + ax.add_feature(cfeature.STATES, linestyle=':') + # ax.add_feature(cfeature.STATES.with_scale('110m')) + + # mm = basemap.Basemap( + # llcrnrlat=min(np.min(baclat),np.min(lat))-0.5, + # urcrnrlat=max(np.max(baclat),np.max(lat))+0.5, + # llcrnrlon=min(np.min(baclon),np.min(lon))-0.5, + # urcrnrlon=max(np.max(baclon),np.max(lon))+0.5, + # projection='cyl', + # resolution='c', + # ax=ax) + # mm.drawcoastlines() + # mm.drawstates(linestyle='dashed') + # mm.drawcountries(linewidth=1.0, linestyle='-.') + # # x, y = mm(baclon, baclat) + # # bs = mm.scatter( + # # x, y, c='k', s=30) + # x, y = mm + x, y = lon, lat + ax.plot(x, y, 'k*', markersize=12) if shape is not None: crd = np.array(shape.points) par = shape.parts if len(par) > 1: for k in range(0, len(par) - 1): - x = crd[par[k] : par[k + 1], 0] - y = crd[par[k] : par[k + 1], 1] - mm.plot(x, y, color="r", linewidth=3) + x = crd[par[k]:par[k + 1], 0] + y = crd[par[k]:par[k + 1], 1] + # mm.plot(x, y, color='r', linewidth=3) + ax.plot(x, y, color='r', linewidth=3) else: y = crd[:, 0] x = crd[:, 1] - mm.plot(x, y, color="r", linewidth=3) + # mm.plot(x, y, color='r', linewidth=3) + ax.plot(x, y, color='r', linewidth=3) + if title is not None: - ax.set_title(title, loc="center") + ax.set_title(title, loc='center') if txtlabel is not None: for ii in range(len(lat)): txt = txtlabel[ii] xy = (x[ii], y[ii]) - xy = (x[ii] + 1.0, y[ii] - 1.5) - ax.annotate(txt, xy, fontsize=18, fontweight="bold") + xy = (x[ii]+1.0, y[ii]-1.5) + ax.annotate(txt, xy, fontsize=18, fontweight='bold') if ax is None: - return fig, ax, mm + # return fig, ax, mm + return fig, ax, ax else: - return mm - - -def plotPUBloc( - data, - *, - ax=None, - lat=None, - lon=None, - baclat=None, - baclon=None, - title=None, - cRange=None, - cRangeint=False, - shape=None, - isGrid=False, -): + # return mm + return ax + +def plotPUBloc(data, + *, + ax=None, + lat=None, + lon=None, + baclat=None, + baclon=None, + title=None, + cRange=None, + cRangeint=False, + shape=None, + isGrid=False, + fig = None): + if cRange is not None: vmin = cRange[0] vmax = cRange[1] @@ -614,71 +601,90 @@ def plotPUBloc( # isGrid = False # else: # isGrid = True + bounding = [np.min(baclon) - 0.5, np.max(baclon) + 0.5, + np.min(baclat) - 0.5, np.max(baclat) + 0.5] + + ax.set_extent(bounding, crs=ccrs.Geodetic()) + ax.add_feature(cfeature.OCEAN) # ocean background + ax.add_feature(cfeature.COASTLINE) + ax.add_feature(cfeature.STATES, linestyle=':') + # ax.add_feature(cfeature.STATES.with_scale('110m')) + + # mm = basemap.Basemap( + # llcrnrlat=min(np.min(baclat),np.min(lat))-0.5, + # urcrnrlat=max(np.max(baclat),np.max(lat))+0.5, + # llcrnrlon=min(np.min(baclon),np.min(lon))-0.5, + # urcrnrlon=max(np.max(baclon),np.max(lon))+0.5, + # projection='cyl', + # resolution='c', + # ax=ax) + # mm.drawcoastlines() + # mm.drawstates(linestyle='dashed') + # mm.drawcountries(linewidth=0.5, linestyle='-.') + # x, y = mm + x, y = lon, lat + + # bs = mm.scatter( + # x, y, c='k', s=30) + # x, y = mm(lon, lat) + + bs = ax.scatter(x, y, c="k", s=30,) - mm = basemap.Basemap( - llcrnrlat=min(np.min(baclat), np.min(lat)) - 0.5, - urcrnrlat=max(np.max(baclat), np.max(lat)) + 0.5, - llcrnrlon=min(np.min(baclon), np.min(lon)) - 0.5, - urcrnrlon=max(np.max(baclon), np.max(lon)) + 0.5, - projection="cyl", - resolution="c", - ax=ax, - ) - mm.drawcoastlines() - mm.drawstates(linestyle="dashed") - mm.drawcountries(linewidth=0.5, linestyle="-.") - x, y = mm(baclon, baclat) - bs = mm.scatter(x, y, c="k", s=30) - x, y = mm(lon, lat) if isGrid is True: xx, yy = np.meshgrid(x, y) - cs = mm.pcolormesh(xx, yy, data, cmap=plt.cm.jet, vmin=vmin, vmax=vmax) + # cs = mm.pcolormesh(xx, yy, data, cmap=plt.cm.jet, vmin=vmin, vmax=vmax) + cs = ax.pcolormesh(lon, lat, data, rasterized=True, ) else: - cs = mm.scatter( - x, y, c=data, s=100, cmap=plt.cm.jet, vmin=vmin, vmax=vmax, marker="*" - ) + # cs = mm.scatter( + # x, y, c=data, s=100, cmap=plt.cm.jet, vmin=vmin, vmax=vmax, marker='*') + cs = ax.scatter( + x, y, c=data, s=30, cmap=plt.cm.jet, vmin=vmin, vmax=vmax) if shape is not None: crd = np.array(shape.points) par = shape.parts if len(par) > 1: for k in range(0, len(par) - 1): - x = crd[par[k] : par[k + 1], 0] - y = crd[par[k] : par[k + 1], 1] - mm.plot(x, y, color="r", linewidth=3) + x = crd[par[k]:par[k + 1], 0] + y = crd[par[k]:par[k + 1], 1] + # mm.plot(x, y, color='r', linewidth=3) + ax.plot(x, y, color='r', linewidth=3) else: y = crd[:, 0] x = crd[:, 1] - mm.plot(x, y, color="r", linewidth=3) + # mm.plot(x, y, color='r', linewidth=3) + ax.plot(x, y, color='r', linewidth=3) # mm.colorbar(cs, location='bottom', pad='5%') + fig.colorbar(cs, ax=[ax], location="bottom", pad=.05, aspect=40, ) + ax.set_aspect('auto', adjustable=None) + if title is not None: ax.set_title(title) - if ax is None: - return fig, ax, mm - else: - return mm - - -def plotTsMap( - dataMap, - dataTs, - *, - lat, - lon, - t, - dataTs2=None, - tBar=None, - mapColor=None, - tsColor="krbg", - tsColor2="cmy", - mapNameLst=None, - tsNameLst=None, - tsNameLst2=None, - figsize=[12, 6], - isGrid=False, - multiTS=False, - linewidth=1, -): + if ax is None: + # return fig, ax, mm + return fig, ax, ax + else: + return ax + # return mm + +def plotTsMap(dataMap, + dataTs, + *, + lat, + lon, + t, + dataTs2=None, + tBar=None, + mapColor=None, + tsColor='krbg', + tsColor2='cmy', + mapNameLst=None, + tsNameLst=None, + tsNameLst2=None, + figsize=[9, 6], + isGrid=False, + multiTS=False, + linewidth=1): if type(dataMap) is np.ndarray: dataMap = [dataMap] if type(dataTs) is np.ndarray: @@ -711,28 +717,30 @@ def plotTsMap( # plot maps for k in range(nMap): - ax = fig.add_subplot(gs[0:2, k]) + # ax = fig.add_subplot(gs[0:2, k]) + crsProj = ccrs.PlateCarree() # set geographic cooridnates + ax = fig.add_subplot(gs[0:2, k], projection=crsProj, frameon=True) cRange = None if mapColor is None else mapColor[k] title = None if mapNameLst is None else mapNameLst[k] data = dataMap[k] if isGrid is False: - plotMap(data, lat=lat, lon=lon, ax=ax, cRange=cRange, title=title) + plotMap(data, lat=lat, lon=lon, fig=fig, ax=ax, cRange=cRange, title=title) else: grid, uy, ux = utils.grid.array2grid(data, lat=lat, lon=lon) - plotMap(grid, lat=uy, lon=ux, ax=ax, cRange=cRange, title=title) + plotMap(grid, lat=uy, lon=ux, fig=fig, ax=ax, cRange=cRange, title=title) # plot ts def onclick(event): xClick = event.xdata yClick = event.ydata - d = np.sqrt((xClick - lon) ** 2 + (yClick - lat) ** 2) + d = np.sqrt((xClick - lon)**2 + (yClick - lat)**2) ind = np.argmin(d) # titleStr = 'pixel %d, lat %.3f, lon %.3f' % (ind, lat[ind], lon[ind]) - # titleStr = 'gage %d, lat %.3f, lon %.3f' % (ind, lat[ind], lon[ind]) - # ax.clear() - # plotMap(data, lat=lat, lon=lon, ax=ax, cRange=cRange, title=title) - # ax.plot(lon[ind], lat[ind], 'k*', markersize=12) - titleStr = "pixel %d, lat %.3f, lon %.3f" % (ind, lat[ind], lon[ind]) +# titleStr = 'gage %d, lat %.3f, lon %.3f' % (ind, lat[ind], lon[ind]) +# ax.clear() +# plotMap(data, lat=lat, lon=lon, ax=ax, cRange=cRange, title=title) +# ax.plot(lon[ind], lat[ind], 'k*', markersize=12) + titleStr = 'pixel %d, lat %.3f, lon %.3f' % (ind, lat[ind], lon[ind]) for ix in range(nAx): tsLst = list() for temp in dataTs[ix]: @@ -747,8 +755,7 @@ def onclick(event): title=titleStr, cLst=tsColor, linewidth=linewidth, - tBar=tBar, - ) + tBar=tBar) else: plotTS( t, @@ -757,8 +764,7 @@ def onclick(event): legLst=tsNameLst, cLst=tsColor, linewidth=linewidth, - tBar=tBar, - ) + tBar=tBar) if dataTs2 is not None: tsLst2 = list() @@ -772,29 +778,25 @@ def onclick(event): legLst=tsNameLst2, cLst=tsColor2, lineWidth=linewidth, - tBar=tBar, - ) + tBar=tBar) if ix != nAx - 1: axTsLst[ix].set_xticklabels([]) plt.draw() - fig.canvas.mpl_connect("button_press_event", onclick) + fig.canvas.mpl_connect('button_press_event', onclick) plt.tight_layout() plt.show() - -def plotTsMapGage( - dataMap, - dataTs, - *, - lat, - lon, - t, - colorMap=None, - mapNameLst=None, - tsNameLst=None, - figsize=[12, 6], -): +def plotTsMapGage(dataMap, + dataTs, + *, + lat, + lon, + t, + colorMap=None, + mapNameLst=None, + tsNameLst=None, + figsize=[12, 6]): if type(dataMap) is np.ndarray: dataMap = [dataMap] if type(dataTs) is np.ndarray: @@ -820,13 +822,13 @@ def plotTsMapGage( def onclick(event): xClick = event.xdata yClick = event.ydata - d = np.sqrt((xClick - lon) ** 2 + (yClick - lat) ** 2) + d = np.sqrt((xClick - lon)**2 + (yClick - lat)**2) ind = np.argmin(d) # titleStr = 'pixel %d, lat %.3f, lon %.3f' % (ind, lat[ind], lon[ind]) - titleStr = "gage %d, lat %.3f, lon %.3f" % (ind, lat[ind], lon[ind]) + titleStr = 'gage %d, lat %.3f, lon %.3f' % (ind, lat[ind], lon[ind]) ax.clear() plotMap(data, lat=lat, lon=lon, ax=ax, cRange=cRange, title=title) - ax.plot(lon[ind], lat[ind], "k*", markersize=12) + ax.plot(lon[ind], lat[ind], 'k*', markersize=12) # ax.draw(renderer=None) tsLst = list() for k in range(nTs): @@ -835,26 +837,24 @@ def onclick(event): plotTS(t, tsLst, ax=axTs, legLst=tsNameLst, title=titleStr) plt.draw() - fig.canvas.mpl_connect("button_press_event", onclick) + fig.canvas.mpl_connect('button_press_event', onclick) plt.tight_layout() plt.show() -def plotCDF( - xLst, - *, - ax=None, - title=None, - legendLst=None, - figsize=(8, 6), - ref="121", - cLst=None, - xlabel=None, - ylabel=None, - showDiff="RMSE", - xlim=None, - linespec=None, -): +def plotCDF(xLst, + *, + ax=None, + title=None, + legendLst=None, + figsize=(8, 6), + ref='121', + cLst=None, + xlabel=None, + ylabel=None, + showDiff='RMSE', + xlim=None, + linespec=None): if ax is None: fig = plt.figure(figsize=figsize) ax = fig.subplots() @@ -866,7 +866,7 @@ def plotCDF( cLst = cmap(np.linspace(0, 1, len(xLst))) if title is not None: - ax.set_title(title, loc="left") + ax.set_title(title, loc='left') if xlabel is not None: ax.set_xlabel(xlabel) if ylabel is not None: @@ -887,49 +887,46 @@ def plotCDF( else: legStr = legendLst[k] if ref is not None: - if ref is "121": + if ref == '121': yRef = yRank - elif ref is "norm": + elif ref == 'norm': yRef = scipy.stats.norm.cdf(xSort, 0, 1) - rmse = np.sqrt(((xSort - yRef) ** 2).mean()) + rmse = np.sqrt(((xSort - yRef)**2).mean()) ksd = np.max(np.abs(xSort - yRef)) rmseLst.append(rmse) ksdLst.append(ksd) - if showDiff is "RMSE": - legStr = legStr + " RMSE=" + "%.3f" % rmse - elif showDiff is "KS": - legStr = legStr + " KS=" + "%.3f" % ksd + if showDiff == 'RMSE': + legStr = legStr + ' RMSE=' + '%.3f' % rmse + elif showDiff == 'KS': + legStr = legStr + ' KS=' + '%.3f' % ksd ax.plot(xSort, yRank, color=cLst[k], label=legStr, linestyle=linespec[k]) ax.grid(b=True) if xlim is not None: ax.set(xlim=xlim) - if ref is "121": - ax.plot([0, 1], [0, 1], "k", label="y=x") - if ref is "norm": + if ref == '121': + ax.plot([0, 1], [0, 1], 'k', label='y=x') + if ref == 'norm': xNorm = np.linspace(-5, 5, 1000) normCdf = scipy.stats.norm.cdf(xNorm, 0, 1) - ax.plot(xNorm, normCdf, "k", label="Gaussian") + ax.plot(xNorm, normCdf, 'k', label='Gaussian') if legendLst is not None: - ax.legend(loc="best", frameon=False) + ax.legend(loc='best', frameon=False) # out = {'xSortLst': xSortLst, 'rmseLst': rmseLst, 'ksdLst': ksdLst} return fig, ax - -def plotFDC( - xLst, - *, - ax=None, - title=None, - legendLst=None, - figsize=(8, 6), - ref="121", - cLst=None, - xlabel=None, - ylabel=None, - showDiff="RMSE", - xlim=None, - linespec=None, -): +def plotFDC(xLst, + *, + ax=None, + title=None, + legendLst=None, + figsize=(8, 6), + ref='121', + cLst=None, + xlabel=None, + ylabel=None, + showDiff='RMSE', + xlim=None, + linespec=None): if ax is None: fig = plt.figure(figsize=figsize) ax = fig.subplots() @@ -941,7 +938,7 @@ def plotFDC( cLst = cmap(np.linspace(0, 1, len(xLst))) if title is not None: - ax.set_title(title, loc="center") + ax.set_title(title, loc='center') if xlabel is not None: ax.set_xlabel(xlabel) if ylabel is not None: @@ -953,37 +950,37 @@ def plotFDC( for k in range(0, len(xLst)): x = xLst[k] xSort = flatData(x, sortOpt=1) - yRank = np.arange(1, len(xSort) + 1) / float(len(xSort) + 1) * 100 + yRank = np.arange(1, len(xSort)+1) / float(len(xSort) + 1)*100 xSortLst.append(xSort) if legendLst is None: legStr = None else: legStr = legendLst[k] if ref is not None: - if ref is "121": + if ref == '121': yRef = yRank - elif ref is "norm": + elif ref == 'norm': yRef = scipy.stats.norm.cdf(xSort, 0, 1) - rmse = np.sqrt(((xSort - yRef) ** 2).mean()) + rmse = np.sqrt(((xSort - yRef)**2).mean()) ksd = np.max(np.abs(xSort - yRef)) rmseLst.append(rmse) ksdLst.append(ksd) - if showDiff is "RMSE": - legStr = legStr + " RMSE=" + "%.3f" % rmse - elif showDiff is "KS": - legStr = legStr + " KS=" + "%.3f" % ksd + if showDiff == 'RMSE': + legStr = legStr + ' RMSE=' + '%.3f' % rmse + elif showDiff == 'KS': + legStr = legStr + ' KS=' + '%.3f' % ksd ax.plot(yRank, xSort, color=cLst[k], label=legStr, linestyle=linespec[k]) ax.grid(b=True) if xlim is not None: ax.set(xlim=xlim) - if ref is "121": - ax.plot([0, 1], [0, 1], "k", label="y=x") - if ref is "norm": + if ref == '121': + ax.plot([0, 1], [0, 1], 'k', label='y=x') + if ref == 'norm': xNorm = np.linspace(-5, 5, 1000) normCdf = scipy.stats.norm.cdf(xNorm, 0, 1) - ax.plot(xNorm, normCdf, "k", label="Gaussian") + ax.plot(xNorm, normCdf, 'k', label='Gaussian') if legendLst is not None: - ax.legend(loc="best", frameon=False) + ax.legend(loc='best', frameon=False) # out = {'xSortLst': xSortLst, 'rmseLst': rmseLst, 'ksdLst': ksdLst} return fig, ax @@ -999,7 +996,7 @@ def flatData(x, sortOpt=0): elif sortOpt == -1: xSort = xArray - return xSort + return (xSort) def scaleSigma(s, u, y): @@ -1021,74 +1018,3 @@ def regLinear(y, x): X = sm.add_constant(np.column_stack((ele, X))) out = sm.OLS(y, X).fit() return out - -def plotBoxFigMulti( - data, - label1=None, - label2=None, - colorLst='rbkgcmy', - title=None, - figsize=(10, 8), - sharey=True, - xticklabel=None, - path_fig='single_plotbox.jpg', - ): - ''' - data: list type [np.array([])]: pix --> date - label1: label of each subwindows, e.g. ["Bias","RMSE","ubRMSE","Corr"] - label2: label of box, e.g. ["SMAP data"] - colorLst: color for each box, e.g. red(default color) - title: figure title - path_fig: save path - ''' - - nc = len(data) - fig, axes = plt.subplots(ncols=nc, sharey=sharey, figsize=figsize, constrained_layout=True) - - median_dict = {} - for k in range(0, nc): - ax = axes[k] if nc > 1 else axes - temp = data[k] - if type(temp) is list: - for kk in range(len(temp)): - tt = temp[kk] - if tt is not None and tt != []: - tt = tt[~np.isnan(tt)] - temp[kk] = tt - else: - temp[kk] = [] - else: - temp = temp[~np.isnan(temp)] - bp = ax.boxplot(temp, patch_artist=True, notch=True, showfliers=False) - medians_int = round(np.median(temp), 4) - median_dict[label1[k]] = medians_int - # xtick = ax.get_xticks() - # ax.text(2,3, str(medians_int), - # horizontalalignment='center', - # # fontsize=9, - # size='large', # x-small - # color='k',) - - for kk in range(0, len(bp['boxes'])): - plt.setp(bp['boxes'][kk], facecolor=colorLst[kk]) - - if label1 is not None: - ax.set_xlabel(label1[k]) - else: - ax.set_xlabel(str(k)) - if xticklabel is None: - ax.set_xticks([]) - else: - ax.set_xticks([y+1 for y in range(0,len(data[k]),2)]) - ax.set_xticklabels(xticklabel) - # ax.ticklabel_format(axis='y', style='sci') - if label2 is not None: - if nc == 1: - ax.legend(bp['boxes'], label2, loc='best', frameon=False, ncol=2) - else: - axes[-1].legend(bp['boxes'], label2, loc='best', frameon=False, ncol=2, fontsize=12) - if title is not None: - fig.suptitle(title) - plt.savefig(path_fig,dpi=600) - # plt.close('all') - return median_dict \ No newline at end of file diff --git a/requirements.txt b/requirements.txt index 7f9b1a2..01a9750 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,7 +1,7 @@ -torch==1.7.1 -matplotlib==3.4.0 -basemap==1.3.0 +torch==1.13.1 +matplotlib +cartopy numpy pandas scipy From 827bcc633bde3b82ed3ae5f28846342af8b9de5d Mon Sep 17 00:00:00 2001 From: taddyb Date: Wed, 14 Feb 2024 09:31:46 -0500 Subject: [PATCH 2/4] added cartopy --- environment.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/environment.yml b/environment.yml index 7de5a1f..c824312 100644 --- a/environment.yml +++ b/environment.yml @@ -31,6 +31,7 @@ dependencies: - bzip2=1.0.6=h14c3975_5 - ca-certificates=2019.1.23=0 - cairo=1.14.12=h8948797_3 + - cartopy - certifi=2019.3.9=py36_0 - cffi=1.12.3=py36h2e261b9_0 - chardet=3.0.4=py36_1 From 974751373ee86a7de6626e57b44cb4f4865e171a Mon Sep 17 00:00:00 2001 From: taddyb Date: Wed, 14 Feb 2024 09:37:03 -0500 Subject: [PATCH 3/4] removing merge conflicts in environment.yml file --- environment.yml | 152 +----------------------------------------------- 1 file changed, 2 insertions(+), 150 deletions(-) diff --git a/environment.yml b/environment.yml index 81c48ad..a0150fe 100644 --- a/environment.yml +++ b/environment.yml @@ -1,4 +1,4 @@ -name: hydrodl_new +name: hydrodl channels: - pytorch - nvidia @@ -6,153 +6,6 @@ channels: - anaconda - defaults dependencies: -<<<<<<< HEAD - - _ipyw_jlab_nb_ext_conf=0.1.0=py36_0 - - alabaster=0.7.12=py36_0 - - anaconda-client=1.7.2=py36_0 - - anaconda-navigator=1.9.7=py36_0 - - anaconda-project=0.8.2=py36_0 - - asn1crypto=0.24.0=py36_0 - - astroid=2.2.5=py36_0 - - astropy=3.1.2=py36h7b6447c_0 - - atomicwrites=1.3.0=py36_1 - - attrs=19.1.0=py36_1 - - babel=2.6.0=py36_0 - - backcall=0.1.0=py36_0 - - backports=1.0=py36_1 - - backports.os=0.1.1=py36_0 - - backports.shutil_get_terminal_size=1.0.0=py36_2 - - beautifulsoup4=4.7.1=py36_1 - - bitarray=0.9.0=py36h7b6447c_0 - - bkcharts=0.2=py36_0 - - blas=1.0=mkl - - blaze=0.11.3=py36_0 - - bleach=3.1.0=py36_0 - - blosc=1.15.0=hd408876_0 - - bokeh=1.1.0=py36_0 - - boto=2.49.0=py36_0 - - bottleneck=1.2.1=py36h035aef0_1 - - bzip2=1.0.6=h14c3975_5 - - ca-certificates=2019.1.23=0 - - cairo=1.14.12=h8948797_3 - - cartopy - - certifi=2019.3.9=py36_0 - - cffi=1.12.3=py36h2e261b9_0 - - chardet=3.0.4=py36_1 - - click=7.0=py36_0 - - cloudpickle=0.8.1=py_0 - - clyent=1.2.2=py36_1 - - colorama=0.4.1=py36_0 - - conda=4.6.14=py36_0 - - conda-build=3.17.8=py36_0 - - conda-env=2.6.0=1 - - conda-verify=3.1.1=py36_0 - - contextlib2=0.5.5=py36_0 - - cryptography=2.6.1=py36h1ba5d50_0 - - cuda80=1.0=h205658b_0 - - cudatoolkit=10.0.130=0 - - cudnn=7.3.1=cuda10.0_0 - - curl=7.64.1=hbc83047_0 - - cycler=0.10.0=py36_0 - - cython=0.29.7=py36he6710b0_0 - - cytoolz=0.9.0.1=py36h14c3975_1 - - dask=1.2.0=py_0 - - dask-core=1.2.0=py_0 - - datashape=0.5.4=py36_1 - - dbus=1.13.6=h746ee38_0 - - decorator=4.4.0=py36_1 - - defusedxml=0.6.0=py_0 - - distributed=1.27.1=py36_0 - - docutils=0.14=py36_0 - - entrypoints=0.3=py36_0 - - et_xmlfile=1.0.1=py36_0 - - expat=2.2.6=he6710b0_0 - - fastcache=1.0.2=py36h14c3975_2 - - filelock=3.0.10=py36_0 - - flask=1.0.2=py36_1 - - flask-cors=3.0.7=py36_0 - - fontconfig=2.13.0=h9420a91_0 - - freetype=2.9.1=h8a8886c_1 - - fribidi=1.0.5=h7b6447c_0 - - future=0.17.1=py36_0 - - geos=3.6.2=heeff764_2 - - get_terminal_size=1.0.0=haa9412d_0 - - gevent=1.4.0=py36h7b6447c_0 - - glib=2.56.2=hd408876_0 - - glob2=0.6=py36_1 - - gmp=6.1.2=h6c8ec71_1 - - gmpy2=2.0.8=py36h10f8cd9_2 - - graphite2=1.3.13=h23475e2_0 - - greenlet=0.4.15=py36h7b6447c_0 - - gst-plugins-base=1.14.0=hbbd80ab_1 - - gstreamer=1.14.0=hb453b48_1 - - h5py=2.9.0=py36h7918eee_0 - - harfbuzz=1.8.8=hffaf4a1_0 - - hdf5=1.10.4=hb1b8bf9_0 - - heapdict=1.0.0=py36_2 - - html5lib=1.0.1=py36_0 - - icu=58.2=h9c2bf20_1 - - idna=2.8=py36_0 - - imageio=2.5.0=py36_0 - - imagesize=1.1.0=py36_0 - - importlib_metadata=0.9=py36_0 - - intel-openmp=2019.3=199 - - ipykernel=5.1.0=py36h39e3cac_0 - - ipython=7.5.0=py36h39e3cac_0 - - ipython_genutils=0.2.0=py36_0 - - ipywidgets=7.4.2=py36_0 - - isort=4.3.17=py36_0 - - itsdangerous=1.1.0=py36_0 - - jbig=2.1=hdba287a_0 - - jdcal=1.4.1=py_0 - - jedi=0.13.3=py36_0 - - jeepney=0.4=py36_0 - - jinja2=2.10.1=py36_0 - - jpeg=9b=h024ee3a_2 - - jsonschema=3.0.1=py36_0 - - jupyter=1.0.0=py36_7 - - jupyter_client=5.2.4=py36_0 - - jupyter_console=6.0.0=py36_0 - - jupyter_core=4.4.0=py36_0 - - jupyterlab=0.35.5=py36hf63ae98_0 - - jupyterlab_launcher=0.13.1=py36_0 - - jupyterlab_server=0.2.0=py36_0 - - keyring=18.0.0=py36_0 - - kiwisolver=1.1.0=py36he6710b0_0 - - krb5=1.16.1=h173b8e3_7 - - lazy-object-proxy=1.3.1=py36h14c3975_2 - - libarchive=3.3.3=h5d8350f_5 - - libcurl=7.64.1=h20c2e04_0 - - libedit=3.1.20181209=hc058e9b_0 - - libffi=3.2.1=hd88cf55_4 - - libgcc-ng=8.2.0=hdf63c60_1 - - libgfortran-ng=7.3.0=hdf63c60_0 - - liblief=0.9.0=h7725739_2 - - libpng=1.6.37=hbc83047_0 - - libsodium=1.0.16=h1bed415_0 - - libssh2=1.8.2=h1ba5d50_0 - - libstdcxx-ng=8.2.0=hdf63c60_1 - - libtiff=4.0.10=h2733197_2 - - libtool=2.4.6=h7b6447c_5 - - libuuid=1.0.3=h1bed415_2 - - libxcb=1.13=h1bed415_1 - - libxml2=2.9.9=he19cac6_0 - - libxslt=1.1.33=h7d1a2b0_0 - - llvmlite=0.28.0=py36hd408876_0 - - locket=0.2.0=py36_1 - - lxml=4.3.3=py36hefd8a0e_0 - - lz4-c=1.8.1.2=h14c3975_0 - - lzo=2.10=h49e0be7_2 - - markupsafe=1.1.1=py36h7b6447c_0 - - matplotlib=3.0.3=py36h5429711_0 - - mccabe=0.6.1=py36_1 - - mistune=0.8.4=py36h7b6447c_0 - - mkl=2019.3=199 - - mkl-service=1.1.2=py36he904b0f_5 - - mkl_fft=1.0.12=py36ha843d7b_0 - - mkl_random=1.0.2=py36hd81dba3_0 - - more-itertools=7.0.0=py36_0 -======= - _libgcc_mutex=0.1=main - _openmp_mutex=5.1=1_gnu - basemap=1.3.2=py310hb079758_1 @@ -257,7 +110,6 @@ dependencies: - mkl-service=2.4.0=py310h5eee18b_1 - mkl_fft=1.3.8=py310h5eee18b_0 - mkl_random=1.2.4=py310hdb19cb5_0 ->>>>>>> 572c715c834a344cf9210c41cfcb257ead0f6783 - mpc=1.1.0=h10f8cd9_1 - mpfr=4.0.2=hb69a4c5_1 - mpmath=1.3.0=py310h06a4308_0 @@ -321,4 +173,4 @@ dependencies: - xz=5.4.2=h5eee18b_0 - yaml=0.2.5=h7b6447c_0 - zlib=1.2.13=h5eee18b_0 - - zstd=1.5.5=hc292b87_0 + - zstd=1.5.5=hc292b87_0 \ No newline at end of file From c5c1de93c8617ee0206187a660d360bb86f69928 Mon Sep 17 00:00:00 2001 From: taddyb Date: Wed, 14 Feb 2024 09:38:54 -0500 Subject: [PATCH 4/4] removed basemap from environment file --- environment.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/environment.yml b/environment.yml index a0150fe..fda0f69 100644 --- a/environment.yml +++ b/environment.yml @@ -8,8 +8,6 @@ channels: dependencies: - _libgcc_mutex=0.1=main - _openmp_mutex=5.1=1_gnu - - basemap=1.3.2=py310hb079758_1 - - basemap-data=1.3.6=py310h06a4308_1 - blas=1.0=mkl - bottleneck=1.3.5=py310ha9d4c09_0 - brotli=1.0.9=h5eee18b_7 @@ -18,6 +16,7 @@ dependencies: - bzip2=1.0.8=h7b6447c_0 - c-ares=1.19.1=h5eee18b_0 - ca-certificates=2023.08.22=h06a4308_0 + - cartopy - certifi=2023.7.22=py310h06a4308_0 - cffi=1.16.0=py310h5eee18b_0 - charset-normalizer=2.0.4=pyhd3eb1b0_0