Changeset 867 for trunk/src/proj_field.m
- Timestamp:
- Feb 12, 2015, 9:31:47 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/proj_field.m
r866 r867 666 666 667 667 %% identify vector components 668 testU=isfield(CellInfo{icell},'VarIndex_vector_x') &&isfield(CellInfo{icell},'VarIndex_vector_y') ;% test for vectors668 %testU=isfield(CellInfo{icell},'VarIndex_vector_x') &&isfield(CellInfo{icell},'VarIndex_vector_y') ;% test for vectors 669 669 % if testU 670 670 % UName=FieldData.ListVarName{CellInfo{icell}.VarIndex_vector_x}; … … 700 700 return 701 701 end 702 ProjData.ListVarName=[ProjData.ListVarName {FieldData.ListVarName{CellInfo{icell}.CoordIndex(end)}}];703 ProjData.VarDimName=[ProjData.VarDimName {FieldData.ListVarName{CellInfo{icell}.CoordIndex(end-1)}}];702 ProjData.ListVarName=[ProjData.ListVarName FieldData.ListVarName(CellInfo{icell}.CoordIndex(end))]; 703 ProjData.VarDimName=[ProjData.VarDimName FieldData.ListVarName(CellInfo{icell}.CoordIndex(end))]; 704 704 nbvar=numel(ProjData.ListVarName); 705 705 ProjData.VarAttribute{nbvar}.long_name='abscissa along line'; … … 717 717 ProjData.(FieldData.ListVarName{CellInfo{icell}.CoordIndex(end)})=Xproj; 718 718 for ivar=1:numel(VarIndex) 719 ProjData.(VarName{ivar})=FieldData.(VarName{ivar})(flagsel);% restrict v rtibles to the projection band719 ProjData.(VarName{ivar})=FieldData.(VarName{ivar})(flagsel);% restrict variables to the projection band 720 720 ProjData.(VarName{ivar})=ProjData.(VarName{ivar})(indsort);% sort by absissa 721 721 ProjData.ListVarName=[ProjData.ListVarName VarName{ivar}]; 722 ProjData.VarDimName=[ProjData.VarDimName {FieldData.ListVarName{CellInfo{icell}.CoordIndex(end)}}];722 ProjData.VarDimName=[ProjData.VarDimName FieldData.ListVarName(CellInfo{icell}.CoordIndex(end))]; 723 723 ProjData.VarAttribute{nbvar+ivar}=FieldData.VarAttribute{VarIndex(ivar)};%reproduce var attribute 724 724 if isfield(ProjData.VarAttribute{nbvar+ivar},'Role') 725 725 if strcmp(ProjData.VarAttribute{nbvar+ivar}.Role,'vector_x'); 726 ivar_U= ivar;726 ivar_U=nbvar+ivar; 727 727 elseif strcmp(ProjData.VarAttribute{nbvar+ivar}.Role,'vector_y'); 728 ivar_V= ivar;728 ivar_V=nbvar+ivar; 729 729 end 730 730 end … … 777 777 end 778 778 [DataOut,VarAttribute,errormsg]=calc_field_tps(Coord,NbCentres,SubRange,FieldVar,CellInfo{icell}.FieldName,cat(3,XI,YI)); 779 ProjData.ListVarName=[ProjData.ListVarName {'X'}]; 780 ProjData.VarDimName=[ProjData.VarDimName {'X'}]; 779 781 ProjData.X=Xproj; 780 782 nbvar=numel(ProjData.ListVarName); … … 784 786 ProjData.VarAttribute=[ProjData.VarAttribute VarAttribute]; 785 787 for ivar=1:numel(VarAttribute) 786 ProjData.VarDimName=[ProjData.VarDimName { XName}];788 ProjData.VarDimName=[ProjData.VarDimName {'X'}]; 787 789 if isfield(VarAttribute{ivar},'Role') 788 790 if strcmp(VarAttribute{ivar}.Role,'vector_x');
Note: See TracChangeset
for help on using the changeset viewer.