Changeset 646 for trunk


Ignore:
Timestamp:
Jun 2, 2013, 4:00:34 PM (11 years ago)
Author:
sommeria
Message:

various update, bugs to be expected

Location:
trunk/src
Files:
1 added
3 deleted
11 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/check_files.m

    r625 r646  
    3232svn_info.status=[];
    3333list_fct={...
     34    'activate';...% emulate the mouse selection of a GUI element, for demo
    3435    'browse_data';...% function for scanning directories in a project/campaign
    3536    'browse_data.fig';...% GUI corresponding to dataview
     
    3839    'cell2tab';... %transform a Matlab cell in a character array suitable for display in a table
    3940    'check_files';...
    40     'civ';...   %function associated with the interface 'civ.fig' for PIV and spline interpolation
     41    'civ';...   %function associated with the interface 'civ.fig' for PIV and spline interpolation (to be replaced by civ_series)
    4142    'civ.fig';...
    42     'civ_3D';... function associated with the interface 'civ_3D.fig' for PIV in volume (TODO: combine with civ.m)
     43    'civ_3D';... % function associated with the interface 'civ_3D.fig' for PIV in volume (TODO: combine with civ.m)
    4344    'civ_3D.fig';...
    4445    'civ_matlab';...% civ programs, Matlab version (called by civ.m, option Civprogram/Matlab in the upper menu bar)
     46    'compile';...% compile a Matlab function, create a binary in a subdirectory /bin
    4547    'copyfields';...% copy fields between two matlab structures
    4648    'create_grid';...% called by the GUI geometry_calib to create a physical grid
    4749    'create_grid.fig';...% GUI corresponding to create_grid.m
    48     'displ_uvmat';...
    49     'editxml';...%display and edit xml files using a xls schema
    50     'editxml.fig';...%interface for editxml
     50    'displ_uvmat';...% display a message using  msgbox_uvmat or on the log file in batch mode
     51    'editxml';...% display and edit xml files using a xls schema
     52    'editxml.fig';...% interface for editxml
    5153    'fileparts_uvmat';...% extracts the root name,field indexes and nomenclature type from an input filename
    5254    'fill_GUI';...%  fill a GUI with a set of parameters from a Matlab structure
    5355    'filter_tps';...% find the thin plate spline coefficients for interpolation-smoothing
    5456    'find_field_cells';...% group the variables of a 'field object' into 'field cells' and specify their structure
    55     'find_file_series';...%check the content of an input file and find the corresponding file series
     57    'find_file_series';...% check the content of an input file and find the corresponding file series
    5658    'find_imadoc';...% find the ImaDoc xml file associated with a given input file
    57     'fullfile_uvmat';...%creates a file name from a root name and indices.
    58     'geometry_calib';...%performs geometric calibration from a set of reference points
    59     'geometry_calib.fig';...%interface for geometry_calib
     59    'fullfile_uvmat';...% creates a file name from a root name and indices.
     60    'geometry_calib';...% performs geometric calibration from a set of reference points
     61    'geometry_calib.fig';...% interface for geometry_calib
    6062    'get_field';...% choose and plot a field from a Netcdf file
    6163    'get_field.fig';...%interface for get_field
     
    6466    'hist_update';...%  update of a current global histogram by inclusion of a new field
    6567    'imadoc2struct';...%convert the image documentation file ImaDoc into a Matlab structure
     68    'interp2_uvmat';...% linearly interpolate an image or scalar defined on a regular grid
    6669    'keyboard_callback';... % function activated when a key is pressed on the keyboard
    67     'ListDir';... scan the structure of the directory tree (for dataview.m)
     70    'ListDir';... % scan the structure of the directory tree (for editxml.m)
     71    'mask_proj';...% restrict input fields to a mask region, set to 0 outside
    6872    'mouse_down';% function activated when the mouse button is pressed on a figure (callback for 'WindowButtonDownFcn')
    6973    'mouse_motion';...% permanently called by mouse motion over a figure (callback for 'WindowButtonMotionFcn')
    7074    'mouse_up';... % function to be activated when the mouse button is released (callback for 'WindowButtonUpFcn')
    71     'msgbox_uvmat';... associated with GUI msgbox_uvmat.fig to display message boxes, for error, warning or input calls
     75    'msgbox_uvmat';... % associated with GUI msgbox_uvmat.fig to display message boxes, for error, warning or input calls
    7276    'msgbox_uvmat.fig';...
     77    'nomtype2pair';... creates nomenclature for index pairs knowing the image nomenclature, used by series fct
    7378    'nc2struct';...% transform a netcdf file in a corresponding matlab structure
    7479    'num2stra';...% transform number to the corresponding character string depending on the nomenclature
     
    8287    'read_civdata';... reads new civ data from netcdf files
    8388    'read_field';...% read the fields from files in different formats (netcdf files, images, video)
     89    'read_geometry_calib';... read data on the GUI geometry_calib
    8490    'read_GUI';... %read a GUI and provide the data as a Matlab structure
    8591    'read_image';...%read images or video objects
     
    109115    'translate_points';...% associated with GUI translate_points.fig to display translation parameters
    110116    'translate_points.fig';...
     117    'uigetfile_uvmat';... browser, and display of directories, faster than the Matlab fct uigetfile
    111118    'update_imadoc';...  %update the ImaDoc xml file
    112119    'update_waitbar';... update the waitbar display, used for ACTION functions in the GUI 'series'
  • trunk/src/get_field.m

    r644 r646  
    2222function varargout = get_field(varargin)
    2323
    24 % Last Modified by GUIDE v2.5 28-May-2013 01:55:25
     24% Last Modified by GUIDE v2.5 02-Jun-2013 14:00:39
    2525
    2626% Begin initialization code - DO NOT EDIT
     
    7575set(hObject,'Unit','pixel')
    7676pos_view_field=get(hObject,'Position');
     77set(0,'Unit','pixels')
    7778ScreenSize=get(0,'ScreenSize');
    7879pos_view_field(1)=ScreenSize(1)+ScreenSize(3)-pos_view_field(3);
     
    106107set(handles.variables,'String',[{'*'} Txt])
    107108variables_Callback(handles.variables,[], handles)
    108 
    109 % set(handles.abscissa,'String',[{''} Txt ])
    110109set(handles.ordinate,'String',Txt)
    111 set(handles.vector_x,'String',[Txt ])
    112 set(handles.vector_y,'String',[Txt ])
     110set(handles.vector_x,'String',Txt)
     111set(handles.vector_y,'String',Txt )
    113112set(handles.vector_z,'String',[{''} Txt ])
    114113set(handles.vec_color,'String',[{''} Txt ])
    115 set(handles.XVarName,'String',[{''} Txt ])
    116 set(handles.YVarName,'String',[{''} Txt ])
    117 set(handles.ZVarName,'String',[{''} Txt ])
    118 % set(handles.coord_x_vectors,'String',[{''} Txt ])
    119 % set(handles.coord_y_vectors,'String',[{''} Txt ])
    120 % set(handles.YVarName,'String',[{''} Txt ])
    121 % set(handles.TimeVarName,'String',[{''} Txt ])
     114set(handles.XVarName,'String',Txt )
     115set(handles.YVarName,'String',Txt )
     116set(handles.ZVarName,'String',Txt )
    122117set(handles.scalar,'Value',1)
    123118set(handles.scalar,'String', Txt )
    124119
    125 %% ananlyse the input field cells
     120%% analyse the input field cells
    126121[CellInfo,NbDim,errormsg]=find_field_cells(Field);
    127122if ~isempty(errormsg) 
     
    162157
    163158%% set time mode
    164 ListSwitchVarIndexTime={'file index'};
     159ListSwitchVarIndexTime={'file index'};% default setting: the time is the file index
    165160% look at global attributes with numerical values
    166161check_numvalue=false;
    167162check_time=false;
    168     for ilist=1:numel(Field.ListGlobalAttribute)
    169         Value=Field.(Field.ListGlobalAttribute{ilist});
    170         check_numvalue(ilist)=isnumeric(Value);
    171         check_time(ilist)=~isempty(find(regexp(Field.ListGlobalAttribute{ilist},'Time'),1));
    172     end 
     163for ilist=1:numel(Field.ListGlobalAttribute)
     164    Value=Field.(Field.ListGlobalAttribute{ilist});
     165    check_numvalue(ilist)=isnumeric(Value);
     166    check_time(ilist)=~isempty(find(regexp(Field.ListGlobalAttribute{ilist},'Time'),1));
     167end
    173168Field.ListNumAttributes=Field.ListGlobalAttribute(check_numvalue);% select the attributes with float numerical value
    174169if ~isempty(Field.ListNumAttributes)
    175 ListSwitchVarIndexTime=[ListSwitchVarIndexTime; {'attribute'}];
     170    ListSwitchVarIndexTime=[ListSwitchVarIndexTime; {'attribute'}];% the time can be chosen as a global attribute
    176171end
    177172nboption=numel(ListSwitchVarIndexTime);
    178173if Field.MaxDim>=2
    179     ListSwitchVarIndexTime=[ListSwitchVarIndexTime;{'variable'};{'dim index'}];
    180 end
    181 if Field.MaxDim>=4
    182         option=nboption+1;
     174    ListSwitchVarIndexTime=[ListSwitchVarIndexTime;{'variable'};{'dim index'}];% the time can be chosen as a dim index
     175end
     176if Field.MaxDim>=4% for dim >=4, one dim is proposed as time
     177    option=nboption+1;
    183178elseif ~isempty(find(check_time, 1))
    184179    option=2;
     
    186181    option=1;
    187182end
    188 %set(handles.SwitchVarIndexTime,'String',ListSwitchVarIndexTime)
    189 %set(handles.SwitchVarIndexTime,'Value',option)
     183set(handles.SwitchVarIndexTime,'String',ListSwitchVarIndexTime)
     184set(handles.SwitchVarIndexTime,'Value',option)
    190185set(handles.get_field,'UserData',Field);% record the finput field structure
    191 %SwitchVarIndexTime_Callback([],[], handles)
     186SwitchVarIndexTime_Callback([],[], handles)
    192187
    193188%% set z coordinate menu if relevant
     
    207202%% set vector menu (priority) if detected or scalar menu for space dim >=2, or usual (x,y) plot for 1D fields
    208203if Field.MaxDim>=2 % case of 2D (or 3D) fields
     204    if isfield(CellInfo{imax},'VarIndex_coord_x')&&  isfield(CellInfo{imax},'VarIndex_coord_y')
     205        set(handles.XVarName,'Value',CellInfo{imax}.VarIndex_coord_x(1))
     206        set(handles.YVarName,'Value',CellInfo{imax}.VarIndex_coord_y(1))
     207    end
    209208    if isfield(CellInfo{imax},'VarIndex_vector_x') &&  isfield(CellInfo{imax},'VarIndex_vector_y')
    210         set(handles.CheckVector,'Value',1)
    211         set(handles.CheckScalar,'Value',0)
     209        set(handles.FieldOption,'Value',3)% set vector selection option
    212210        set(handles.vector_x,'Value',CellInfo{imax}.VarIndex_vector_x(1))
    213211        set(handles.vector_y,'Value',CellInfo{imax}.VarIndex_vector_y(1))
     
    354352    end
    355353end
    356 val=get(handles.abscissa,'Value');
    357 set(handles.abscissa,'Value',min(val,2));
     354%val=get(handles.abscissa,'Value');
     355%set(handles.abscissa,'Value',min(val,2));
    358356coord_x_index=CellInfo{cell_select}.VarIndex_coord_x;
    359357coord_x_index=coord_x_index(coord_x_index~=0);
    360 set(handles.XVarName,'String',[{''}; (Field.ListVarName(coord_x_index))'; (Field.ListVarName(VarIndex))'])
     358%set(handles.XVarName,'String',[{''}; (Field.ListVarName(coord_x_index))'; (Field.ListVarName(VarIndex))'])
     359set(handles.XVarName,'String',[(Field.ListVarName(coord_x_index))'; (Field.ListVarName(VarIndex))'])
    361360
    362361%------------------------------------------------------------------------
     
    395394%eliminate time
    396395TimeDimName='';%default
     396
    397397% SwitchVarIndexTime=get(handles.SwitchVarIndexTime,'String');
    398398% TimeVarOption=SwitchVarIndexTime{get(handles.SwitchVarIndexTime,'Value')};
    399 if strcmp(TimeVarOption,'variable')
    400     List=get(handles.TimeVarName,'String');
     399List=get(handles.TimeVarName,'String');
     400if get(handles.CheckDimensionTime)
     401         TimeDimName=List{get(handles.TimeVarName,'Value')};
     402elseif ~get(handles.CheckAttributeTime)
    401403    TimeVarName=List{get(handles.TimeVarName,'Value')};
    402 elseif  strcmp(TimeVarOption,'dim index')
    403     List=get(handles.TimeVarName,'String');
    404     TimeDimName=List{get(handles.TimeVarName,'Value')};
    405404end
    406405% A completer
     
    10381037end
    10391038
    1040 % --------------------------------------------------------------------
    1041 function MenuOpen_Callback(hObject, eventdata, handles)
    1042 % hObject    handle to MenuOpen (see GCBO)
    1043 % eventdata  reserved - to be defined in a future version of MATLAB
    1044 % handles    structure with handles and user data (see GUIDATA)
    1045 
    1046 
    1047 % --------------------------------------------------------------------
    1048 function MenuExport_Callback(hObject, eventdata, handles)
    1049 % hObject    handle to MenuExport (see GCBO)
    1050 % eventdata  reserved - to be defined in a future version of MATLAB
    1051 % handles    structure with handles and user data (see GUIDATA)
    1052 
    1053 
    1054 % --------------------------------------------------------------------
    1055 function MenuBrowse_Callback(hObject, eventdata, handles)
    1056 
    1057 oldfile=get(handles.inputfile,'String');
    1058 testrootfile=0;
    1059 testsubdir=0;
    1060 if isempty(oldfile)|isequal(oldfile,'') %loads the previously stored file name and set it as default in the file_input box
    1061         oldfile='';
    1062         dir_perso=prefdir;
    1063          profil_perso=fullfile(dir_perso,'uvmat_perso.mat');
    1064          if exist(profil_perso,'file')
    1065               h=load (profil_perso);
    1066              if isfield(h,'RootPath')
    1067                   RootPath=h.RootPath;
    1068              end
    1069              if isfield(h,'SubDir')
    1070                   SubDir=h.SubDir;
    1071                   if ~isempty(SubDir)
    1072                     testsubdir=1;
    1073                   end
    1074              end
    1075              if isfield(h,'RootFile')
    1076                   RootFile=h.RootFile;
    1077                   if ~isempty(RootFile)
    1078                     testrootfile=1;
    1079                   end
    1080              end
    1081          end
    1082 end
    1083 if testrootfile
    1084     if ~testsubdir
    1085         oldfile=fullfile(RootPath,RootFile);
    1086     else
    1087         oldfile=fullfile(RootPath,SubDir,RootFile);
    1088     end
    1089 end
    1090 [FileName, PathName] = uigetfile( ...
    1091        {'*.nc', ' *.nc';...
    1092        '*.cdf', ' *.cdf';...
    1093         '*.*',  'All Files (*.*)'}, ...
    1094         'Pick a file',oldfile);
    1095 
    1096 %global inputfile
    1097 fileinput=[PathName FileName];%complete file name
    1098 sizf=size(fileinput);
    1099 if (~ischar(fileinput)||~isequal(sizf(1),1)),return;end
    1100 set(handles.inputfile,'String',fileinput)
    1101 inputfile_Callback(hObject, eventdata, handles)
    1102 
    1103 %update list of recent files in the menubar
    1104 MenuFile_1=fileinput;
    1105 MenuFile_2=get(handles.MenuFile_1,'Label');
    1106 MenuFile_3=get(handles.MenuFile_2,'Label');
    1107 MenuFile_4=get(handles.MenuFile_3,'Label');
    1108 MenuFile_5=get(handles.MenuFile_4,'Label');
    1109 set(handles.MenuFile_1,'Label',MenuFile_1)
    1110 set(handles.MenuFile_2,'Label',MenuFile_2)
    1111 set(handles.MenuFile_3,'Label',MenuFile_3)
    1112 set(handles.MenuFile_4,'Label',MenuFile_4)
    1113 set(handles.MenuFile_5,'Label',MenuFile_5)
    1114 dir_perso=prefdir;
    1115 profil_perso=fullfile(dir_perso,'uvmat_perso.mat');
    1116 display(profil_perso)
    1117 if exist(profil_perso,'file')
    1118     save (profil_perso,'MenuFile_1','MenuFile_2','MenuFile_3','MenuFile_4', 'MenuFile_5','-append'); %store the file names for future opening of uvmat
    1119 else
    1120     txt=ver('MATLAB');
    1121     Release=txt.Release;
    1122     relnumb=str2double(Release(3:4));
    1123     if relnumb >= 14
    1124         save (profil_perso,'MenuFile_1','MenuFile_2','MenuFile_3','MenuFile_4', 'MenuFile_5','-V6'); %store the file names for future opening of uvmat
    1125     else
    1126         save (profil_perso,'MenuFile_1','MenuFile_2','MenuFile_3','MenuFile_4', 'MenuFile_5'); %store the file names for future opening of uvmat
    1127     end
    1128 end
    1129 
    1130 % --------------------------------------------------------------------
    1131 function MenuFile_1_Callback(hObject, eventdata, handles)
    1132 fileinput=get(handles.MenuFile_1,'Label');
    1133 set(handles.inputfile,'String',fileinput)
    1134 inputfile_Callback(hObject, eventdata, handles)
    1135 
    1136 % --------------------------------------------------------------------
    1137 function MenuFile_2_Callback(hObject, eventdata, handles)
    1138 fileinput=get(handles.MenuFile_2,'Label');
    1139 set(handles.inputfile,'String',fileinput)
    1140 inputfile_Callback(hObject, eventdata, handles)
    1141 
    1142 % -----------------------------------------------------------------------
    1143 function MenuFile_3_Callback(hObject, eventdata, handles)
    1144 % -----------------------------------------------------------------------
    1145 fileinput=get(handles.MenuFile_3,'Label');
    1146 set(handles.inputfile,'String',fileinput)
    1147 inputfile_Callback(hObject, eventdata, handles)
    1148 
    1149 % -----------------------------------------------------------------------
    1150 function MenuFile_4_Callback(hObject, eventdata, handles)
    1151 % -----------------------------------------------------------------------
    1152 fileinput=get(handles.MenuFile_4,'Label');
    1153 set(handles.inputfile,'String',fileinput)
    1154 inputfile_Callback(hObject, eventdata, handles)
    1155 
    1156 % -----------------------------------------------------------------------
    1157 function MenuFile_5_Callback(hObject, eventdata, handles)
    1158 % -----------------------------------------------------------------------
    1159 fileinput=get(handles.MenuFile_5,'Label');
    1160 set(handles.inputfile,'String',fileinput)
    1161 inputfile_Callback(hObject, eventdata, handles)
    1162 
    1163 %------------------------------------------------------------------------
    1164 function MenuExportField_Callback(hObject, eventdata, handles)
    1165 %------------------------------------------------------------------------
    1166 global Data_get_field
    1167 % huvmat=findobj(allchild(0),'Name','uvmat');
    1168 inputfile=get(handles.inputfile,'String');
    1169 Data_get_field=nc2struct(inputfile);
    1170 % Data_view_field=UvData.ProjField_2;
    1171 evalin('base','global Data_get_field')%make CurData global in the workspace
    1172 display(['content of ' inputfile ':'])
    1173 evalin('base','Data_get_field') %display CurData in the workspace
    1174 commandwindow;
    1175 
    1176 %------------------------------------------------------------------------
    1177 function MenuHelp_Callback(hObject, eventdata, handles)
    1178 %------------------------------------------------------------------------
    1179 path_to_uvmat=which ('uvmat');% check the path of uvmat
    1180 pathelp=fileparts(path_to_uvmat);
    1181 helpfile=fullfile(pathelp,'UVMAT_DOC','uvmat_doc.html');
    1182 if isempty(dir(helpfile)), msgbox_uvmat('ERROR','Please put the help file uvmat_doc.html in the directory UVMAT/UVMAT_DOC')
    1183 else
    1184 web([helpfile '#get_field'])   
    1185 end
    11861039
    11871040% -----------------------------------------------------------------------
     
    13841237
    13851238
    1386 
     1239%------------------------------------------------------------------------
    13871240% --- Executes on selection change in SwitchVarIndexX.
     1241%------------------------------------------------------------------------
    13881242function SwitchVarIndexX_Callback(hObject, eventdata, handles)
    1389 % hObject    handle to SwitchVarIndexX (see GCBO)
    1390 % eventdata  reserved - to be defined in a future version of MATLAB
    1391 % handles    structure with handles and user data (see GUIDATA)
    1392 
    1393 % Hints: contents = cellstr(get(hObject,'String')) returns SwitchVarIndexX contents as cell array
    1394 %        contents{get(hObject,'Value')} returns selected item from SwitchVarIndexX
    1395 
    1396 
     1243
     1244%------------------------------------------------------------------------
    13971245% --- Executes on selection change in SwitchVarIndexTime.
     1246%------------------------------------------------------------------------
    13981247function SwitchVarIndexTime_Callback(hObject, eventdata, handles)
     1248
    13991249menu=get(handles.SwitchVarIndexTime,'String');
    14001250option=menu{get(handles.SwitchVarIndexTime,'Value')};
     
    14531303switch FieldOption
    14541304    case '1D plot'
    1455          set(handles.Panel1Dplot,'Visible','on')
    1456          pos=get(handles.Panel1Dplot,'Position');
    1457          pos(1)=2;
    1458          pos_coord=get(handles.Coordinates,'Position');
    1459          pos(2)=pos_coord(2)-pos(4)-2;
    1460          set(handles.Panel1Dplot,'Position',pos)
    1461     set(handles.PanelScalar,'Visible','off')
    1462     set(handles.PanelVectors,'Visible','off')
    1463     set(handles.YVarName,'Visible','off')
    1464 %    set(handles.SwitchVarIndexY,'Visible','off')
    1465     set(handles.Y_title,'Visible','off')
    1466     set(handles.ZVarName,'Visible','off')
    1467  %   set(handles.SwitchVarIndexZ,'Visible','off')
    1468     set(handles.Z_title,'Visible','off')
    1469 %    ordinate_Callback(hObject, eventdata, handles)
    1470 %         set(handles.get_field,'Units','pixels')
    1471 % size_fig=get(handles.get_field,'Position');
    1472 % Data=get(handles.view_field,'UserData');
    1473 % Data.GUISize=size_fig;
    1474 % set(handles.view_field,'UserData',Data)
    1475 %
    1476 % %% reset position of text_display or TableDisplay
    1477 % if strcmp(get(handles.TableDisplay,'Visible'),'off')
    1478 %     pos_1=get(handles.text_display,'Position');
    1479 %     pos_1(1)=size_fig(3)-pos_1(3);
    1480 %     pos_1(2)=size_fig(4)-pos_1(4);
    1481 %     set(handles.text_display,'Position',pos_1)
    1482 %     % reset position of TableDisplay
    1483 % else
    1484 %     pos_1=get(handles.TableDisplay,'Position');
    1485 %     pos_1(1)=size_fig(3)-pos_1(3);
    1486 %     pos_1(2)=size_fig(4)-pos_1(4);
    1487 %     set(handles.TableDisplay,'Position',pos_1)
    1488 % end
    1489 %
    1490 % %% reset position of Coordinates
    1491 % pos_2=get(handles.Coordinates,'Position');
    1492 % pos_2(1)=size_fig(3)-pos_1(3);
    1493 % pos_2(2)=pos_1(2)-pos_2(4);
    1494 % set(handles.Coordinates,'Position',pos_2)
     1305        set(handles.Panel1Dplot,'Visible','on')
     1306        pos=get(handles.Panel1Dplot,'Position');
     1307        pos(1)=2;
     1308        pos_coord=get(handles.Coordinates,'Position');
     1309        pos(2)=pos_coord(2)-pos(4)-2;
     1310        set(handles.Panel1Dplot,'Position',pos)
     1311        set(handles.PanelScalar,'Visible','off')
     1312        set(handles.PanelVectors,'Visible','off')
     1313        set(handles.YVarName,'Visible','off')
     1314        %    set(handles.SwitchVarIndexY,'Visible','off')
     1315        set(handles.Y_title,'Visible','off')
     1316        set(handles.ZVarName,'Visible','off')
     1317        %   set(handles.SwitchVarIndexZ,'Visible','off')
     1318        set(handles.Z_title,'Visible','off')
    14951319    case 'scalar'
    14961320        set(handles.Panel1Dplot,'Visible','off')
    1497     set(handles.PanelScalar,'Visible','on')
    1498     set(handles.PanelVectors,'Visible','off')
    1499          pos=get(handles.PanelScalar,'Position');
    1500          pos(1)=2;
    1501          pos_coord=get(handles.Coordinates,'Position');
    1502          pos(2)=pos_coord(2)-pos(4)-2;
    1503          set(handles.PanelScalar,'Position',pos)
    1504     set(handles.YVarName,'Visible','on')
    1505     set(handles.Y_title,'Visible','on')
     1321        set(handles.PanelScalar,'Visible','on')
     1322        set(handles.PanelVectors,'Visible','off')
     1323        pos=get(handles.PanelScalar,'Position');
     1324        pos(1)=2;
     1325        pos_coord=get(handles.Coordinates,'Position');
     1326        pos(2)=pos_coord(2)-pos(4)-2;
     1327        set(handles.PanelScalar,'Position',pos)
     1328        set(handles.YVarName,'Visible','on')
     1329        set(handles.Y_title,'Visible','on')
    15061330    case 'vectors'
    15071331        set(handles.Panel1Dplot,'Visible','off')
    1508     set(handles.PanelScalar,'Visible','off')
    1509     set(handles.PanelVectors,'Visible','on')
    1510     pos=get(handles.PanelVectors,'Position');
    1511          pos(1)=2;
    1512          pos_coord=get(handles.Coordinates,'Position');
    1513          pos(2)=pos_coord(2)-pos(4)-2;
    1514          set(handles.PanelVectors,'Position',pos)
    1515     set(handles.YVarName,'Visible','on')
    1516     set(handles.Y_title,'Visible','on')
    1517 end
    1518 % hObject    handle to FieldOption (see GCBO)
    1519 % eventdata  reserved - to be defined in a future version of MATLAB
    1520 % handles    structure with handles and user data (see GUIDATA)
    1521 
    1522 % Hints: contents = get(hObject,'String') returns FieldOption contents as cell array
    1523 %        contents{get(hObject,'Value')} returns selected item from FieldOption
    1524 
    1525 
    1526 % --- Executes on button press in CheckDimensionX.
    1527 function CheckDimensionX_Callback(hObject, eventdata, handles)
    1528 % hObject    handle to CheckDimensionX (see GCBO)
    1529 % eventdata  reserved - to be defined in a future version of MATLAB
    1530 % handles    structure with handles and user data (see GUIDATA)
    1531 
    1532 % Hint: get(hObject,'Value') returns toggle state of CheckDimensionX
    1533 
    1534 
    1535 % --- Executes on button press in checkbox25.
    1536 function checkbox25_Callback(hObject, eventdata, handles)
    1537 % hObject    handle to checkbox25 (see GCBO)
    1538 % eventdata  reserved - to be defined in a future version of MATLAB
    1539 % handles    structure with handles and user data (see GUIDATA)
    1540 
    1541 % Hint: get(hObject,'Value') returns toggle state of checkbox25
    1542 
    1543 
    1544 % --- Executes on button press in checkbox26.
    1545 function checkbox26_Callback(hObject, eventdata, handles)
    1546 % hObject    handle to checkbox26 (see GCBO)
    1547 % eventdata  reserved - to be defined in a future version of MATLAB
    1548 % handles    structure with handles and user data (see GUIDATA)
    1549 
    1550 % Hint: get(hObject,'Value') returns toggle state of checkbox26
    1551 
    1552 
    1553 % --- Executes on button press in checkbox27.
    1554 function checkbox27_Callback(hObject, eventdata, handles)
    1555 % hObject    handle to checkbox27 (see GCBO)
    1556 % eventdata  reserved - to be defined in a future version of MATLAB
    1557 % handles    structure with handles and user data (see GUIDATA)
    1558 
    1559 % Hint: get(hObject,'Value') returns toggle state of checkbox27
    1560 
    1561 
    1562 % --- Executes on button press in checkbox29.
    1563 function checkbox29_Callback(hObject, eventdata, handles)
    1564 % hObject    handle to checkbox29 (see GCBO)
    1565 % eventdata  reserved - to be defined in a future version of MATLAB
    1566 % handles    structure with handles and user data (see GUIDATA)
    1567 
    1568 % Hint: get(hObject,'Value') returns toggle state of checkbox29
     1332        set(handles.PanelScalar,'Visible','off')
     1333        set(handles.PanelVectors,'Visible','on')
     1334        pos=get(handles.PanelVectors,'Position');
     1335        pos(1)=2;
     1336        pos_coord=get(handles.Coordinates,'Position');
     1337        pos(2)=pos_coord(2)-pos(4)-2;
     1338        set(handles.PanelVectors,'Position',pos)
     1339        set(handles.YVarName,'Visible','on')
     1340        set(handles.Y_title,'Visible','on')
     1341end
  • trunk/src/interp2_uvmat.m

    r19 r646  
     1%'interp2_uvmat': linearly interpolate an image or scalar defined on a regular grid
     2%--------------------------------------------------------------------
     3%OUTPUT:
     4% A_out: matrix of interpolated values at positions (XIMA,YIMA)
     5%
     6%INPUT:
    17% A matrix (npy,npx) to interpolate
    28%XIMA: matrix of non-integer x index values (npY,npX)
    39%YIMA: matrix of non-integer y index values (npY,npX), (with the same size as XIMA)
     10
    411function A_out=interp2_uvmat(A,XIMA,YIMA)
    512npx=size(A,2);
    613npy=size(A,1);
    714npX=size(XIMA,2);
    8 npY=size(XIMA,1)
     15npY=size(XIMA,1);
    916XIMA=reshape(XIMA,1,npX*npY)+0.5;%indices corresponding to XIMA, reshaped in a matlab vector
    1017YIMA=reshape(YIMA,1,npX*npY)+0.5;%indices corresponding to XIMA, reshaped in a matlab vector
  • trunk/src/mask_proj.m

    r639 r646  
    1 %'mask_proj': projects the field on a projection object
     1%'mask_proj': restrict input fields to a mask region, set to 0 outside
    22%--------------------------------------------------------------------------
    3 %  function [ProjData,errormsg]=proj_field(FieldData,ObjectData)
     3%  function [ProjData,errormsg]=mask_proj(FieldData,MaskData)
    44%
    55%AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
  • trunk/src/nomtype2pair.m

    r595 r646  
    1 %'nomtype2pair': creates nomencalture for index pairs knowing the image nomenclature, used by series fct
     1%'nomtype2pair': creates nomenclature for index pairs knowing the image nomenclature, used by series fct
    22%---------------------------------------------------------------------
    33% NomTypeOut=nomtype2pair(NomTypeIn)
  • trunk/src/proj_field.m

    r644 r646  
    538538    end
    539539end
     540%
     541%
     542%     x = a \ \cosh \mu \ \cos \nu
     543%
     544%     y = a \ \sinh \mu \ \sin \nu
     545
    540546
    541547%% group the variables (fields of 'FieldData') in cells of variables with the same dimensions
  • trunk/src/set_object.m

    r630 r646  
    698698function HELP_Callback(hObject, eventdata, handles)
    699699%------------------------------------------------------------------------
    700 path_to_uvmat=which ('uvmat');% check the path of uvmat
    701 pathelp=fileparts(path_to_uvmat);
    702 helpfile=fullfile(pathelp,'uvmat_doc','uvmat_doc.html');
    703 if ~isempty(dir(helpfile)), msgbox_uvmat('ERROR','Please put the help file uvmat_doc.html in the sub-directory /uvmat_doc of the UVMAT package')
    704     addpath (fullfile(pathelp,'uvmat_doc'))
    705     web([helpfile '#set_object'])
    706 end
     700web('http://servforge.legi.grenoble-inp.fr/projects/soft-uvmat/wiki/UvmatHelp#a6-Projectionobjects:')
     701% path_to_uvmat=which ('uvmat');% check the path of uvmat
     702% pathelp=fileparts(path_to_uvmat);
     703% helpfile=fullfile(pathelp,'uvmat_doc','uvmat_doc.html');
     704% if ~isempty(dir(helpfile)), msgbox_uvmat('ERROR','Please put the help file uvmat_doc.html in the sub-directory /uvmat_doc of the UVMAT package')
     705%     addpath (fullfile(pathelp,'uvmat_doc'))
     706%     web([helpfile '#set_object'])
     707% end
    707708%------------------------------------------------------------------------
    708709
  • trunk/src/uigetfile_uvmat.m

    r644 r646  
    1 %'uigetfile_uvmat': browser faster than the Matlab fct uigetfile
     1%'uigetfile_uvmat': browser, and display of directories, faster than the Matlab fct uigetfile
    22%------------------------------------------------------------------------
    33% hfig=uigetfile_uvmat(OutputDir,option)
  • trunk/src/uvmat.m

    r644 r646  
    190190LowY=round(ScreenSize(4)/2-Height/2); % put at the middle height on the screen
    191191set(hObject,'Position',[LeftX LowY Width Height])
    192 
    193 %set(hObject,'Units','Normalized')
    194 
    195 %UvData.OpenParam.PosColorbar=[0.8450    0.0900    0.0190    0.3600];
    196192UvData.OpenParam.PosColorbar=[0.80 0.02 0.018 0.445];
    197 %UvData.OpenParam.PosSetObject=[-0.05 -0.03 0.3 0.7]; %position for set_object
    198193UvData.OpenParam.PosGeometryCalib=[0.95 -0.03 0.28 1 ];%position for geometry_calib (TO IMPROVE)
    199 % UvData.OpenParam.CalSize=[0.28 1];
    200 % UvData.PlotAxes=[];%initiate the record of plotted field
    201 % UvData.axes2=[];
    202 % UvData.axes1=[];
    203194AxeData.LimEditBox=1; %initialise AxeData
    204195set(handles.PlotAxes,'UserData',AxeData)
     196% position of table Coord_y
     197set(handles.Coord_y,'Unit','pixel')
     198Pos=get(handles.Coord_y,'Position');
     199set(handles.Coord_y,'Unit','normalized')
     200set(handles.Coord_y,'ColumnWidth',{Pos(3)})
     201set(handles.Coord_y,'ColumnFormat',{'char'})
     202set(handles.Coord_y,'ColumnEditable',false)
     203set(handles.Coord_y,'ColumnName',{''})
    205204
    206205%% set functions for the mouse and keyboard
     
    344343ColumnWidth=max(150,0.18*size_fig(3));
    345344ColumnWidth=min(ColumnWidth,250); % width of the right side display column, between 150 and 250, depending on the fig width
    346 % Data=get(handles.uvmat,'UserData');
    347 % Data.GUISize=size_fig;
    348 % set(handles.uvmat,'UserData',Data)
    349 
    350345
    351346%% position of panel InputFile
    352 %set(handles.InputFile,'Units','pixels')
     347set(handles.InputFile,'Units','pixels')
    353348pos_InputFile=get(handles.InputFile,'Position');% [lower x lower y width height] for text_display
    354349pos_InputFile(1)=0;
    355350pos_InputFile(2)=size_fig(4)-pos_InputFile(4);             % set frame InputFile to the top of the fig
    356351pos_InputFile(3)=size_fig(3);
    357 
    358352set(handles.InputFile,'Position',pos_InputFile);% [lower x lower y width height] for text_display
    359353
    360354%% reset position of text_display or TableDisplay
    361355if strcmp(get(handles.TableDisplay,'Visible'),'off')
     356    set(handles.text_display,'Units','pixels')
    362357    pos_1=get(handles.text_display,'Position');% [lower x lower y width height] for text_display
    363358        pos_1(3)=1.2*ColumnWidth;
     
    367362    % reset position of TableDisplay
    368363else
     364    set(handles.TableDisplay,'Units','pixels')
    369365    pos_1=get(handles.TableDisplay,'Position');
    370366    pos_1(3)=1.2*ColumnWidth;
     
    381377
    382378%% reset position of Coordinates
     379set(handles.Coordinates,'Units','pixels')
    383380pos_2=get(handles.Coordinates,'Position');% [lower x lower y width height] for frame 'Coordinates'
    384381pos_2(3)=ColumnWidth;
     
    388385
    389386%% reset position of  Scalar
     387set(handles.Scalar,'Units','pixels')
    390388pos_3=get(handles.Scalar,'Position'); % [lower x lower y width height] for frame 'Scalar'
    391389pos_3(3)=ColumnWidth;
     
    415413pos(3)=0.77*size_fig(3)-1.2*ColumnWidth;
    416414pos(4)=size_fig(4)-60;
     415set(handles.PlotAxes,'Units','pixels')
    417416set(handles.PlotAxes,'Position',pos)
    418417
     
    10941093%% update the data attached to the uvmat interface
    10951094if ~isempty(TimeUnit)
    1096     set(handles.time_txt,'String',['time (' TimeUnit ')'])
     1095    set(handles.time_var,'String',['time (' TimeUnit ')'])
    10971096end
    10981097UvData.TimeUnit=TimeUnit;
     
    11091108switch FileType
    11101109    case {'civx','civdata'}
    1111 %         [FieldList,ColorList]=calc_field;
    11121110        [FieldList,ColorList]=set_field_list('U','V','C');
    11131111        set(handles_Fields,'String',[{'image'};FieldList;{'get_field...'}]);%standard menu for civx data
     
    11211119        set(handles.Vectors,'Visible','on')
    11221120        set(handles.Coord_x,'Value',1);
    1123         set(handles.Coord_x,'String',{'X'});
    1124         set(handles.Coord_y,'Value',1);
    1125         set(handles.Coord_y,'String',{'Y'});
     1121        set(handles.Coord_x,'String','X');
     1122%         set(handles.Coord_y,'Value',1);
     1123        set(handles.Coord_y,'Data',{'Y'});
    11261124    case 'netcdf'
    11271125        set(handles_Fields,'Value',1)
    11281126        set(handles_Fields,'String',{'get_field...'})
    11291127        FieldName_Callback([],[], handles)
    1130 %         hget_field=get_field(FileName);
    1131 %         hhget_field=guidata(hget_field);
    1132 %         get_field('RUN_Callback',hhget_field.RUN,[],hhget_field);
    11331128    otherwise
    11341129        set(handles_Fields,'Value',1) % set menu to 'image'
    11351130        set(handles_Fields,'String',{'image'})
    11361131        set(handles.Coord_x,'Value',1);
    1137         set(handles.Coord_x,'String',{'AX'});
    1138         set(handles.Coord_y,'Value',1);
    1139         set(handles.Coord_y,'String',{'AY'});
     1132        set(handles.Coord_x,'String','AX');
     1133    set(handles.Coord_y,'Data',{'AY'});
    11401134end
    11411135set(handles.uvmat,'UserData',UvData)
     
    21182112        list_fields=get(handles.FieldName,'String');% list menu fields
    21192113        FieldName= list_fields{get(handles.FieldName,'Value')}; % selected field
    2120         % if get_field... is selected, the GUI get_field will be used to enter fields
    21212114        if ~strcmp(FieldName,'get_field...')
    21222115            if get(handles.FixVelType,'Value')
     
    21642157        ParamIn.Coord_x=XNameMenu(get(handles.Coord_x,'Value'));
    21652158    end
    2166     YNameMenu=get(handles.Coord_y,'String');
    2167     if ~isempty(YNameMenu)
    2168         ParamIn.Coord_y=YNameMenu(get(handles.Coord_y,'Value'));
    2169     end
     2159   % YNameMenu=get(handles.Coord_y,'String');
     2160    ParamIn.Coord_y=get(handles.Coord_y,'Data');
     2161%     if ~isempty(YNameMenu)
     2162%         ParamIn.Coord_y=YNameMenu(get(handles.Coord_y,'Value'));
     2163%     end
    21702164end
    21712165check_tps = 0;         
     
    22712265                &&~strcmp(ParamOut_1.FieldName,'velocity') && ~strcmp(ParamOut_1.FieldName,'get_field...')
    22722266            if ~check_proj_tps
    2273              %   Field{2}=calc_field([{ParamOut_1.FieldName} {ParamOut_1.ColorVar}],Field{2});
    22742267            end
    22752268        end
     
    22892282%% update the display menu for the first velocity type (first menuline)
    22902283test_veltype=0;
    2291 % if ~isequal(FileType,'netcdf')|| isequal(FieldName,'get_field...')
    22922284if (strcmp(UvData.FileType{1},'civx')||strcmp(UvData.FileType{1},'civdata'))&& ~strcmp(FieldName,'get_field...')
    22932285    test_veltype=1;
     
    31653157    [RootPath,SubDir,RootFile,FileIndices,FileExt]=read_file_boxes(handles);
    31663158    FileName=[fullfile(RootPath,SubDir,RootFile) FileIndices FileExt];
    3167 %     hget_field=findobj(allchild(0),'name','get_field');
    3168 %     if ~isempty(hget_field)
    3169 %         delete(hget_field)
    3170 %     end
    31713159    GetFieldData=get_field(FileName,ParamIn);
    31723160    FieldList={};
    31733161    VecColorList={};
    3174     XName=GetFieldData.XVarName;
    3175     if GetFieldData.CheckVector
     3162    XName=GetFieldData.Coordinates.XVarName;
     3163    switch GetFieldData.FieldOption
     3164        case 'vectors'
    31763165        UName=GetFieldData.PanelVectors.vector_x;
    31773166        VName=GetFieldData.PanelVectors.vector_y;
    3178         XName=GetFieldData.XVarName;
    3179         YName=GetFieldData.YVarName;
     3167        XName=GetFieldData.Coordinates.XVarName;
     3168        YName=GetFieldData.Coordinates.YVarName;
    31803169        CName=GetFieldData.PanelVectors.vec_color;
    31813170        [FieldList,VecColorList]=set_field_list(UName,VName,CName);
    3182     elseif GetFieldData.CheckScalar
     3171        case 'scalar'
    31833172        AName=GetFieldData.PanelScalar.scalar;
    3184         XName=GetFieldData.XVarName;
    3185         YName=GetFieldData.YVarName;
     3173        XName=GetFieldData.Coordinates.XVarName;
     3174        YName=GetFieldData.Coordinates.YVarName;
    31863175        FieldList={AName};
    3187     elseif GetFieldData.CheckPlot1D;
     3176        case '1D plot'
    31883177        YName=GetFieldData.CheckPlot1D.ordinate;
    31893178    end
     
    52755264Param.Coord_x_str=get(handles.Coord_x,'String');
    52765265Param.Coord_x_val=get(handles.Coord_x,'Value');
    5277 Param.Coord_y_str=get(handles.Coord_y,'String');
    5278 Param.Coord_y_val=get(handles.Coord_y,'Value');
     5266%Param.Coord_y_str=get(handles.Coord_y,'String');
     5267Param.Coord_y_str=get(handles.Coord_y,'Data');
     5268%Param.Coord_y_val=get(handles.Coord_y,'Value');
    52795269series(Param); %run the series interface
    52805270
     
    52905280function MenuHelp_Callback(hObject, eventdata, handles)
    52915281% --------------------------------------------------------------------
    5292 path_to_uvmat=which ('uvmat');% check the path of uvmat
    5293 pathelp=fileparts(path_to_uvmat);
    5294 helpfile=fullfile(pathelp,'uvmat_doc','uvmat_doc.html');
    5295 if isempty(dir(helpfile)), msgbox_uvmat('ERROR','Please put the help file uvmat_doc.html in the sub-directory /uvmat_doc of the UVMAT package')
    5296 else
    5297     addpath (fullfile(pathelp,'uvmat_doc'))
    5298     web(helpfile);
    5299 end
     5282web('http://servforge.legi.grenoble-inp.fr/projects/soft-uvmat/wiki/UvmatHelp')
     5283
     5284% path_to_uvmat=which ('uvmat');% check the path of uvmat
     5285% pathelp=fileparts(path_to_uvmat);
     5286% helpfile=fullfile(pathelp,'uvmat_doc','uvmat_doc.html');
     5287% if isempty(dir(helpfile)), msgbox_uvmat('ERROR','Please put the help file uvmat_doc.html in the sub-directory /uvmat_doc of the UVMAT package')
     5288% else
     5289%     addpath (fullfile(pathelp,'uvmat_doc'))
     5290%     web(helpfile);
     5291% end
    53005292
    53015293% --- Executes on selection change in Coord_y.
     
    54235415    end
    54245416end
     5417
     5418
     5419
     5420function time_var_1_Callback(hObject, eventdata, handles)
     5421% hObject    handle to time_var_1 (see GCBO)
     5422% eventdata  reserved - to be defined in a future version of MATLAB
     5423% handles    structure with handles and user data (see GUIDATA)
     5424
     5425% Hints: get(hObject,'String') returns contents of time_var_1 as text
     5426%        str2double(get(hObject,'String')) returns contents of time_var_1 as a double
     5427
     5428
     5429% --- Executes during object creation, after setting all properties.
     5430function time_var_1_CreateFcn(hObject, eventdata, handles)
     5431% hObject    handle to time_var_1 (see GCBO)
     5432% eventdata  reserved - to be defined in a future version of MATLAB
     5433% handles    empty - handles not created until after all CreateFcns called
     5434
     5435% Hint: edit controls usually have a white background on Windows.
     5436%       See ISPC and COMPUTER.
     5437if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
     5438    set(hObject,'BackgroundColor','white');
     5439end
Note: See TracChangeset for help on using the changeset viewer.