Warning, /utils/matlab/Graphix/GraphixSliceGradsData.m is written in an unsupported language. File is not indexed.
view on githubraw file Latest commit c578fd6b on 2005-10-20 18:14:57 UTC
5bbd0d07c9 Dani*0001 function [data,xax,yax,pltslc] = ...
c578fd6b1e Dani*0002 GraphixSliceGradsData(fln,flu,slc,data,xaxin,yaxin,zaxin);
5bbd0d07c9 Dani*0003
c578fd6b1e Dani*0004 % Function: GraphixSliceGradsData
5bbd0d07c9 Dani*0005 % Author: Daniel Enderton
0006 %
0007 % Input Fields:
0008 %
0009 % Field Type (Brief) Description
0010 % -----------------------------------------------------------------------
0011 % slc string Slice type ('Zon','k=#',...)
0012 %
0013 % Output Fields:
0014 %
0015 % Field Type (Brief) Description
0016 % -----------------------------------------------------------------------
0017 % data array Sliced data.
0018
c578fd6b1e Dani*0019 GraphixFieldParamA;
0020 GraphixFieldParamO;
0021 GraphixFieldParamC;
0022 GraphixFieldParamI;
5bbd0d07c9 Dani*0023
0024 if isequal(slc,'Sur')
0025 data = data';
0026 xax = xaxin;
0027 yax = yaxin;
0028 pltslc='lonlat';
0029
0030 elseif isequal(slc,'Zon')
0031 data = squeeze(mean(data,1))';
0032 xax=yaxin;
0033 if isequal(length(zaxin),1)
0034 yax=NaN;
0035 pltslc='latfld';
0036 else
0037 yax=zaxin;
0038 pltslc='lathgt';
0039 end
0040
0041 elseif isequal(slc(1:2),'i=')
0042 ii = str2num(slc(3:end));
0043 data=squeeze(data(ii,:,:,:));
0044 xax=yaxin;
0045 if isequal(length(zaxin),1)
0046 yax=NaN;
0047 pltslc='latfld';
0048 else
0049 yax=ZC;
0050 pltslc='lathgt';
0051 end
0052
0053 elseif isequal(slc(1:2),'j=')
0054 jj = str2num(slc(3:end));
0055 data = squeeze(data(:,jj,:,:));
0056 if isequal(length(zaxin),1)
0057 yax=NaN;
0058 pltslc='lonfld';
0059 else
0060 yax=ZC;
0061 pltslc='lonhgt';
0062 end
0063
0064 elseif isequal(slc(1:2),'k=')
0065 kk = str2num(slc(3:end));
0066 data = squeeze(data(:,:,kk,:))';
0067 xax = xaxin;
0068 yax = yaxin;
0069 pltslc='lonlat';
0070
0071 else
0072 error(['Unrecognized SliceType: ',slc]);
0073 end
0074
0075
0076 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0077 % Check range %
0078 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0079
0080 % Load fixed and data ranges, throw a warning is data out of range.
0081 datarange = [min(data(:)),max(data(:))];
0082 try
0083 eval(['fixedrange = ',fln,'range',flu,';']);
0084 if datarange(1) < fixedrange(1) | ...
0085 datarange(2) > fixedrange(2)
0086 disp(['***Warning*** Value out of range for ',fln]);
0087 disp([' Data range: ',mat2str(datarange)]);
0088 disp([' Fixed range: ',mat2str(fixedrange)]);
0089 end
0090 catch
0091 disp(['***Warning*** No range information found for ',fln]);
0092 disp([' Data range: ',mat2str(datarange)]);
0093 end