diff --git a/make-panel.py b/make-panel.py index 68ea8b6..d17c0f6 100644 --- a/make-panel.py +++ b/make-panel.py @@ -5,7 +5,7 @@ import getopt import matplotlib as mpl -mpl.rcParams['figure.dpi']= 300 +mpl.rcParams['figure.dpi']= 500 #========================================================================= class MakePanelPlot(): diff --git a/plot-sondes.py b/plot-sondes.py index 8c6cdea..e8954bc 100644 --- a/plot-sondes.py +++ b/plot-sondes.py @@ -98,7 +98,7 @@ def plot(self, lons, lats, data): else: plt.show() - def plot_obs_marker(self, lons, lats, data, obslon, obslat): + def plot_obs_marker(self, lons, lats, data, obslon, obslat, obsval): nrows = 1 ncols = 1 @@ -146,8 +146,40 @@ def plot_obs_marker(self, lons, lats, data, obslon, obslat): obssize[:] = 10 #adding marks: - axs.scatter(obslon, obslat, color="orangered", - s=obssize, alpha=0.8, transform=proj) + plon = obslon.copy() + plat = obslat.copy() + pval = obsval.copy() + pcol = [] + psiz = [] + + i = 0 + for n in range(len(obslon)): + if(not np.isnan(obsval[n])): + plon[i] = obslon[n] + plat[i] = obslat[n] + pval[i] = obsval[n] + if(pval[i] >= 0.0): + pcol.append('red') + psiz.append(int(1 + 10.0*pval[i])) + else: + pcol.append('blue') + psiz.append(int(1 - 10.0*pval[i])) + i += 1 + + #if(i): + # indices = np.linspace(0, i, i) + # colors = np.sin(indices/float(i)) + #else: + # indices = np.linspace(0, 1, 1) + # colors = np.sin(indices/float(1)) + + #axs.scatter(obslon, obslat, color="orangered", + # s=obssize, alpha=0.8, transform=proj) + axs.scatter(plon[0:i], plat[0:i], color=pcol, + s=psiz, alpha=0.8, transform=proj) + + #colors = ["red", "blue", "green"] + #plt.scatter(X, Y, color = colors) #Adjust the location of the subplots on the page to make room for the colorbar fig.subplots_adjust(bottom=0.1, top=0.9, left=0.05, right=0.95, @@ -308,7 +340,7 @@ def set_runname(self, runname): gp.set_imagename(imagename) #gp.plot(lons, lats, data) - gp.plot_obs_marker(lons, lats, data, olon, olat) + gp.plot_obs_marker(lons, lats, data, olon, olat, tomb) #----------------------------------------------------------------------------------------- ncfile.close()