% This example script was written by Craig Risien and was tested using % 7.0.1.24704 (R14) Service Pack 1. clear all close all % The commented code below assumes that you have installed the CSIRO % interface for the reading of netCDF files, which is available free of charge from % http://www.marine.csiro.au/sw/matlab-netcdf.html, and that you have % downloaded nh10_jul_oct_2006_tcs.nc to a local directory. % % nh10_1min_time = getnc('nh10_jul_oct_2006_tcs.nc','nh10_1min_time'); % nh10_73m_time = getnc('nh10_jul_oct_2006_tcs.nc','nh10_73m_time'); % % air_temper_1min = getnc('nh10_jul_oct_2006_tcs.nc','air_temper_1min'); % % nh10_1min_conductivity = getnc('nh10_jul_oct_2006_tcs.nc','nh10_1min_conductivity'); % nh10_1min_salinity = getnc('nh10_jul_oct_2006_tcs.nc','nh10_1min_salinity'); % nh10_1min_sigma_theta = getnc('nh10_jul_oct_2006_tcs.nc','nh10_1min_sigma_theta'); % nh10_1min_temper = getnc('nh10_jul_oct_2006_tcs.nc','nh10_1min_temper'); % % nh10_73m_conductivity = getnc('nh10_jul_oct_2006_tcs.nc','nh10_73m_conductivity'); % nh10_73m_salinity = getnc('nh10_jul_oct_2006_tcs.nc','nh10_73m_salinity'); % nh10_73m_sigma_theta = getnc('nh10_jul_oct_2006_tcs.nc','nh10_73m_sigma_theta'); % nh10_73m_temper = getnc('nh10_jul_oct_2006_tcs.nc','nh10_73m_temper'); % % depth = getnc('nh10_jul_oct_2006_tcs.nc','depth'); % salt_depth = getnc('nh10_jul_oct_2006_tcs.nc','salt_depth'); % The Matlab structs tool "loaddap" provides a way to read any OPeNDAP-accessible % data into Matlab. This tool is available for download at % http://www.opendap.org/download/ml-structs.html loaddap('http://agate.coas.oregonstate.edu/cgi-bin/nph-dods.cgi/archive_data/NH10/opendap/nh10_jul_oct_2006_tcs.nc'); nh10_1min_conductivity = getfield(nh10_1min_conductivity,'nh10_1min_conductivity'); nh10_1min_salinity = getfield(nh10_1min_salinity,'nh10_1min_salinity'); nh10_1min_sigma_theta = getfield(nh10_1min_sigma_theta,'nh10_1min_sigma_theta'); nh10_1min_temper = getfield(nh10_1min_temper,'nh10_1min_temper'); nh10_73m_conductivity = getfield(nh10_73m_conductivity,'nh10_73m_conductivity'); nh10_73m_salinity = getfield(nh10_73m_salinity,'nh10_73m_salinity'); nh10_73m_sigma_theta = getfield(nh10_73m_sigma_theta,'nh10_73m_sigma_theta'); nh10_73m_temper = getfield(nh10_73m_temper,'nh10_73m_temper'); air_temper_1min = getfield(air_temper_1min,'air_temper_1min'); %The following 2 lines will convert time from decimal days to a yyyy-mm-dd HH:MM:SS format. date_1min = datestr(datenum(2005,12,31)+nh10_1min_time,31); date_73m = datestr(datenum(2005,12,31)+nh10_73m_time,31); clf subplot(2,1,1) pcolor(nh10_1min_time,depth,nh10_1min_temper') shading flat title('NH10 Temperature (July - October 2006)') xlabel('decimal day (GMT)') ylabel('depth (m)') set(gca,'yTick',depth,'yTicklabel',depth,'FontSize',10); caxis([7.9 15.1]) [h] = colorbar('hori'); set(h,'yTick',[8:1:15],'yTicklabel',[8:1:15],'FontSize',10,'position',[.142 0.49 .75 .025]); text(244.5,-27,'degrees C','FontSize',10); orient landscape print -dpng -r300 jul_oct_06_temp