Preamble for stuff.
In :%matplotlib inline import matplotlib.pyplot as plt import numpy as np import h5py
This is my first notebook. I want to load a model run and do some $\zeta$ plots first. First read data,
In :dname = "runs/topoeddy/runew-03/" print(dname) fname = "".join([dname, "ocean_avg.nc"]) print(fname) file = h5py.File(fname,'r') zeta = file['zeta']
Out:<matplotlib.contour.QuadContourSet instance at 0x2e4e830>
Let's try and read a .mat file. Turns out MAT files are HDF5 in their latest avatar. But h5py doesn't seem to like it so falling back on scipy.io
In :watername = "".join([dname,"watermass.mat"]) print(watername) import scipy.io water = scipy.io.loadmat(watername) water = water["water"];
Since I'm having trouble reading in structures from MAT files let's try looking at the jet.
In :u = file['u'] ubg = u[1,:,:,:] ujet = u - ubg
Out:(19, 40, 212, 401)
In :import matplotlib.pyplot as plt import numpy as np x = np.random.randn(50) f,axarr = plt.subplots(2,2, sharex=True) plt.plot(x) plt.xticks(np.arange(20)*2,('sd','ds','sd'));