Skip to content

Commit

Permalink
Deploy dev to GitHub Pages
Browse files Browse the repository at this point in the history
  • Loading branch information
dopplershift committed Aug 28, 2024
1 parent 671900a commit 1447246
Show file tree
Hide file tree
Showing 451 changed files with 1,344 additions and 1,338 deletions.
Binary file not shown.
Binary file modified dev/_downloads/082a0fab3fe1251c35a5c076fbfdaaaf/Bulk_Shear.zip
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
},
"outputs": [],
"source": [
"spec = gridspec.GridSpec(1, 2)\nfig = plt.figure(figsize=(15, 8))\nadd_metpy_logo(fig, 190, 85, size='large')\nctables = (('NWSStormClearReflectivity', -20, 0.5), # dBZ\n ('NWS8bitVel', -100, 1.0)) # m/s\n\nfor v, ctable, ax_rect in zip(('N0Q', 'N0U'), ctables, spec):\n # Open the file\n name = get_test_data(f'nids/KOUN_SDUS54_{v}TLX_201305202016', as_file_obj=False)\n f = Level3File(name)\n\n # Pull the data out of the file object\n datadict = f.sym_block[0][0]\n\n # Turn into an array using the scale specified by the file\n data = f.map_data(datadict['data'])\n\n # Grab azimuths and calculate a range based on number of gates,\n # both with their respective units\n az = units.Quantity(np.array(datadict['start_az'] + [datadict['end_az'][-1]]), 'degrees')\n rng = units.Quantity(np.linspace(0, f.max_range, data.shape[-1] + 1), 'kilometers')\n\n # Extract central latitude and longitude from the file\n cent_lon = f.lon\n cent_lat = f.lat\n\n # Convert az,range to x,y\n xlocs, ylocs = azimuth_range_to_lat_lon(az, rng, cent_lon, cent_lat)\n\n # Plot the data\n crs = ccrs.LambertConformal()\n ax = fig.add_subplot(ax_rect, projection=crs)\n ax.add_feature(USCOUNTIES, linewidth=0.5)\n norm, cmap = colortables.get_with_steps(*ctable)\n ax.pcolormesh(xlocs, ylocs, data, norm=norm, cmap=cmap, transform=ccrs.PlateCarree())\n ax.set_extent([cent_lon - 0.5, cent_lon + 0.5, cent_lat - 0.5, cent_lat + 0.5])\n ax.set_aspect('equal', 'datalim')\n add_timestamp(ax, f.metadata['prod_time'], y=0.02, high_contrast=True)\n\nplt.show()"
"spec = gridspec.GridSpec(1, 2)\nfig = plt.figure(figsize=(15, 8))\nadd_metpy_logo(fig, 190, 85, size='large')\nctables = (('NWSStormClearReflectivity', -20, 0.5), # dBZ\n ('NWS8bitVel', -100, 1.0)) # m/s\n\nfor v, ctable, ax_rect in zip(('N0Q', 'N0U'), ctables, spec, strict=False):\n # Open the file\n name = get_test_data(f'nids/KOUN_SDUS54_{v}TLX_201305202016', as_file_obj=False)\n f = Level3File(name)\n\n # Pull the data out of the file object\n datadict = f.sym_block[0][0]\n\n # Turn into an array using the scale specified by the file\n data = f.map_data(datadict['data'])\n\n # Grab azimuths and calculate a range based on number of gates,\n # both with their respective units\n az = units.Quantity(np.array(datadict['start_az'] + [datadict['end_az'][-1]]), 'degrees')\n rng = units.Quantity(np.linspace(0, f.max_range, data.shape[-1] + 1), 'kilometers')\n\n # Extract central latitude and longitude from the file\n cent_lon = f.lon\n cent_lat = f.lat\n\n # Convert az,range to x,y\n xlocs, ylocs = azimuth_range_to_lat_lon(az, rng, cent_lon, cent_lat)\n\n # Plot the data\n crs = ccrs.LambertConformal()\n ax = fig.add_subplot(ax_rect, projection=crs)\n ax.add_feature(USCOUNTIES, linewidth=0.5)\n norm, cmap = colortables.get_with_steps(*ctable)\n ax.pcolormesh(xlocs, ylocs, data, norm=norm, cmap=cmap, transform=ccrs.PlateCarree())\n ax.set_extent([cent_lon - 0.5, cent_lon + 0.5, cent_lat - 0.5, cent_lat + 0.5])\n ax.set_aspect('equal', 'datalim')\n add_timestamp(ax, f.metadata['prod_time'], y=0.02, high_contrast=True)\n\nplt.show()"
]
}
],
Expand Down
Binary file modified dev/_downloads/1523f155da5959646e27c2eaca8007cb/Station_Plot.zip
Binary file not shown.
Binary file not shown.
Binary file modified dev/_downloads/1aa267885c4b6699e5357f95474588e6/Divergence.zip
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@
ax2 = fig.add_subplot(1, 3, 2, projection=proj)
ax3 = fig.add_subplot(1, 3, 3, projection=proj)

for scale, axis in zip(['20m', '5m', '500k'], [ax1, ax2, ax3]):
for scale, axis in zip(['20m', '5m', '500k'], [ax1, ax2, ax3], strict=False):
axis.set_extent([270.25, 270.9, 38.15, 38.75], ccrs.Geodetic())
axis.add_feature(USCOUNTIES.with_scale(scale))
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified dev/_downloads/52a7c4e2d2473999748f1de66b9de91d/Parse_Angles.zip
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,10 @@ def draw_circle(ax, x, y, r, m, label):
#
# The variable ``indices`` represents the index of each matched coordinate within the
# cKDTree's ``data`` list.
grid_points = np.array(list(zip(sim_gridx, sim_gridy)))
grid_points = np.array(list(zip(sim_gridx, sim_gridy, strict=False)))

radius = 40
obs_tree = cKDTree(list(zip(xp, yp)))
obs_tree = cKDTree(list(zip(xp, yp, strict=False)))
indices = obs_tree.query_ball_point(grid_points, r=radius)

###########################################
Expand All @@ -83,7 +83,7 @@ def draw_circle(ax, x, y, r, m, label):
barnes_dist = dist_2(sim_gridx[1], sim_gridy[1], x2, y2)
barnes_obs = zp[indices[1]]

kappa = calc_kappa(average_spacing(list(zip(xp, yp))))
kappa = calc_kappa(average_spacing(list(zip(xp, yp, strict=False))))

barnes_val = barnes_point(barnes_dist, barnes_obs, kappa)

Expand Down Expand Up @@ -121,7 +121,7 @@ def draw_circle(ax, x, y, r, m, label):
mx, my = obs_tree.data[indices[0]].T
mz = zp[indices[0]]

for x, y, z in zip(mx, my, mz):
for x, y, z in zip(mx, my, mz, strict=False):
d = np.sqrt((sim_gridx[0] - x)**2 + (y - sim_gridy[0])**2)
ax.plot([sim_gridx[0], x], [sim_gridy[0], y], '--')

Expand Down Expand Up @@ -160,7 +160,7 @@ def draw_circle(ax, x, y, r, m, label):
mx, my = obs_tree.data[indices[1]].T
mz = zp[indices[1]]

for x, y, z in zip(mx, my, mz):
for x, y, z in zip(mx, my, mz, strict=False):
d = np.sqrt((sim_gridx[1] - x)**2 + (y - sim_gridy[1])**2)
ax.plot([sim_gridx[1], x], [sim_gridy[1], y], '--')

Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,8 @@
fig = plt.figure(figsize=(15, 8))
add_metpy_logo(fig, 190, 85, size='large')

for var_data, var_range, ax_rect in zip((ref, rho), (ref_range, rho_range), spec):
for var_data, var_range, ax_rect in zip((ref, rho), (ref_range, rho_range), spec,
strict=False):
# Turn into an array, then mask
data = np.ma.array(var_data)
data[np.isnan(data)] = np.ma.masked
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified dev/_downloads/78b733bd37148dbb5ae99df3a7fabf14/QVector.zip
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified dev/_downloads/7ad5a62cb10cfd5d67f19e01218a8d48/Smoothing.zip
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
ctables = (('NWSStormClearReflectivity', -20, 0.5), # dBZ
('NWS8bitVel', -100, 1.0)) # m/s

for v, ctable, ax_rect in zip(('N0Q', 'N0U'), ctables, spec):
for v, ctable, ax_rect in zip(('N0Q', 'N0U'), ctables, spec, strict=False):
# Open the file
name = get_test_data(f'nids/KOUN_SDUS54_{v}TLX_201305202016', as_file_obj=False)
f = Level3File(name)
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified dev/_downloads/bacdb1a56b06049d5bfcf2fe02725944/Wind_Speed.zip
Binary file not shown.
Binary file modified dev/_downloads/bc82bea3a5dd7bdba60b65220891d9e5/examples_python.zip
Binary file not shown.
Binary file not shown.
Binary file modified dev/_downloads/c3ed37a5ecf3e5a9c07a95643273f96d/Gradient.zip
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@
},
"outputs": [],
"source": [
"spec = gridspec.GridSpec(1, 2)\nfig = plt.figure(figsize=(15, 8))\nadd_metpy_logo(fig, 190, 85, size='large')\n\nfor var_data, var_range, ax_rect in zip((ref, rho), (ref_range, rho_range), spec):\n # Turn into an array, then mask\n data = np.ma.array(var_data)\n data[np.isnan(data)] = np.ma.masked\n\n # Convert az,range to x,y\n xlocs, ylocs = azimuth_range_to_lat_lon(az, var_range, cent_lon, cent_lat)\n\n # Plot the data\n crs = ccrs.LambertConformal(central_longitude=cent_lon, central_latitude=cent_lat)\n ax = fig.add_subplot(ax_rect, projection=crs)\n ax.add_feature(USCOUNTIES, linewidth=0.5)\n ax.pcolormesh(xlocs, ylocs, data, cmap='viridis', transform=ccrs.PlateCarree())\n ax.set_extent([cent_lon - 0.5, cent_lon + 0.5, cent_lat - 0.5, cent_lat + 0.5])\n ax.set_aspect('equal', 'datalim')\n add_timestamp(ax, f.dt, y=0.02, high_contrast=True)\n\nplt.show()"
"spec = gridspec.GridSpec(1, 2)\nfig = plt.figure(figsize=(15, 8))\nadd_metpy_logo(fig, 190, 85, size='large')\n\nfor var_data, var_range, ax_rect in zip((ref, rho), (ref_range, rho_range), spec,\n strict=False):\n # Turn into an array, then mask\n data = np.ma.array(var_data)\n data[np.isnan(data)] = np.ma.masked\n\n # Convert az,range to x,y\n xlocs, ylocs = azimuth_range_to_lat_lon(az, var_range, cent_lon, cent_lat)\n\n # Plot the data\n crs = ccrs.LambertConformal(central_longitude=cent_lon, central_latitude=cent_lat)\n ax = fig.add_subplot(ax_rect, projection=crs)\n ax.add_feature(USCOUNTIES, linewidth=0.5)\n ax.pcolormesh(xlocs, ylocs, data, cmap='viridis', transform=ccrs.PlateCarree())\n ax.set_extent([cent_lon - 0.5, cent_lon + 0.5, cent_lat - 0.5, cent_lat + 0.5])\n ax.set_aspect('equal', 'datalim')\n add_timestamp(ax, f.dt, y=0.02, high_contrast=True)\n\nplt.show()"
]
}
],
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
},
"outputs": [],
"source": [
"proj = ccrs.LambertConformal(central_longitude=-85.0, central_latitude=45.0)\n\nfig = plt.figure(figsize=(12, 9))\nax1 = fig.add_subplot(1, 3, 1, projection=proj)\nax2 = fig.add_subplot(1, 3, 2, projection=proj)\nax3 = fig.add_subplot(1, 3, 3, projection=proj)\n\nfor scale, axis in zip(['20m', '5m', '500k'], [ax1, ax2, ax3]):\n axis.set_extent([270.25, 270.9, 38.15, 38.75], ccrs.Geodetic())\n axis.add_feature(USCOUNTIES.with_scale(scale))"
"proj = ccrs.LambertConformal(central_longitude=-85.0, central_latitude=45.0)\n\nfig = plt.figure(figsize=(12, 9))\nax1 = fig.add_subplot(1, 3, 1, projection=proj)\nax2 = fig.add_subplot(1, 3, 2, projection=proj)\nax3 = fig.add_subplot(1, 3, 3, projection=proj)\n\nfor scale, axis in zip(['20m', '5m', '500k'], [ax1, ax2, ax3], strict=False):\n axis.set_extent([270.25, 270.9, 38.15, 38.75], ccrs.Geodetic())\n axis.add_feature(USCOUNTIES.with_scale(scale))"
]
}
],
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,8 @@
ax.set_title('Triangulation of observations and test grid cell '
'natural neighbor interpolation values')

members, circumcenters = geometry.find_natural_neighbors(tri, list(zip(sim_gridx, sim_gridy)))
members, circumcenters = geometry.find_natural_neighbors(tri, list(zip(sim_gridx, sim_gridy,
strict=False)))

val = natural_neighbor_point(xp, yp, zp, (sim_gridx[0], sim_gridy[0]), tri, members[0],
circumcenters)
Expand Down Expand Up @@ -164,7 +165,7 @@ def draw_circle(ax, x, y, r, m, label):
# spatial data structure that we use here simply to show areal ratios.
# Notice that the two natural neighbor triangle circumcenters are also vertices
# in the Voronoi plot (green dots), and the observations are in the polygons (blue dots).
vort = Voronoi(list(zip(xp, yp)))
vort = Voronoi(list(zip(xp, yp, strict=False)))

fig, ax = plt.subplots(1, 1, figsize=(15, 10))
ax.ishold = lambda: True # Work-around for Matplotlib 3.0.0 incompatibility
Expand All @@ -175,7 +176,7 @@ def draw_circle(ax, x, y, r, m, label):
x_0 = xp[nn_ind]
y_0 = yp[nn_ind]

for x, y, z in zip(x_0, y_0, z_0):
for x, y, z in zip(x_0, y_0, z_0, strict=False):
ax.annotate(f'{x}, {y}: {z:.3f} F', xy=(x, y))

ax.plot(sim_gridx[0], sim_gridy[0], 'k+', markersize=10)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
},
"outputs": [],
"source": [
"def plot_bulletin(ax, data):\n \"\"\"Plot a dataframe of surface features on a map.\"\"\"\n # Set some default visual styling\n size = 4\n fontsize = 9\n complete_style = {'HIGH': {'color': 'blue', 'fontsize': fontsize},\n 'LOW': {'color': 'red', 'fontsize': fontsize},\n 'WARM': {'linewidth': 1, 'path_effects': [WarmFront(size=size)]},\n 'COLD': {'linewidth': 1, 'path_effects': [ColdFront(size=size)]},\n 'OCFNT': {'linewidth': 1, 'path_effects': [OccludedFront(size=size)]},\n 'STNRY': {'linewidth': 1, 'path_effects': [StationaryFront(size=size)]},\n 'TROF': {'linewidth': 2, 'linestyle': 'dashed',\n 'edgecolor': 'darkorange'}}\n\n # Handle H/L points using MetPy's StationPlot class\n for field in ('HIGH', 'LOW'):\n rows = data[data.feature == field]\n x, y = zip(*((pt.x, pt.y) for pt in rows.geometry))\n sp = StationPlot(ax, x, y, transform=ccrs.PlateCarree(), clip_on=True)\n sp.plot_text('C', [field[0]] * len(x), **complete_style[field])\n sp.plot_parameter('S', rows.strength, **complete_style[field])\n\n # Handle all the boundary types\n for field in ('WARM', 'COLD', 'STNRY', 'OCFNT', 'TROF'):\n rows = data[data.feature == field]\n ax.add_geometries(rows.geometry, crs=ccrs.PlateCarree(), **complete_style[field],\n facecolor='none')"
"def plot_bulletin(ax, data):\n \"\"\"Plot a dataframe of surface features on a map.\"\"\"\n # Set some default visual styling\n size = 4\n fontsize = 9\n complete_style = {'HIGH': {'color': 'blue', 'fontsize': fontsize},\n 'LOW': {'color': 'red', 'fontsize': fontsize},\n 'WARM': {'linewidth': 1, 'path_effects': [WarmFront(size=size)]},\n 'COLD': {'linewidth': 1, 'path_effects': [ColdFront(size=size)]},\n 'OCFNT': {'linewidth': 1, 'path_effects': [OccludedFront(size=size)]},\n 'STNRY': {'linewidth': 1, 'path_effects': [StationaryFront(size=size)]},\n 'TROF': {'linewidth': 2, 'linestyle': 'dashed',\n 'edgecolor': 'darkorange'}}\n\n # Handle H/L points using MetPy's StationPlot class\n for field in ('HIGH', 'LOW'):\n rows = data[data.feature == field]\n x, y = zip(*((pt.x, pt.y) for pt in rows.geometry), strict=False)\n sp = StationPlot(ax, x, y, transform=ccrs.PlateCarree(), clip_on=True)\n sp.plot_text('C', [field[0]] * len(x), **complete_style[field])\n sp.plot_parameter('S', rows.strength, **complete_style[field])\n\n # Handle all the boundary types\n for field in ('WARM', 'COLD', 'STNRY', 'OCFNT', 'TROF'):\n rows = data[data.feature == field]\n ax.add_geometries(rows.geometry, crs=ccrs.PlateCarree(), **complete_style[field],\n facecolor='none')"
]
},
{
Expand Down
Binary file modified dev/_downloads/d7027451c04b467ccd181464c81c91de/Advection.zip
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def plot_bulletin(ax, data):
# Handle H/L points using MetPy's StationPlot class
for field in ('HIGH', 'LOW'):
rows = data[data.feature == field]
x, y = zip(*((pt.x, pt.y) for pt in rows.geometry))
x, y = zip(*((pt.x, pt.y) for pt in rows.geometry), strict=False)
sp = StationPlot(ax, x, y, transform=ccrs.PlateCarree(), clip_on=True)
sp.plot_text('C', [field[0]] * len(x), **complete_style[field])
sp.plot_parameter('S', rows.strength, **complete_style[field])
Expand Down
Binary file not shown.
Binary file modified dev/_downloads/e50a0b920fc44505e926eaeef27dacd5/US_Counties.zip
Binary file not shown.
Loading

0 comments on commit 1447246

Please sign in to comment.