Commit e8a89aa1 authored by Carl Schreck's avatar Carl Schreck

Working on Imke's figures... Added scatter plot of station types.

parent 2ce14550
......@@ -52,7 +52,7 @@ def draw_station_type(path, lat_column=1, lon_column=2, time_column=6,
cjs.add_map(ax, shp_name, edgecolor='none', facecolor='silver', zorder=1,
usa_only=True)
cjs.add_map(ax, shp_name, edgecolor=(0.2, 0.2, 0.2), facecolor='none',
zorder=3, usa_only=True)
zorder=30, usa_only=True)
lat = asc_data[lat_column]
lon = asc_data[lon_column]
......@@ -60,12 +60,23 @@ def draw_station_type(path, lat_column=1, lon_column=2, time_column=6,
obs_time = asc_data[time_column]
network = asc_data[0].str[2]
labels = ['RAWS', 'SNOTEL', 'NWS Midnight', 'NWS Morning']
# R/S is 0000
# C/W is NWS and can be anything... 2400 not 0000
# plot = ax.scatter(x=lon, y=lat, c=data, norm=norm, cmap=cmap, zorder=2,
# transform=ccrs.PlateCarree(), marker='.')
zorders = [4, 5, 3, 2]
station_type = np.full(lat.shape, fill_value=3)
station_type = np.where(network == 'R', 0, station_type)
station_type = np.where(network == 'W', 1, station_type)
station_type = np.where(obs_time == 2400, 2, station_type)
# R/S is 0000. C/W is NWS and can be anything... 2400 not 0000
df = pd.DataFrame(dict(lon=lon, lat=lat, station_type=station_type))
groups = df.groupby('station_type')
for type_ind, group in groups:
ax.plot(group.lon, group.lat, transform=ccrs.PlateCarree(),
marker='.', linestyle='', label=labels[type_ind],
zorder=zorders[type_ind])
# plot = ax.scatter(x=lon, y=lat, transform=ccrs.PlateCarree(),
# c=cmap[station_type], zorder=2,
# marker='.')
ax.legend(labels=labels)
return asc_data
......@@ -78,4 +89,4 @@ cmap = cm.get_cmap('bwr', lut=(len(bounds) + 1))
norm = mpl.colors.BoundaryNorm(bounds, cmap.N, clip=False)
station_plot = draw_station_type(path, cmap=cmap, norm=norm)
# plt.colorbar(station_plot)
# plt.show()
\ No newline at end of file
plt.show()
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment