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 = 'DATA_3D_AV_NETCDF_N02' ds = xr.open_dataset(data) print(ds.s) ''' 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') '''