<jupyter_start><jupyter_text>Data reading Front<jupyter_code>f = alborexdata.Front()
f.get_from_file(alborexpaths.frontfile)
f.smooth()<jupyter_output><empty_output><jupyter_text>ADCP<jupyter_code>adcp = alborexdata.Adcp()
adcp.get_from_netcdf(alborexpaths.adcpfile)
adcp.apply_qc(qf=1)
adcp.get_norm()<jupyter_output>/home/ctroupin/Publis/AlborEx-Data-Python/python/alborexdata.py:846: RuntimeWarning: invalid value encountered in sqrt
  """<jupyter_text>Figures Projection<jupyter_code>m = Basemap(projection='merc', llcrnrlon=coordinates2[0], llcrnrlat=coordinates2[2],
            urcrnrlon=coordinates2[1], urcrnrlat=coordinates2[3],
            lat_ts=0.5 * (coordinates2[2] + coordinates2[3]), resolution='h')<jupyter_output><empty_output><jupyter_text>Quiver plot all depthsPlot the velocity fields with arrows.     The arrow lengths are all the same but the color change, so the visualisation of both the direction and the intensity is easier. No quiver key is needed.<jupyter_code>for idepth, depth in enumerate(adcp.depth[0:1]):
    
    figname = "ADCP_{}".format(str(idepth).zfill(4))
    plt.figure(figsize=(10, 10))
    ax = plt.subplot(221)
    adcp.plot_adcp_quiver(m, depthindex=idepth, depth=depth, 
                          datemax=datetime.datetime(2014, 5, 28, 0, 0, 0))
    
    m.drawparallels(np.arange(36.5, coordinates2[3], 0.25), labels=[1, 0, 0, 0],
                   fontname='Times New Roman', fontsize=14,
                   linewidth=0.2, zorder=1, color=".6")
    m.drawmeridians(np.arange(-1, coordinates2[1], 0.25), labels=[0, 0, 0, 1],
                   fontname='Times New Roman', fontsize=14,
                    linewidth=0.2, zorder=1, color=".6")
    
    ax = plt.subplot(222)
    adcp.plot_adcp_quiver(m, depthindex=idepth, depth=depth, 
                          datemin=datetime.datetime(2014, 5, 28))
    
    m.drawmeridians(np.arange(-1, coordinates2[1], 0.25), labels=[0, 0, 0, 1],
                   fontname='Times New Roman', fontsize=14,
                    linewidth=0.2, zorder=1, color=".6")
    #plt.savefig(os.path.join(figdir, figname), dpi=300, bbox_inches='tight')
    plt.show()
    plt.close()<jupyter_output><empty_output><jupyter_text>Plot selected sectionsRed dots to help delimit sections<jupyter_code>fig = plt.figure(figsize=(8, 8))
ax = plt.subplot(111)

count = 0
for lon, lat in zip(adcp.lon[::100], adcp.lat[::100]):
    if lon <= coordinates2[1] and lon >= coordinates2[0] and lat <= coordinates2[3]:
        m.plot(lon, lat, "ro", markersize=7, latlon=True)
        llon, llat = m(lon, lat)
        plt.text(llon, llat, " " + str(count), ha="left")
    count += 100
    
NN1, NN2 = 1462, 1600
adcp.add_rectangle(NN1, NN2, m, label="1")

llon, llat = m(adcp.lon[NN1:NN2], adcp.lat[NN1:NN2])
m.plot(adcp.lon, adcp.lat, "k--", lw=.2, latlon=True)
plt.quiver(llon, llat, adcp.u[NN1:NN2,0], adcp.v[NN1:NN2,0], headwidth=1)
m.plot(f.lon, f.lat, "k--", linewidth=2, latlon=True)
m.drawparallels(np.arange(36.5, coordinates2[3], 0.05), labels=[1, 0, 0, 0],
                   fontname='Times New Roman', fontsize=14, 
                   linewidth=0.2, zorder=1, color=".6")
m.drawmeridians(np.arange(-1, coordinates2[1], 0.1), labels=[0, 0, 0, 1],
               fontname='Times New Roman', fontsize=14,
                linewidth=0.2, zorder=1, color=".6")
plt.show()
plt.close()<jupyter_output><empty_output><jupyter_text>Combined plotQuiver plot and 2 north-south sections<jupyter_code>figname = "fig11"
fig = plt.figure(figsize=(15, 10))
ax1 = plt.subplot2grid((2,2), (0,0), rowspan=2)

adcp.plot_adcp_quiver(m, depthindex=3, depth=40)
NN1, NN2 = 900, 1070
adcp.add_rectangle(NN1, NN2, m, label="S1")
NN1, NN2 = 1462, 1600
adcp.add_rectangle(NN1, NN2, m, label="S2")

m.drawparallels(np.arange(36.5, coordinates2[3], 0.25), labels=[1, 0, 0, 0],
               fontname='Times New Roman', fontsize=14,
               linewidth=0.2, zorder=1, color=".6")
m.drawmeridians(np.arange(-1, coordinates2[1], 0.25), labels=[0, 0, 0, 1],
               fontname='Times New Roman', fontsize=14,
                linewidth=0.2, zorder=1, color=".6")
m.plot(f.lon, f.lat, "k--", linewidth=2, latlon=True)

ax2 = plt.subplot2grid((2,2), (0,1))
NN1, NN2 = 900, 1070
adcp.make_velocity_section(adcp.lat[NN2:NN1:-1], adcp.depth, 
                      adcp.u[NN2:NN1:-1,:].T, frontlat=36.985,
                      title="S1 $-$ Zonal velocity (26 May)")

ax3 = plt.subplot2grid((2,2), (1,1))
NN1, NN2 = 1462, 1600
# 1640, 1780
adcp.make_velocity_section(adcp.lat[NN2:NN1:-1], adcp.depth, 
                      adcp.u[NN2:NN1:-1,:].T, frontlat=36.92,
                      xlabel="Longitude", title="S2 $-$ Zonal velocity (27 May)")

plt.savefig(os.path.join(alborexpaths.figdir, figname), dpi=300, bbox_inches='tight')
plt.show()
plt.close()<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.1673224270035204, 'fraction_numerical': 0.06792296541727065, 'mean_word_length': 3.591254752851711, 'pattern_counts': {'":': 0, '<': 26, '<?xml version=': 0, '>': 25, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '6', 'dir': 'jupyter-structured-clean-dedup', 'id': '342688', 'license': 'MIT', 'n_tokens_mistral': 2103, 'n_tokens_neox': 1900, 'n_words': 345, 'path': 'python/figure8_ADCP.ipynb', 'repo_name': 'ctroupin/AlborEx-Data', 'size': '4829'}