import numpy as np import xarray as xr import matplotlib as mpl mpl.use('Agg') # Must be before importing matplotlib.pyplot or pylab! import matplotlib.pyplot as plt import pandas as pd import os #import seaborn as sns import timeit start_time = timeit.default_timer() #%% read in the data data = 'v20210329/OUTPUT/ches_scratch2_av_3d.000.nc' ds = xr.open_dataset(data) print((ds.time/1E9)/60) """ check = ds[['uu','vv','ww','u','v','w']] check = check.sel(zu_3d = (102,306,702,1002)) #select horizontal wind fields check = check.sel(zw_3d = (108,300,708,1008)) #select vertical wind fields print(check) check.to_netcdf('check.nc') ds.close() check.close() elapsed = timeit.default_timer() - start_time print('Time elapsed ',elapsed, 'seconds') """