function [H]= plotELCOMsheet(data,varname,tslice); % function [H]= plotELCOMsheet(data,varname,tslice) % % funcion to plot ELCOM elcom sheet output % plots % % Inputs: % data : struct array of data from nldnc % variable : name of variable to plot eg: "SALINITY" % tslice : time slice to plot % % Outputs % H : plot handle % % Uses: % CWRdate2matlab.m % % Written by C. Dallimore 27 July 04 % % Script for plotting ELCOM sheet outputs % % Written by C Dallimore 2/8/04 % % Setup units of various input types variable_mat = setELCOMioTypes; if nargin == 3 elseif nargin == 2 tslice = 1; else error('Incorrrect number of input arguments!') end; % Get number of dimensions of variable eval (['ndim = ndims(data.',varname,');']); % Get data to plot if (ndim == 2) eval (['pltdata = data.',varname,';']); elseif (ndim == 3) eval (['pltdata = squeeze(data.',varname,'(tslice,:,:));']); else error('plotELCOMsheet only plots variables with 2 or 3 dimensions') end % Get size of 1st x and y grid for pcolor_CD pts = find (~isnan(data.DX(:,1))); if ~isempty(pts) dx1= data.DX(pts(1),1); else dx1= data.X(2)-data.X(1); end pts = find (~isnan(data.DY(1,:))); if ~isempty(pts) dy1= data.DY(1,pts(1)); else dy1= data.Y(2)-data.Y(1); end % plot data [H] = pcolor_CD(data.Y/1000,data.X/1000,pltdata',dy1/1000,dx1/1000); set(gca,'ydir','reverse','layer','top') axis equal xlabel('X (km)'); ylabel ('Y (km)')