![matlab polytool matlab polytool](http://analyticpedia.com/wp-content/uploads/2012/04/matlab-codes-2.jpg)
Salinity(salinity=0)=NaN %Remove some bad points
Salinity = ncread(filename,'practical_salinity') Temperature(temperature=0)=NaN %Remove some bad points Temperature = ncread(filename,'sci_water_temp') Pressure = ncread(filename,'sci_water_pressure_dbar')
#MATLAB POLYTOOL CODE#
The following code retrieves time, pressure, temperature, and salinity for this glider.
#MATLAB POLYTOOL HOW TO#
For example, here’s how to grab the units for the time variable, which was the 2nd variable in the list for me.ĭisp(') įinally, ncread() can be used to grab the actual data for a specific variable. In addition, you can grab the attributes for a specific variable by specifying the variable’s name as the second parameter in ncreadatt(). If you’re interested in the temporal coverage included in the file, you can take a look at time_coverage_start, time_coverage_end (of course, you could also just look at the time variable). The following attributes contain details on the specific instrument used to collect the data: Manufacturer, ModelNumber, SerialNumber, and Description. The source attribute is typically a concatenation of the subsite, node, sensor, collection_method, and stream attributes, which you can also pull individually. Source = ncreadatt(filename,'/','source') %Get the data stream's name % Pull the source attribute to use as a plot title The function ncreadatt() can be used to grab a specific attribute’s value. We can also display a list of the Global Attributes in the file. The following example will load in the metadata, and then display a list of all of the variables contained in the data file. Ncinfo() will read all of the metadata contained in the file into a structured array, which you can then peruse in Matlab’s GUI or command line. Let’s specify a variable which points to the file, so we don’t have to type it out every time.įilename = 'deployment0004_CP05MOAS-G元87-03-CTDGVM000-recovered_host-ctdgv_m_glider_instrument_recovered_' NcML files can provide an easy way to point to aggregated data, when a large data request results in multiple data files, but they only contain internal pointers to other data files, which is why they do not work offline. ncml files, which will not work when downloaded. Also, if you are downloading data for use on your local machine, you can ignore. However, you most likely will not need them, since latitude and longitude data should already be incorporated into the data file. Note that when you request glider data, you will often receive GPS data files as part of the response. This bug was fixed in R2017a, and there is a workaround for earlier versions. If you plan on accessing the NetCDF files directly from the server with your Matlab script, rather than downloading them, please note that there is a bug in earlier versions of Matlab that prevents accessing datasets from OPeNDAP severs that use HTTPS, like the OOI Data Portal.