0001 function [data isongrid]=processdata(md,data,options_structure);
0002
0003
0004
0005
0006
0007
0008
0009
0010 if length(data)~=md.numberofgrids & length(data)~=md.numberofelements & length(data)~=md.numberofgrids*6
0011 error('plotmodel error message: data not supproted yet')
0012 end
0013
0014
0015 if length(data)==6*md.numberofgrids
0016
0017 data1=data(1:6:md.numberofgrids*6);
0018 data2=data(2:6:md.numberofgrids*6);
0019 data=sqrt(data1.^2+data2.^2);
0020
0021 end
0022
0023
0024 if ~isnan(options_structure.smooth)
0025 data=averaging(md,data,options_structure.smooth);
0026
0027 end
0028
0029
0030 if length(data)==md.numberofelements;
0031 isongrid=0;
0032
0033
0034 if ~isnan(options_structure.noiceshelf) & options_structure.noiceshelf,
0035 data(find(md.elementoniceshelf))=NaN;
0036 end
0037
0038 if ~isnan(options_structure.noicesheet) & options_structure.noicesheet,
0039 data(find(~md.elementoniceshelf))=NaN;
0040 end
0041 end
0042
0043
0044 if length(data)==md.numberofgrids
0045 isongrid=1;
0046
0047 if ~isnan(options_structure.noiceshelf) & options_structure.noiceshelf,
0048 pos=find(md.gridoniceshelf);
0049 data(pos)=NaN;
0050 end
0051
0052 if ~isnan(options_structure.noiceshelf) & options_structure.noicesheet,
0053 pos=find(md.gridonicesheet);
0054 data(pos)=NaN;
0055 end
0056 end
0057
0058
0059 if ~isnan(options_structure.layer) & options_structure.layer>=1,
0060 data=project2d(md,data,options_structure.layer);
0061 end
0062
0063