<jupyter_start><jupyter_text>Reading .mat filesAn initial attempt to load the files into Python<jupyter_code>%matplotlib inline
import matplotlib.pyplot as plt
import numpy as np
import modred as mr
import pandas as pd
1+1
import h5py
f = h5py.File('/Users/Owen/Dropbox/Data/ABL/Heat Flux Data/Processed Results/N/Neutral45_2.mat')
list(f.keys())
swirl = np.asarray(f['Swirl'])
X  = np.asarray(f['X'])
Y  = np.asarray(f['Y'])
U  = np.asarray(f['U'])
V  = np.asarray(f['V'])<jupyter_output><empty_output><jupyter_text>Import all data in different structures<jupyter_code>k = f["Cond"].keys()
d= f["Cond"]["delta"]
list(k)
d.value
L  = [i**2 for i in range(10)]       #list comprehensions  (also look up generator expressions)
L
D = {1:2, 'abc':4}        #Defining a dictionary object
D['abc']
D['Cf']
k = f["Cond"].keys()     #Longer way to generate a pandas Series with all the values in Cond

Cond = pd.Series()
for i in list(k):
    #d = f["Cond"][i].value[0]
    #print(i, " = ", f["Cond"][i].value[0])
    s1 = pd.Series(f["Cond"][i].value[0], index = [i])
    Cond = Cond.append(s1)
Cond['Uinf']
Cond = {k : f["Cond"][k].value[0]       #Generate a dictionary linking all values in cond with their names
     for k in f['Cond'].keys()}
Cond['Uinf']      #look up in pandas or dictionary object is the same 
k = f["Prof"].keys()                 #Once again long way to generate pandas object with all profiles
Prof = pd.Series()
for i in list(k):
    d = f["Prof"][i].value
    #print(i, " = " , f["Prof"][i].value)
    s1 = pd.Series(f["Prof"][i].value, index = [i])
    Prof = Prof.append(s1)
Prof = {k : f["Prof"][k].value       #Generate a dictionary linking all values in cond with their names
     for k in f['Prof'].keys()}
Prof = pd.Series({k : f["Prof"][k].value       #Generate a pandas series from the dictionary
     for k in f['Prof'].keys()})
Prof['U']<jupyter_output><empty_output><jupyter_text>Now start looking at the data<jupyter_code>for i in range(1):
    plt.figure()
    plt.imshow(swirl[i].T, cmap='RdBu', origin='lower');
    plt.clim([-50, 50])
for i in range(1):
    plt.figure()
    plt.pcolor(X.T,Y.T,swirl[i].T, cmap='RdBu');
    plt.clim([-50, 50])
    plt.axis('equal')
    plt.axis([0, X.max(), 0, Y.max()])
    #plt.yaxis([0, Y.max()])
Y.max()
num_modes = 50;
modes, eig_vals = mr.compute_POD_matrices_snaps_method(U, list(range(num_modes)))
a = U.shape<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.18106655642827615, 'fraction_numerical': 0.014882182720132286, 'mean_word_length': 3.948875255623722, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, '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': '3', 'dir': 'jupyter-structured-clean-dedup', 'id': '646159', 'license': 'MIT', 'n_tokens_mistral': 956, 'n_tokens_neox': 924, 'n_words': 242, 'path': 'ASIIT-data.ipynb', 'repo_name': 'Mopolino8/ASIIT', 'size': '2419'}