<jupyter_start><jupyter_text>Finding vector<jupyter_code>for p in not_ice: 
    x=p[0]
    y=p[1]
    print(bathym.isel(x=x,y=y).values)
for p in ice_slope: 
    x=p[0]
    y=p[1]
    print(bathym.isel(x=x,y=y).values)
for p in ice_not_slope: 
    x=p[0]
    y=p[1]
    print(bathym.isel(x=x,y=y).values)
p_list = []
p_list = np.concatenate((not_ice,ice_slope,ice_not_slope))
p_list
#d_ = [30,30,20,30,35,30,25,10,30,20] 
maj_l = []
min_l = []
theta_l = []
vec_l = []

for i, m in enumerate([(870, 845)]):
    print(i)
    x = m[0]
    y = m[1]
    d = 35
    covm = np.cov(np.vstack([u.isel(x=x, y=y, depth=d).values,v.isel(x=x, y=y, depth=d).values]))
    print(covm)
    values_, vectors_ = np.linalg.eig(covm)
    order = values_.argsort()[::-1]
    values, vectors = values_[order], vectors_[:, order]
    #theta_l.append(theta_)
    vec_l.append(vectors)  
    print(vec_l)
    
print('--------')
print(maj_l)
print('--------')
print(min_l)
print('--------')
print(theta_l)
dypu = u.isel(x=x,y=y,depth=slice(0,d),time_counter=0)
print(dypu)   
# Model infrmation
len(data[pickl[1]]['EOF1p'][0:d])<jupyter_output><xarray.DataArray 'vozocrtx' (depth: 43)>
dask.array<getitem, shape=(43,), dtype=float32, chunksize=(43,), chunktype=numpy.ndarray>
Coordinates:
  * depth          (depth) float32 0.5058 1.556 2.668 ... 565.3 628.0 697.3
    nav_lat        float32 dask.array<chunksize=(), meta=np.ndarray>
    nav_lon        float32 dask.array<chunksize=(), meta=np.ndarray>
    time_centered  object dask.array<chunksize=(), meta=np.ndarray>
    time_counter   object 2000-01-03 12:00:00
Attributes:
    cell_methods:        time: mean (interval: 360 s)
    interval_operation:  360 s
    interval_write:      5 d
    long_name:           sea_water_x_velocity
    online_operation:    average
    standard_name:       sea_water_x_velocity
    units:               m/s<jupyter_text>Ice free<jupyter_code>warnings.simplefilter("ignore")
fig, axes = plt.subplots(1,3,figsize = (20,12))
#plt.suptitle('EOF1 & EOF1-rotated from model data, ice free regions', 
#             horizontalalignment='center',
#            fontsize=24)
axes[0].set_ylabel('Depth [m]', fontsize=14)
mooring=['Stad, Norway', 'South of Svalbard','South of Jan Mayen']

for axs, i in zip(axes.flat, [0,1,2]):
    print(i)
    x = moor_l[i][0]
    y = moor_l[i][1]
    d = bathym.isel(x=x,y=y).values-1
    dypu = u.isel(x=x,y=y,depth=slice(0,d),time_counter=0)
    print(dypu.shape)
    
    # Model infrmation
    PCAp1 = data[pickl[i]]['EOF1p'][:d]
    PCAo1 = data[pickl[i]]['EOF1o'][:d]
    var_  = data[pickl[i]]['tot_var'][:d]
    PVE1p = data[pickl[i]]['PVE1p']
    PVE1o = data[pickl[i]]['PVE1o']
    
    axs.plot(PCAp1,dypu.depth, label= f'EOF1$||$, PVE={PVE1p}%', color='darkgreen') #linestyle='--',
    axs.plot(PCAo1,dypu.depth, label= f'EOF1$\perp$, PVE={PVE1o}%', color='mediumseagreen')    
    #axs.plot(PC1u,dypu.depth, 'darkred', label = f'EOF1-u, PVE={PVE1u}%')
    #axs.plot(PC1v,dypu.depth, 'coral', label= f'EOF1-v, PVE={PVE1v}%')
    axs.plot(var_.T,dypu.depth, linestyle='-.', label= f'$\sigma^2$ model', color='g')
    axs.axvline(0, color='k', linestyle = '--')
    axs.legend(frameon=False, fontsize=10, loc="lower left") 
    axs.invert_yaxis()
    axs.set_xlabel('Current speed [m/s]', fontsize=14)
    axs.text(0.50, 0.97, f'{mooring[i]}', color='k', fontsize=14, transform=axs.transAxes, verticalalignment='bottom')
    
plt.savefig('EOFs_icefree_mod.pdf', dpi = 300)<jupyter_output>0
(45,)
1
(43,)
2
(48,)<jupyter_text>ice and sloe<jupyter_code>len(data['ice_slope_lofoten_basin']['EOF1p'])
len(data[pickl[4]]['tot_var'])
bathym
warnings.simplefilter("ignore")
fig, axes = plt.subplots(1,3,figsize = (22,12))
#plt.suptitle('EOF1 & EOF1-rotated from model data, ice rgions on the slope', 
#             horizontalalignment='center',
#            fontsize=24)
axes[0].set_ylabel('Depth [m]', fontsize=14)
mooring=['Northeast of Barents Sea', 'Laptev Sea','Canada Basin']

for axs, i in zip(axes.flat, [3,4,5]):
    print(i)
    x = moor_l[i][0]
    y = moor_l[i][1]
    print(x,y)
    d = bathym.isel(x=x,y=y).values-1
    dypu = u.isel(x=x,y=y,depth=slice(0,d),time_counter=0)
    print(dypu.shape)
    
    # Model infrmation
    PCAp1 = data[pickl[i]]['EOF1p'][:d]
    PCAo1 = data[pickl[i]]['EOF1o'][:d]
    var_  = data[pickl[i]]['tot_var'][:d]
    PVE1p = data[pickl[i]]['PVE1p']
    PVE1o = data[pickl[i]]['PVE1o']
    print(len(PCAp1))
    
    axs.plot(PCAp1,dypu.depth, label= f'EOF1$||$, PVE={PVE1p}%', color='darkgreen') #linestyle='--',
    axs.plot(PCAo1,dypu.depth, label= f'EOF1$\perp$, PVE={PVE1o}%', color='mediumseagreen')    
    #axs.plot(PC1u,dypu.depth, 'darkred', label = f'EOF1-u, PVE={PVE1u}%')
    #axs.plot(PC1v,dypu.depth, 'coral', label= f'EOF1-v, PVE={PVE1v}%')
    axs.plot(var_.T,dypu.depth, linestyle='-.', label= f'$\sigma^2$ model', color='g')
    axs.axvline(0, color='k', linestyle = '--')
    axs.legend(frameon=False, fontsize=10, loc="lower left") 
    axs.invert_yaxis()
    axs.set_xlabel('Current speed [m/s]', fontsize=14)
    axs.text(0.50, 0.97, f'{mooring[i-3]}', color='k', fontsize=14, transform=axs.transAxes, verticalalignment='bottom')
    
    
plt.savefig('EOFs_iceslope_mod.pdf', dpi = 300)<jupyter_output>3
870 600
(42,)
42
4
870 845
(48,)
48
5
475 525
(41,)
41<jupyter_text>ice and flat bottom<jupyter_code>warnings.simplefilter("ignore")
fig, axes = plt.subplots(1,2,figsize = (16,11))

axes[0].set_ylabel('Depth [m]', fontsize=14)
mooring=['Makarov Basin','Bering Sea']

for axs, i in zip(axes.flat, [6,7]):
    print(i)
    x = moor_l[i][0]
    y = moor_l[i][1]
    d = bathym.isel(x=x,y=y).values-1
    dypu = u.isel(x=x,y=y,depth=slice(0,d),time_counter=0)
    print(dypu.shape)
    
    # Model infrmation
    PCAp1 = data[pickl[i]]['EOF1p'][:d]
    PCAo1 = data[pickl[i]]['EOF1o'][:d]
    var_  = data[pickl[i]]['tot_var'][:d]
    PVE1p = data[pickl[i]]['PVE1p']
    PVE1o = data[pickl[i]]['PVE1o']
    
    axs.plot(PCAp1,dypu.depth, label= f'EOF1$||$, PVE={PVE1p}%', color='darkgreen') #linestyle='--',
    axs.plot(PCAo1,dypu.depth, label= f'EOF1$\perp$, PVE={PVE1o}%', color='mediumseagreen')    
    #axs.plot(PC1u,dypu.depth, 'darkred', label = f'EOF1-u, PVE={PVE1u}%')
    #axs.plot(PC1v,dypu.depth, 'coral', label= f'EOF1-v, PVE={PVE1v}%')
    axs.plot(var_.T,dypu.depth, linestyle='-.', label= f'$\sigma^2$ model', color='g')
    axs.axvline(0, color='k', linestyle = '--')
    axs.legend(frameon=False, fontsize=10, loc="lower left") 
    axs.invert_yaxis()
    axs.set_xlabel('Current speed [m/s]', fontsize=14)
    axs.text(0.70, 0.97, f'{mooring[i-6]}', color='k', fontsize=14, transform=axs.transAxes, verticalalignment='bottom')
    
plt.savefig('EOFs_iceflatt_mod.pdf', dpi = 300)<jupyter_output>6
(47,)
7
(29,)
{'fraction_non_alphanumeric': 0.2059169855755078, 'fraction_numerical': 0.04768913747424198, 'mean_word_length': 4.082273747195213, 'pattern_counts': {'":': 0, '<': 18, '<?xml version=': 0, '>': 18, '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': '4', 'dir': 'jupyter-structured-clean-dedup', 'id': '322068', 'license': 'MIT', 'n_tokens_mistral': 3256, 'n_tokens_neox': 3074, 'n_words': 457, 'path': 'Model_stations_ice.ipynb', 'repo_name': 'kaje2301/Master_2022', 'size': '6794'}