<jupyter_start><jupyter_text>Getting the SZZ from MOHID output<jupyter_code>import h5py
import numpy as np
import matplotlib.pyplot as plt
from salishsea_tools import utilities
%matplotlib inline
path = '/home/abhudia/viz_test/Lagrangian_SOGa_01dec17_MF0_1000m3_7days_const_w_unrotated.hdf5'
f = h5py.File(path)
vertical_z = f['Grid']['VerticalZ']
keys = []
for key in vertical_z.keys():
    keys.append(key)

number_steps = len(keys)

output = np.zeros([number_steps, 41])
output_avg = np.zeros([number_steps, 41])
bar = utilities.statusbar('Loading...', maxval = number_steps)
for i, key in bar(enumerate(keys)):
    array = np.asarray(vertical_z[key])
    output[i] = np.max(np.max(array, axis = 1), axis = 1)
fig = plt.figure(figsize = (10,10))
plt.subplot(1,2,1)
#plt.pcolormesh(output.T)
#plt.colorbar()
plt.plot(output)
plt.ylabel('Depth (m)')
plt.xlabel('Index of hour')
plt.title('All Layers')
plt.gca().invert_yaxis()
plt.subplot(1,2,2)
plt.plot(output[...,0:10])
plt.ylabel('Depth (m)')
plt.xlabel('Index of hour')
plt.title('Top 10 Layers')
plt.gca().invert_yaxis()
a[40].max() - a[35].max()
plt.pcolormesh(array[40].T)
plt.colorbar()
plt.title('surface layer')<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.17206982543640897, 'fraction_numerical': 0.03408146300914381, 'mean_word_length': 6.209580838323354, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '200486', 'license': 'Apache-2.0', 'n_tokens_mistral': 529, 'n_tokens_neox': 490, 'n_words': 90, 'path': 'MIDOSS/SZZ.ipynb', 'repo_name': 'MIDOSS/analysis-ashutosh', 'size': '1203'}