Created
March 28, 2017 22:57
-
-
Save m1t9/63d8557abd945fc6ac2ddf9d036b8d4d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from netCDF4 import Dataset as dt | |
import numpy as np | |
fileID = 'dat_3.nc' | |
ncfile = dt(fileID, 'r') | |
# print(ncfile.variables) | |
# np array -> int16 u10(time, latitude, longitude) | |
lat = np.array(ncfile.variables['latitude'][:], dtype=np.float32) # x | |
long = np.array(ncfile.variables['longitude'][:], dtype=np.float32) # y | |
time = np.array(ncfile.variables['time'][:], dtype=np.float32) | |
u10 = np.array(ncfile.variables['u10'][:, :, :], dtype=np.float32) | |
v10 = np.array(ncfile.variables['v10'][:, :, :], dtype=np.float32) | |
sp = np.array(ncfile.variables['sp'][:, :, :], dtype=np.float32) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment