


This tutorial describes several tricks for making fancy maps, but right now let's just use the imagesc function to check out the grid orientation. Here's how to load time with ncdateread: t = ncdateread( 'ERA_Interim_2017.nc', 'time') It works just like ncread, but automatically converts time arrays to datetime format (read more about time formats here). The easiest way to read time arrays from NetCDF files is to use the CDT function ncdateread. Lon = ncread( 'ERA_Interim_2017.nc', 'longitude') Let's look at the air temperature taken at 2 m ( 't2m'), and get its corresponding geographic coordinates: lat = ncread( 'ERA_Interim_2017.nc', 'latitude') Now that we know the names of the variables in ERA_Interim_2017.nc, we can load the ones that interest us.

We don't need to pay attention to those values because Matlab's ncread function automatically does the scaling and offsetting, but in case you're curious, those values are what the algorithm uses to pack (and unpack) the data efficiently into NetCDF format. Some variables include a scale_factor, add_offset, and _FillValue. And it's no coincidence that the other variables are 480x241x12: these dimensions correspond to longitude, latitude, and time. The longitude variable is 480x1, latitude is 241x1, and time is 12x1.

That's usually a first clue into how the data matrices are organized. Most imporantly, it tells us the names of the variable in the NetCDF file, and also includes notes about the units of each variable. The output of ncdisp tells us everything we need to know. home/chad/Documents/MATLAB/github/cdt/cdt_data/ERA_Interim_2017.nc To do that, use ncdisp like this: ncdisp 'ERA_Interim_2017.nc' Source: The first step in loading NetCDF data is figuring out what variable names are in the file. Consider creating a folder just for data, and add that folder to Matlab's search path via addpath. The default filenames for data downloaded from ECMWF are often long and cryptic, so for this tutorial I renamed it ERA_Interim_2017.nc.Īfter downloading the data, put it either in your current folder or somewhere else Matlab can find it.Wait about 15 minutes for the data to be ready and download it.Select NetCDF data format and download at the default 0.75x0.75 degree resolution.Select times 00:00:00, 12 step, and the fields 2 m temperature, 10 m U and V wind components, surface pressure, and total precipitation.Login to the ECMWF website and found ERA-Interim Synoptic Monthly Means.
