Skip to content
Snippets Groups Projects
Commit 23cfb7d3 authored by Lionel GUEZ's avatar Lionel GUEZ
Browse files

Finish the `with` statement earlier

parent 18c50ed5
No related branches found
No related tags found
No related merge requests found
......@@ -63,22 +63,22 @@ with netCDF4.Dataset(args.input_file) as f:
ugos = f["ugos"][:]
vgos = f["vgos"][:]
if args.undefined:
undef_velocity = np.logical_or(ugos.mask, vgos.mask)
lon_2d, lat_2d = np.meshgrid(longitude[lon_mask],
latitude[lat_mask])
ax.plot(lon_2d[undef_velocity].reshape(-1),
lat_2d[undef_velocity].reshape(-1), transform = src_crs,
marker = "*", color = "violet", linestyle = "None")
else:
quiver_return = wind_cartopy.plot(ax, longitude[lon_mask],
latitude[lat_mask],
ugos[lat_mask][:, lon_mask],
vgos[lat_mask][:, lon_mask],
scale = args.scale,
scale_units = "width")
ax.quiverkey(quiver_return, 0.9, 0.9, 1, r"1 m s$^{-1}$",
coordinates = "figure")
if args.undefined:
undef_velocity = np.logical_or(ugos.mask, vgos.mask)
lon_2d, lat_2d = np.meshgrid(longitude[lon_mask],
latitude[lat_mask])
ax.plot(lon_2d[undef_velocity].reshape(-1),
lat_2d[undef_velocity].reshape(-1), transform = src_crs,
marker = "*", color = "violet", linestyle = "None")
else:
quiver_return = wind_cartopy.plot(ax, longitude[lon_mask],
latitude[lat_mask],
ugos[lat_mask][:, lon_mask],
vgos[lat_mask][:, lon_mask],
scale = args.scale,
scale_units = "width")
ax.quiverkey(quiver_return, 0.9, 0.9, 1, r"1 m s$^{-1}$",
coordinates = "figure")
ax.gridlines(draw_labels = True)
ax.coastlines()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment