- Timestamp:
- May 3, 2014, 10:40:25 AM (11 years ago)
- Location:
- trunk/src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/read_field.m
r748 r769 63 63 [Field,ParamOut.VelType,errormsg]=read_civdata(FileName,InputField,ParamIn.VelType); 64 64 if ~isempty(errormsg),errormsg=['read_civdata / ' errormsg];return,end 65 if ~isempty(strcmp('C',ParamIn.FieldName))% if C image correlation is requested as field (not color visu) 66 ScalarIndex=strcmp('C',Field.ListVarName); 67 Field.VarAttribute{ScalarIndex}.Role='scalar';%put role as 'scalar' instead of ancillary 68 end 65 69 ParamOut.CivStage=Field.CivStage; 66 70 case 'civx'% old (obsolete) format for civ results … … 175 179 ind_var_U=find(strcmp(UName,ListVar));%check previous listing of variable r.UName 176 180 ind_var_V=find(strcmp(VName,ListVar));%check previous listing of variable r.VName 177 178 179 180 181 182 183 184 185 186 187 188 189 181 if ~checkU && ~checkV 182 Field.ListVarName([ind_var_U+2 ind_var_V+2])=[]; 183 Field.VarDimName([ind_var_U+2 ind_var_V+2])=[]; 184 Field.VarAttribute([ind_var_U+2 ind_var_V+2])=[]; 185 elseif ~checkU 186 Field.ListVarName(ind_var_U+2)=[]; 187 Field.VarDimName(ind_var_U+2)=[]; 188 Field.VarAttribute(ind_var_U+2 )=[]; 189 elseif ~checkV 190 Field.ListVarName(ind_var_V+2)=[]; 191 Field.VarDimName(ind_var_V+2)=[]; 192 Field.VarAttribute(ind_var_V+2 )=[]; 193 end 190 194 end 191 195 case 'video' -
trunk/src/series.m
r767 r769 253 253 display_file_name(handles,Param.FileName,'one')%refresh the input table 254 254 end 255 else 256 set(handles.REFRESH,'BackgroundColor',[1 0 1])% set REFRESH button to magenta color to indicate that input refresh is needed 255 257 end 256 258 if isfield(Param,'incr_i') … … 260 262 set(handles.num_incr_j,'String',num2str(Param.incr_j)) 261 263 end 262 set(handles.REFRESH,'BackgroundColor',[1 0 1])% set REFRESH button to magenta color to indicate that input refresh is needed263 264 264 265 %------------------------------------------------------------------------ … … 1022 1023 switch FileType 1023 1024 case {'civx','civdata'} 1024 FieldList=set_field_list('U','V' ,'C');1025 set(handles.FieldName,'String',[FieldList;{' get_field...'}]);%standard menu for civx data1025 FieldList=set_field_list('U','V'); 1026 set(handles.FieldName,'String',[FieldList;{'C'};{'get_field...'}]);%standard menu for civx data 1026 1027 set(handles.FieldName,'Value',1) % set menu to 'velocity 1027 1028 set(handles.Coord_x,'Value',1); … … 1404 1405 function RUN_Callback(hObject, eventdata, handles) 1405 1406 1407 %% read the data on the GUI series 1408 Param=read_GUI_series(handles);%displayed parameters 1409 SeriesData=get(handles.series,'UserData');%hidden parameters 1410 if isfield(Param,'InputFields')&& isequal(Param.InputFields.FieldName,'get_field...') 1411 msgbox_uvmat('ERROR','input field name(s) not defined, select get_field...') 1412 return 1413 end 1414 1406 1415 %% settings of the button RUN 1407 1416 set(handles.RUN,'BusyAction','queue');% activation of STOP button will set BusyAction to 'cancel' … … 1412 1421 status_Callback(hObject, eventdata, handles) 1413 1422 1414 %% read the data on the GUI series1415 Param=read_GUI_series(handles);%displayed parameters1416 SeriesData=get(handles.series,'UserData');%hidden parameters1417 1418 1419 1420 1423 %% select the Action mode, 'local', 'background' or 'cluster' (if available) 1421 1424 RunMode='local';%default (needed for first opening of the GUI series) 1422 1425 if isfield(Param.Action,'RunMode') 1423 1426 RunMode=Param.Action.RunMode; 1427 Param.Action=rmfield(Param.Action,'RunMode');%remove from the recorded xml file to avoid interference during ImportConfig 1424 1428 end 1425 1429 ActionExt='.m';%default 1426 1430 if isfield(Param.Action,'ActionExt') 1427 1431 ActionExt=Param.Action.ActionExt;% '.m' or '.sh' (compiled) 1432 Param.Action=rmfield(Param.Action,'ActionExt');%remove from the recorded xml file to avoid interference during ImportConfig 1428 1433 end 1429 1434 ActionName=Param.Action.ActionName; 1430 1435 ActionPath=Param.Action.ActionPath; 1436 1431 1437 path_series=fileparts(which('series')); 1432 1438 … … 1483 1489 1484 1490 %% If a compiled version has been selected (ext .sh) check weather it needs to be recompiled 1485 % ActionExtList=get(handles.ActionExt,'String');1486 % ActionExt=ActionExtList{get(handles.ActionExt,'Value')};1487 % ActionList=get(handles.ActionName,'String');1488 % ActionName=ActionList{get(handles.ActionName,'Value')};1489 % TransformPath='';1490 % if ~isempty(get(handles.ActionExt,'UserData'))1491 % TransformPath=get(handles.ActionExt,'UserData');1492 % end1493 1491 if strcmp(ActionExt,'.sh') 1494 1492 TransformPath=''; … … 1506 1504 currentdir=pwd; 1507 1505 cd(get(handles.ActionPath,'String'))% go to the directory of Action 1508 % addpath(get(handles.TransformPath,'String'))1509 1506 addpath(path_uvmat)% add the path to uvmat to run the fct 'compile' 1510 % addpath(fullfile(path_uvmat,'transform_field'))% add the path to uvmat to run the fct 'compile'1511 1507 compile(ActionName,TransformPath) 1512 1508 cd(currentdir) … … 1523 1519 currentdir=pwd; 1524 1520 cd(get(handles.ActionPath,'String'))% go to the directory of Action 1525 % addpath(get(handles.TransformPath,'String'))1526 1521 addpath(path_uvmat)% add the path to uvmat to run the fct 'compile' 1527 1522 addpath(fullfile(path_uvmat,'transform_field'))% add the path to uvmat to run the fct 'compile' … … 2330 2325 set(handles.VelType,'visible','on') 2331 2326 end 2327 set(handles.FieldName,'Value',1) 2328 set(handles.FieldName,'String',[FieldList; {'get_field...'}]); 2332 2329 if ~strcmp(GetFieldData.FieldOption,'civdata...') 2330 set(handles.FieldName,'Value',[1:numel(FieldList)])%select all input fields by default 2333 2331 set(handles.VelType,'visible','off') 2334 2332 XName=GetFieldData.Coordinates.Coord_x; … … 2353 2351 end 2354 2352 end 2355 set(handles.Coord_x,'String',{XName})2353 set(handles.Coord_x,'String',{XName}) 2356 2354 set(handles.Coord_y,'String',YName) 2357 set(handles.FieldName,'Value',1)2358 set(handles.FieldName,'String',[FieldList; {'get_field...'}]);2359 2355 end 2360 2356 end … … 2802 2798 fill_GUI(Param,handles.series)% fill the elements of the GUI series with the input parameters 2803 2799 SeriesData=get(handles.series,'UserData'); 2800 if isfield(Param,'InputFields') 2801 ListField=Param.InputFields.FieldName; 2802 set(handles.FieldName,'String',[ListField;{'get-field...'}]) 2803 set(handles.FieldName,'Value',1:numel(ListField)) 2804 end 2804 2805 if isfield(Param,'ActionInput')% introduce parameters specific to an Action fct, for instance PIV parameters 2805 2806 set(handles.ActionInput,'Visible','on') -
trunk/src/set_field_list.m
r588 r769 4 4 % 5 5 % OUTPUT: 6 % Scal: matlab vector representing the scalar values (length nbvec defined by var_read) 7 % if no input, Scal=list of programmed scalar names (to put in menus) 8 % if only the field name is put as input, vec_A=type of scalar, which can be: 9 % 'discrete': related to the individual velocity vectors, not interpolated by patch 10 % 'vel': scalar calculated solely from velocity components 11 % 'der': needs spatial derivatives 12 % 'var': the scalar name directly corresponds to a field name in the netcdf files 13 % error: error flag 14 % error = 0; OK 15 % error = 1; the prescribed scalar cannot be read or calculated from available fields 6 % FieldList: list (cell column) of the fields to propose in the menu FieldName 7 % VecColorList: list (cell column) of the fields to propose in the menu for vector color 16 8 % 17 9 % INPUT: 18 % FieldList: cell array of strings representing the name(s) of the field(s) to calculate19 % DataIn: structure representing the field, as defined in check_field_srtructure.m20 % C oord_interp(:,nb_coord) optional set of coordinates to interpolate the field (use with thin plate shell)10 % UName: name of the x vector component 11 % VName: name of the y vector component 12 % CName: name of an additional scalar for color 21 13 % 22 14 % FUNCTION related 23 15 % varname_generator.m: determines the field names to read in the netcdf 24 16 % file, depending on the scalar 17 25 18 function [FieldList,VecColorList]=set_field_list(UName,VName,CName) 26 %function [DataOut,errormsg]=calc_field(FieldList,DataIn,Coord_interp)27 28 %list of defined scalars to display in menus (in addition to 'ima_cor').29 % a type is associated to each scalar:30 % 'discrete': related to the individual velocity vectors, not interpolated by patch31 % 'vel': calculated from velocity components, continuous field (interpolated with velocity)32 % 'der': needs spatial derivatives33 % 'var': the scalar name corresponds to a field name in the netcdf files34 % a specific variable name for civ1 and civ2 fields are also associated, if35 % the scalar is calculated from other fields, as explicited below36 19 37 20 FieldList={['vec(' UName ',' VName ')'];... … … 45 28 UName;... 46 29 VName};... 47 if~isempty(CName)30 if exist('CName','var') && ~isempty(CName) 48 31 VecColorList=[{CName};VecColorList]; 49 32 end 50 33 51 34 52 53 % %% list of field options implemented54 % FieldList={'vec(U,V)';...%image correlation corresponding to a vel vector55 % 'C';...%image correlation corresponding to a vel vector56 % 'norm(U,V)';...%norm of the velocity57 % 'curl(U,V)';...%vorticity58 % 'div(U,V)';...%divergence59 % 'strain(U,V)';...%rate of strain60 % 'U';... %u velocity component61 % 'V';... %v velocity component62 % 'W';... %w velocity component63 % 'W_normal';... %w velocity component normal to the plane64 % 'error'}; %error associated to a vector (for stereo or patch)65 % ColorList={'C';...%image correlation corresponding to a vel vector66 % 'norm(U,V)';...%norm of the velocity67 % 'U';... %u velocity component68 % 'V';... %v velocity component69 % }70
Note: See TracChangeset
for help on using the changeset viewer.