Changeset 937
- Timestamp:
- Mar 30, 2016, 11:04:43 PM (9 years ago)
- Location:
- trunk/src
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/plot_object.m
r924 r937 448 448 switch ObjectData.Type 449 449 case 'points' 450 hh=line(ObjectData.Coord(:,1),ObjectData.Coord(:,2),'Color',col,'LineStyle',' .','Marker','+');450 hh=line(ObjectData.Coord(:,1),ObjectData.Coord(:,2),'Color',col,'LineStyle','none','Marker','+'); 451 451 for ipt=1:length(xline) 452 452 PlotData.DeformPoint(ipt)=line(ObjectData.Coord(ipt,1),ObjectData.Coord(ipt,2),'Color',... 453 col,'LineStyle',' .','SelectionHighlight','off','UserData',hh,'Tag','DeformPoint');453 col,'LineStyle','none','SelectionHighlight','off','UserData',hh,'Tag','DeformPoint'); 454 454 %create circle around each point 455 455 if ~isequal(YMax,0) -
trunk/src/proj_field.m
r936 r937 2239 2239 eval(['ProjData.' VarName '=reshape(vec_B,npY,npX,nbcolor);']); 2240 2240 end 2241 ProjData.FF=reshape(~flagin,npY,npX);%false flag A FAIRE: tenir compte d'un flga ant ï¿œrieur2241 ProjData.FF=reshape(~flagin,npY,npX);%false flag A FAIRE: tenir compte d'un flga ant???rieur 2242 2242 ProjData.ListVarName=[ProjData.ListVarName 'FF']; 2243 2243 ProjData.VarDimName=[ProjData.VarDimName {DimCell}]; -
trunk/src/series.m
r935 r937 467 467 %% look for the previously opened file 'oldfile' 468 468 InputTable=get(handles.InputTable,'Data'); 469 RootPathCell=InputTable(:,1); 470 SubDirCell=InputTable(:,2); 469 if ~isempty(InputTable) 471 470 oldfile=fullfile(InputTable{1,1},InputTable{1,2}); 472 if isempty(oldfile) 471 else 473 472 % use a file name stored in prefdir 474 473 dir_perso=prefdir; … … 476 475 if exist(profil_perso,'file') 477 476 h=load (profil_perso); 478 if isfield(h,' RootPath') && ischar(h.RootPath)479 oldfile=h. RootPath;477 if isfield(h,'MenuCampaign') && ~isempty(h.MenuCampaign)&& ischar(h.MenuCampaign{1}) 478 oldfile=h.MenuCampaign{1}; 480 479 end 481 480 end … … 519 518 REFRESH_Callback(hObject, eventdata, handles) 520 519 521 522 % %------------------------------------------------------------------------523 % % --- fct activated by the browser under 'Open campaign/Browse...'524 % %------------------------------------------------------------------------525 % function MenuBrowseCampaignAppend_Callback(hObject, eventdata, handles)526 % append='append';527 % browse_campaign(handles,append);528 529 % %------------------------------------------------------------------------530 % function browse_campaign(handles,append);531 %532 % %% look for the previously opened file 'oldfile'533 %534 % %535 % %536 % % InputTable=get(handles.InputTable,'Data');537 % % RootPath=InputTable{1,1};538 % % CampaignPath=fileparts(fileparts(RootPath));539 % % DirFull=uigetfile_uvmat('define this path as the Campaign folder:',CampaignPath,'uigetdir');540 % % if ~ischar(DirFull)|| ~exist(DirFull,'dir')541 % % return542 % % end543 % OutPut=browse_data(oldfile);% open the GUI browse_data to get select a campaign dir, experiment and device544 % if ~isfield(OutPut,'Campaign')545 % return546 % end547 % DirName=fullfile(OutPut.Campaign,OutPut.Experiment{1},OutPut.DataSeries{1});548 % ListStruct=dir(DirName); %list files and the dir DataSeries549 % % select the first appropriate file in the dir550 % FileName='';551 % for ilist=1:numel(ListStruct)552 % if ~isequal(ListStruct(ilist).isdir,1)%look for files, not dir553 % FileName=ListStruct(ilist).name;554 % FileInfo=get_file_info(fullfile(DirName,FileName));555 % switch FileInfo.FileType556 % case {'image','multimage','civx','civdata','netcdf'}557 % break558 % end559 % end560 % end561 % if isempty(FileName)562 % msgbox_uvmat('ERROR',['no appropriate input file in the DataSeries folder ' fullfile(DirName)])563 % return564 % end565 %566 % %% update the list of campaigns in the menubar567 % MenuCampaign=[{get(handles.MenuCampaign_1,'Label')};{get(handles.MenuCampaign_2,'Label')};...568 % {get(handles.MenuCampaign_3,'Label')};{get(handles.MenuCampaign_4,'Label')};{get(handles.MenuCampaign_5,'Label')}];569 % check_dir=isempty(find(strcmp(DirName,MenuCampaign)));570 % if check_dir %insert the new campaign in the list if it is not found571 % MenuCampaign(end)=[]; %suppress the last item572 % MenuCampaign=[{DirName};MenuCampaign];%insert the new campaign573 % for ilist=1:numel(MenuCampaign)574 % set(handles.(['MenuCampaign_' num2str(ilist)]),'Label',MenuCampaign{ilist})575 % end576 % % save the list for future opening:577 % dir_perso=prefdir;578 % profil_perso=fullfile(dir_perso,'uvmat_perso.mat');579 % if exist(profil_perso,'file')580 % save (profil_perso,'MenuCampaign','-append'); %store the file names for future opening of uvmat581 % else582 % save (profil_perso,'MenuCampaign','-V6'); %store the file names for future opening of uvmat583 % end584 % end585 %586 % %% display the selected field and related information587 % if get(handles.CheckAppend,'Value')588 % display_file_name(handles,fullfile(DirName,FileName),'append')589 % else590 % display_file_name(handles,fullfile(DirName,FileName),'one')591 % end592 % set(handles.MenuOpenCampaign,'ForegroundColor',[0 0 0])593 594 520 % -------------------------------------------------------------------- 595 521 function MenuCampaign_Callback(hObject, eventdata, handles) 596 522 % -------------------------------------------------------------------- 597 set(handles.MenuOpenCampaign,'ForegroundColor',[1 1 0]) 523 598 524 OutPut=browse_data(get(hObject,'Label'),'on','on');% open the GUI browse_data to get select a campaign dir, experiment and device 599 525 if ~isfield(OutPut,'Campaign') … … 636 562 set(handles.InputTable,'Data',InputTable) 637 563 REFRESH_Callback(hObject, eventdata, handles) 638 639 640 % DirName=fullfile(OutPut.Campaign,OutPut.Experiment{1},OutPut.DataSeries{1});641 % hdir=dir(DirName); %list files and dirs642 % for ilist=1:numel(hdir)643 % if ~isequal(hdir(ilist).isdir,1)%look for files, not dir644 % FileName=hdir(ilist).name;645 % FileInfo=get_file_info(fullfile(DirName,FileName));646 % switch FileInfo.FileType647 % case {'image','multimage','civx','civdata','netcdf'}648 % break649 % end650 % end651 % end652 % if get(handles.CheckAppend,'Value')653 % display_file_name(handles,fullfile(DirName,FileName),'append')654 % else655 % display_file_name(handles,fullfile(DirName,FileName),'one')656 % end657 % set(handles.MenuOpenCampaign,'ForegroundColor',[0 0 0])658 564 659 565 … … 816 722 817 723 %% enable other menus and uicontrols 818 set(handles.MenuOpenCampaign,'Enable','on')724 % set(handles.MenuOpenCampaign,'Enable','on') 819 725 set(handles.MenuCampaign_1,'Enable','on') 820 726 set(handles.MenuCampaign_2,'Enable','on') … … 1006 912 ref_i=1; 1007 913 if isfield(SeriesData,'ref_i') 1008 ref_i=SeriesData.ref_i;914 ref_i=SeriesData.ref_i; 1009 915 end 1010 916 if isempty(first_i) … … 1019 925 ref_j=1; 1020 926 if isfield(SeriesData,'ref_j') 1021 ref_j=SeriesData.ref_j;927 ref_j=SeriesData.ref_j; 1022 928 end 1023 929 if isempty(first_j) … … 1046 952 last_j=first_j; 1047 953 end 1048 set(handles.num_first_i,'String',num2str(first_i)); 954 set(handles.num_first_i,'String',num2str(first_i)); 1049 955 set(handles.num_first_j,'String',num2str(first_j)); 1050 set(handles.num_last_i,'String',num2str(last_i)); 956 set(handles.num_last_i,'String',num2str(last_i)); 1051 957 set(handles.num_last_j,'String',num2str(last_j)); 1052 958 1053 959 %% number of slices set by default 1054 NbSlice= 1;%default960 NbSlice=[];%default 1055 961 % read value set by the first series for the append mode (iwiew >1) 1056 962 if iview>1 && strcmp(get(handles.num_NbSlice,'Visible'),'on') 1057 NbSlice=str2 num(get(handles.num_NbSlice,'String'));963 NbSlice=str2double(get(handles.num_NbSlice,'String')); 1058 964 end 1059 965 … … 1061 967 TimeUnit=''; 1062 968 % read value set by the first series for the append mode (iwiew >1) 1063 if iview>1 969 if iview>1 1064 970 TimeUnit=get(handles.TimeUnit,'String'); 1065 971 end … … 1078 984 [XmlData,errormsg]=imadoc2struct(XmlFileName); 1079 985 if ~isempty(errormsg) 1080 986 msgbox_uvmat('WARNING',['error in reading ' XmlFileName ': ' errormsg]); 1081 987 end 1082 988 % read time if available 1083 989 if isfield(XmlData,'Time') 1084 990 Time=XmlData.Time; 1085 991 TimeName='xml'; 1086 992 end 1087 993 if isfield(XmlData,'Camera') 1088 if isfield(XmlData.Camera,'NbSlice')&& ~isempty(XmlData.Camera.NbSlice)1089 if iview>1 && ~isempty(NbSlice) && ~strcmp(NbSlice,XmlData.Camera.NbSlice)1090 msgbox_uvmat('WARNING','inconsistent number of slices with the first field series');1091 end1092 NbSlice=XmlData.Camera.NbSlice;% Nbre of slices from camera1093 end994 % if isfield(XmlData.Camera,'NbSlice')&& ~isempty(XmlData.Camera.NbSlice) 995 % if iview>1 && ~isempty(NbSlice) && ~strcmp(NbSlice,XmlData.Camera.NbSlice) 996 % msgbox_uvmat('WARNING','inconsistent number of slices with the first field series'); 997 % end 998 % NbSlice=XmlData.Camera.NbSlice;% Nbre of slices from camera 999 % end 1094 1000 if isfield(XmlData.Camera,'TimeUnit')&& ~isempty(XmlData.Camera.TimeUnit) 1095 1001 if iview>1 && ~isempty(TimeUnit) && ~strcmp(TimeUnit,XmlData.Camera.TimeUnit) … … 1100 1006 end 1101 1007 % number of slices 1008 if isfield(XmlData,'TranslationMotor')&& isfield(XmlData.TranslationMotor,'NbSlice') 1009 NbSlice_motor=XmlData.TranslationMotor.NbSlice; 1010 if ~isempty(NbSlice) && ~isequal(NbSlice_motor,NbSlice) 1011 msgbox_uvmat('WARNING','inconsistent Z numbers of Z indices'); 1012 else 1013 NbSlice=NbSlice_motor; 1014 end 1015 end 1016 1102 1017 if isfield(XmlData,'GeometryCalib') 1103 1018 check_calib=1; 1104 1019 if isfield(XmlData.GeometryCalib,'SliceCoord') 1105 1020 siz=size(XmlData.GeometryCalib.SliceCoord); 1106 if siz(1)>1 1107 if iview>1 && ~isempty(NbSlice) && ~strcmp(NbSlice,siz(1)) 1108 msgbox_uvmat('WARNING','inconsistent number of Z indices with the first field series'); 1109 end 1021 if ~isempty(NbSlice)&& ~isequal(size(1),NbSlice) 1022 msgbox_uvmat('WARNING','inconsistent numbers of Z indices between motor and calibration'); 1023 else 1110 1024 NbSlice=siz(1); 1111 1025 end 1112 1026 end 1113 1027 end 1114 set(handles.num_NbSlice,'String',num2str(NbSlice)) 1028 end 1029 if ~isempty(NbSlice) 1030 set(handles.num_NbSlice,'String',num2str(NbSlice)) 1031 set(handles.num_NbSlice,'Visible','on') 1115 1032 end 1116 1033 … … 2013 1930 '#!/bin/bash \n'... 2014 1931 '. /etc/sysprofile \n'... 1932 'module load matlab/8.6 \n'...% CHOICE OF MATLAB VERSION 2015 1933 'matlab -nodisplay -nosplash -nojvm -logfile ''' filelog{iprocess} ''' <<END_MATLAB \n'... 2016 1934 'addpath(''' path_series '''); \n'... -
trunk/src/series/merge_proj.m
r924 r937 381 381 end 382 382 383 else 384 MergeData.ListGlobalAttribute={'Conventions','Project','InputFile_1','InputFile_end',' nb_coord','nb_dim'};383 else %output as netcdf files 384 MergeData.ListGlobalAttribute={'Conventions','Project','InputFile_1','InputFile_end','NbCoord','NbDim'}; 385 385 MergeData.Conventions='uvmat'; 386 MergeData.nb_coord=2; 387 MergeData.nb_dim=2; 388 dt=[]; 389 if isfield(Data{1},'dt')&& isnumeric(Data{1}.dt) 390 dt=Data{1}.dt; 386 MergeData.NbCoord=2; 387 MergeData.NbDim=2; 388 % time interval of PIV 389 Dt=[]; 390 if isfield(Data{1},'Dt')&& isnumeric(Data{1}.Dt) 391 Dt=Data{1}.Dt; 391 392 end 392 393 for iview =2:numel(Data) 393 if ~(isfield(Data{iview},' dt')&& isequal(Data{iview}.dt,dt))394 dt=[];%dt not the same for all fields394 if ~(isfield(Data{iview},'Dt')&& isequal(Data{iview}.Dt,Dt)) 395 Dt=[];%dt not the same for all fields 395 396 end 396 397 end … … 399 400 MergeData.Time=timeread; 400 401 end 401 if ~isempty(dt) 402 MergeData.ListGlobalAttribute=[MergeData.ListGlobalAttribute {'dt'}]; 403 MergeData.dt=dt; 402 % position of projection plane 403 if isfield(Data{1},'ProjObjectCoord')&& isfield(Data{1},'ProjObjectAngle') 404 'test' 405 ProjObjectCoord=Data{1}.ProjObjectCoord; 406 ProjObjectAngle=Data{1}.ProjObjectAngle; 407 for iview =2:numel(Data) 408 if ~(isfield(Data{iview},'ProjObjectCoord')&& isequal(Data{iview}.ProjObjectCoord,ProjObjectCoord))... 409 ||~(isfield(Data{iview},'ProjObjectAngle')&& isequal(Data{iview}.ProjObjectAngle,ProjObjectAngle)) 410 ProjObjectCoord=[];%dt not the same for all fields 411 end 412 end 413 if ~isempty(ProjObjectCoord) 414 MergeData.ListGlobalAttribute=[MergeData.ListGlobalAttribute {'ProjObjectCoord'} {'ProjObjectAngle'}]; 415 MergeData.ProjObjectCoord=ProjObjectCoord; 416 MergeData.ProjObjectAngle=ProjObjectAngle; 417 end 418 end 419 % coord unit 420 if isfield(Data{1},'CoordUnit') 421 CoordUnit=Data{1}.CoordUnit; 422 for iview =2:numel(Data) 423 if ~(isfield(Data{iview},'CoordUnit')&& isequal(Data{iview}.CoordUnit,CoordUnit)) 424 CoordUnit=[];%CoordUnit not the same for all fields 425 end 426 end 427 if ~isempty(CoordUnit) 428 MergeData.ListGlobalAttribute=[MergeData.ListGlobalAttribute {'CoordUnit'}]; 429 MergeData.CoordUnit=CoordUnit; 430 end 431 end 432 % time unit 433 if isfield(Data{1},'TimeUnit') 434 TimeUnit=Data{1}.TimeUnit; 435 for iview =2:numel(Data) 436 if ~(isfield(Data{iview},'TimeUnit')&& isequal(Data{iview}.TimeUnit,TimeUnit)) 437 TimeUnit=[];%TimeUnit not the same for all fields 438 end 439 end 440 if ~isempty(TimeUnit) 441 MergeData.ListGlobalAttribute=[MergeData.ListGlobalAttribute {'TimeUnit'}]; 442 MergeData.TimeUnit=TimeUnit; 443 end 404 444 end 405 445 error=struct2nc(OutputFile,MergeData);%save result file -
trunk/src/uvmat.m
r936 r937 1213 1213 1214 1214 %% read the content of the GUI set_slice 1215 SliceData=read_GUI(get(hObject,'parent')); 1215 hset_slice=get(hObject, 'parent'); 1216 hZ=findobj(hset_slice,'Tag','num_Z_1'); 1217 Z_plane=str2num(get(hZ,'String'));% set of Z positions explicitly entered as a Matlab vector 1218 SliceData=read_GUI(hset_slice); 1216 1219 GeometryCalib.NbSlice=SliceData.NbSlice; 1217 1220 GeometryCalib.CheckVolumeScan=SliceData.CheckVolumeScan; 1218 Z_plane=linspace(SliceData.Z(1),SliceData.Z(2),SliceData.NbSlice); 1221 if numel(Z_plane)<=2 1222 Z_plane=linspace(SliceData.Z(1),SliceData.Z(2),SliceData.NbSlice); 1223 else 1224 set(hZ,'String',num2str(Z_plane))% restitute the display qfter reqding by read_GUI 1225 end 1219 1226 GeometryCalib.SliceCoord=Z_plane'*[0 0 1]; 1220 1227 GeometryCalib.SliceAngle=zeros(GeometryCalib.NbSlice,3);
Note: See TracChangeset
for help on using the changeset viewer.