Commit 95043af2 authored by Carl Schreck's avatar Carl Schreck

Adding occurrence contours

parent 201693f2
......@@ -17,7 +17,7 @@ import gzip
import cjs # '~carl/lib/python'
def draw_station_data(ax, path, lat_column=1, lon_column=2, data_column=5,
levels=None, cmap=None):
levels=None, cmap=None, markersize=50):
cjs.tstamp(f'Reading {path}')
asc_data = pd.read_csv(path, sep=' ', header=None, skipinitialspace=True)
......@@ -28,7 +28,8 @@ def draw_station_data(ax, path, lat_column=1, lon_column=2, data_column=5,
data = asc_data[data_column]
plot = ax.scatter(x=lon, y=lat, c=data, norm=cjs.norm_scatter(levels),
cmap=cmap, zorder=3, transform=ccrs.PlateCarree(),
cmap=cmap, zorder=99, transform=ccrs.PlateCarree(),
s=markersize,
marker='.', edgecolors='black', linewidth=0.5)
return plot
......
......@@ -45,11 +45,19 @@ helpers.draw_station_data(ax, station_path, levels=0.1, cmap=cmap,
data_column=6)
anu_occur_path = f'{base_path}BPRC_20180914_D6_A2.pnt.gz'
anu_occur_data = helpers.read_unscaled(anu_occur_path, var_name, data_column=5)
sph_occur_path = f'{base_path}BPRC_20180914_D6_S1.pnt.gz'
sph_occur_data = helpers.read_unscaled(sph_occur_path, var_name, data_column=2)
plot = anu_occur_data.plot(ax=ax, transform=ccrs.PlateCarree(),
add_colorbar=False,
cmap=cmap, levels=occur_levels, zorder=1,
vmin=-np.inf, vmax=np.inf, extend='both',
)
sph_occur_data.plot.contour(ax=ax, transform=ccrs.PlateCarree(),
levels=[0.4], zorder=2,
colors='magenta')
anu_occur_data.plot.contour(ax=ax, transform=ccrs.PlateCarree(),
levels=[0.4], zorder=2,
colors='darkorange')
ax.set_title(f'(a) Anusplin occurrence', loc='left')
ax.set_extent(extent)
ax.outline_patch.set_visible(True)
......@@ -59,13 +67,17 @@ cjs.tstamp('Drawing spheremap occurrence')
ax = axs[0,1]
helpers.draw_station_data(ax, station_path, levels=0.1, cmap=cmap,
data_column=6)
sph_occur_path = f'{base_path}BPRC_20180914_D6_S1.pnt.gz'
sph_occur_data = helpers.read_unscaled(sph_occur_path, var_name, data_column=2)
plot = sph_occur_data.plot(ax=ax, transform=ccrs.PlateCarree(),
add_colorbar=False,
cmap=cmap, levels=occur_levels, zorder=1,
vmin=-np.inf, vmax=np.inf, extend='both',
)
sph_occur_data.plot.contour(ax=ax, transform=ccrs.PlateCarree(),
levels=[0.4], zorder=2,
colors='magenta')
anu_occur_data.plot.contour(ax=ax, transform=ccrs.PlateCarree(),
levels=[0.4], zorder=2,
colors='darkorange')
ax.set_title(f'(b) Spheremap occurrence', loc='left')
ax.set_extent(extent)
ax.outline_patch.set_visible(True)
......@@ -87,6 +99,9 @@ plot = anusplin_data.plot(ax=ax, transform=ccrs.PlateCarree(),
cmap=cmap, levels=precip_levels, zorder=1,
vmin=-np.inf, vmax=np.inf, extend='both',
)
anusplin_data.plot.contour(ax=ax, transform=ccrs.PlateCarree(),
levels=[0.1], zorder=2,
colors='black')
ax.set_title(f'(c) Anusplin Precipitation', loc='left')
ax.set_extent(extent)
ax.outline_patch.set_visible(True)
......@@ -103,6 +118,9 @@ plot = scaled_data.plot(ax=ax, transform=ccrs.PlateCarree(),
cmap=cmap, levels=precip_levels, zorder=1,
vmin=-np.inf, vmax=np.inf, extend='both',
)
scaled_data.plot.contour(ax=ax, transform=ccrs.PlateCarree(),
levels=[0.1], zorder=2,
colors='black')
ax.set_title(f'(d) Scaled data', loc='left')
ax.set_extent(extent)
ax.outline_patch.set_visible(True)
......
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