Changeset 890 for trunk/src/proj_field.m
- Timestamp:
- Apr 18, 2015, 11:03:01 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/proj_field.m
r888 r890 123 123 end 124 124 125 % %% take the difference of projected input fields if relevant126 % [CellInfo,NbDim,errormsg]=find_field_cells(ProjData);127 % ind_remove=zeros(size(ProjData.ListVarName));128 % ivar=[];129 % ivar_1=[];130 % for icell=1:numel(CellInfo)131 % if ~isempty(CellInfo{icell})132 % % if two scalar are in the same cell133 % if isfield(CellInfo{icell},'VarIndex_scalar') && numel(CellInfo{icell}.VarIndex_scalar)==2 && ProjData.VarAttribute{CellInfo{icell}.VarIndex_scalar(2)}.CheckSub;134 % ivar=[ivar CellInfo{icell}.VarIndex_scalar(1)];135 % ivar_1=[ivar_1 CellInfo{icell}.VarIndex_scalar(2)];136 % end137 % % if two vector u components are in the same cell138 % if isfield(CellInfo{icell},'VarIndex_vector_x') && numel(CellInfo{icell}.VarIndex_vector_x)==2 && ProjData.VarAttribute{CellInfo{icell}.VarIndex_vector_x(2)}.CheckSub;139 % ivar=[ivar CellInfo{icell}.VarIndex_vector_x(1)];140 % ivar_1=[ivar_1 CellInfo{icell}.VarIndex_vector_x(2)];141 % end142 % % if two vector v components are in the same cell143 % if isfield(CellInfo{icell},'VarIndex_vector_y') && numel(CellInfo{icell}.VarIndex_vector_y)==2 && ProjData.VarAttribute{CellInfo{icell}.VarIndex_vector_y(2)}.CheckSub;144 % ivar=[ivar CellInfo{icell}.VarIndex_vector_y(1)];145 % ivar_1=[ivar_1 CellInfo{icell}.VarIndex_vector_y(2)];146 % end147 % end148 % end149 % % subtract fields if relevant150 % for imod=1:numel(ivar)151 % VarName=ProjData.ListVarName{ivar(imod)};152 % VarName_1=ProjData.ListVarName{ivar_1(imod)};153 % ProjData.(VarName)=double(ProjData.(VarName))-double(ProjData.(VarName_1));154 % ind_remove(ivar_1(imod))=1;155 % end156 % ProjData.ListVarName(find(ind_remove))=[];157 % ProjData.VarDimName(find(ind_remove))=[];158 % ProjData.VarAttribute(find(ind_remove))=[];159 160 125 %----------------------------------------------------------------- 161 126 %project on a set of points … … 1143 1108 end 1144 1109 [XI,YI]=meshgrid(coord_x_proj,coord_y_proj);%grid in the new coordinates 1110 ProjData.VarDimName={AYName,AXName}; 1145 1111 % XI=ObjectData.Coord(1,1)+(X)*cos(PlaneAngle(3))-YI*sin(PlaneAngle(3));%corresponding coordinates in the original system 1146 1112 % YI=ObjectData.Coord(1,2)+(X)*sin(PlaneAngle(3))+YI*cos(PlaneAngle(3)); … … 1149 1115 AYName=FieldData.ListVarName{CellInfo{icell_grid}.CoordIndex(NbDim-1)};%name of input x coordinate (name preserved on projection) 1150 1116 AXName=FieldData.ListVarName{CellInfo{icell_grid}.CoordIndex(NbDim)};%name of input y coordinate (name preserved on projection) 1117 AYDimName=FieldData.VarDimName{CellInfo{icell_grid}.CoordIndex(NbDim-1)};% 1118 AXDimName=FieldData.VarDimName{CellInfo{icell_grid}.CoordIndex(NbDim)};% 1119 ProjData.VarDimName={AYDimName,AXDimName}; 1151 1120 ProjData.(AYName)=FieldData.(AYName); % new (projected ) y coordinates 1152 1121 ProjData.(AXName)=FieldData.(AXName); % new (projected ) y coordinates 1153 1122 end 1154 1123 ProjData.ListVarName={AYName,AXName}; 1155 ProjData.VarDimName={AYName,AXName};1124 1156 1125 ProjData.VarAttribute={[],[]}; 1157 1126 end
Note: See TracChangeset
for help on using the changeset viewer.