Changeset 1041 for trunk/src/read_field.m
- Timestamp:
- May 10, 2018, 8:30:27 AM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/read_field.m
r1033 r1041 101 101 checkU=0; 102 102 checkV=0; 103 % scan the list InputField 103 104 for ilist=1:numel(InputField) 104 105 % look for input variables to read 105 106 r=regexp(InputField{ilist},'(?<Operator>(^vec|^norm))\((?<UName>.+),(?<VName>.+)\)$','names'); 106 107 if isempty(r)% no operator used 107 if isempty(find(strcmp(InputField{ilist},ListVar) ))108 if isempty(find(strcmp(InputField{ilist},ListVar),1)) 108 109 ListVar=[ListVar InputField(ilist)];%append the variable name if not already in the list 109 110 ListInputField=[ListInputField InputField(ilist)]; … … 111 112 end 112 113 if check_colorvar(ilist) 113 if isempty(find(strcmp(InputField{ilist},ListVar) ))114 if isempty(find(strcmp(InputField{ilist},ListVar),1)) 114 115 Role{numel(ListVar)}='ancillary';% not projected with interpolation 115 116 ProjModeRequest{numel(ListVar)}=''; … … 118 119 Role{numel(ListVar)}='scalar'; 119 120 ProjModeRequest{numel(ListVar)}='interp_lin';%scalar field (requires interpolation for plot) 121 end 122 if isfield(ParamIn,'Coord_y') 123 if ~isempty(strcmp(InputField{ilist},ParamIn.Coord_y)) 124 Role{numel(ListVar)}='coord_y'; 125 end 120 126 end 121 127 else % an operator 'vec' or 'norm' is used … … 139 145 Role=[Role {'vector_y'}]; 140 146 ProjModeRequest=[ProjModeRequest {ProjModeRequestVar}]; 141 ListInputField=[ListInputField InputField(ilist)]; 142 147 ListInputField=[ListInputField InputField(ilist)]; 143 148 else 144 149 checkV=1; … … 301 306 Npz=1;%default 302 307 npxy=size(A); 303 % Rangx=[0.5 npxy(2)-0.5]; % coordinates of the first and last pixel centers304 % Rangy=[npxy(1)-0.5 0.5]; %305 308 Field.NbDim=2;%default 306 309 Field.AName='image'; … … 318 321 ParamOut.Npy=npxy(1); 319 322 end 320 % Field.VarAttribute{3}.Mesh=1;321 323 else 322 324 Field.NbDim=3; … … 330 332 ParamOut.Npy=npxy(2); 331 333 end 332 % Field.VarAttribute{4}.Mesh=1;333 334 end 334 335 else … … 336 337 Field.Coord_y=[npxy(1)-0.5 0.5]; 337 338 Field.Coord_x=[0.5 npxy(2)-0.5]; % coordinates of the first and last pixel centers 338 % ParamOut.Npx=npxy(2);% display image size on the interface339 % ParamOut.Npy=npxy(1);340 % Field.VarAttribute{3}.Mesh=1;341 339 end 342 340 Field.A=A; 343 341 Field.CoordUnit='pixel'; %used for mouse_motion 344 345 end 346 347 348 342 end 343 344 345
Note: See TracChangeset
for help on using the changeset viewer.