- Timestamp:
- Jul 10, 2019, 12:17:42 PM (5 years ago)
- Location:
- trunk/src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/browse_data.m
r1068 r1069 92 92 InputDir=pwd;% current dir is the starting data series by default 93 93 end 94 95 [ExpWithPath,DataSeries]=fileparts(InputDir); 96 [Experiment,Device,Ext]=fileparts(ExpWithPath); 97 Device=[Device Ext]; 98 [SourceDir,Experiment,Ext]=fileparts(Experiment); 99 Experiment=[Experiment Ext]; 100 % [tild,CampaignName]=fileparts(Campaign); 101 % RootXml=fullfile(Campaign,[CampaignName '.xml']); 94 if ischar(InputDir),InputDir={InputDir};end 95 for ilist=1:numel(InputDir) 96 [ExpWithPath,DataSeries{ilist},Ext]=fileparts(InputDir{ilist}); 97 DataSeries{ilist}=['+/' DataSeries{ilist} Ext]; 98 [Experiment{ilist},Device{ilist},Ext]=fileparts(ExpWithPath); 99 Device{ilist}=['+/' Device{ilist} Ext]; 100 [SourceDir{ilist},Experiment{ilist},Ext]=fileparts(Experiment{ilist}); 101 Experiment{ilist}=['+/' Experiment{ilist} Ext]; 102 if ~strcmp(SourceDir{ilist},SourceDir{1})||~strcmp(Experiment{ilist},Experiment{1}) 103 msgbox_uvmat('ERROR','replicate cannot be used with multiple root folders') 104 return 105 end 106 if ~strcmp(DataSeries{ilist},DataSeries{1}) 107 set(handles.DataSeries,'enable','off') 108 end 109 if ~strcmp(Device{ilist},Device{1}) 110 set(handles.ListDevices,'enable','off') 111 end 112 end 102 113 s=[]; 103 114 % if exist(RootXml,'file') … … 111 122 % end 112 123 if isempty(s) %a source dir has been opened 113 set(handles.SourceDir,'String',SourceDir );124 set(handles.SourceDir,'String',SourceDir{1}); 114 125 set(handles.MirrorDir,'Visible','off');% no mirror dir display 115 126 set(handles.CreateMirror,'String','create_mirror') 116 127 end 117 set(handles.DataSeries,'String',{['+/' DataSeries]}); 118 set(handles.ListDevices,'String',{['+/' Device]}); 119 errormsg=scan_campaign(handles,SourceDir,['+/' Experiment]); 128 set(handles.DataSeries,'String',DataSeries); 129 set(handles.DataSeries,'Value',(1:numel(DataSeries))); 130 set(handles.ListDevices,'String',Device); 131 set(handles.ListDevices,'Value',(1:numel(Device))); 132 errormsg=scan_campaign(handles,SourceDir{1},Experiment{1}); 120 133 if ~isempty(errormsg) 121 134 msgbox_uvmat('ERROR',errormsg) … … 242 255 Device=ListDevices(list_val);%choose selected devices 243 256 end 244 [ListFiles,indices]=list_dir_2(SourceDir,ListExperiments,Device); 257 check_fix=strcmp(get(handles.ListDevices,'enable'),'off'); 258 [ListFiles,indices]=list_dir_2(SourceDir,ListExperiments,Device,check_fix); 245 259 set(handles.ListDevices,'String',ListFiles) 246 260 set(handles.ListDevices,'Value',indices)% initialise the menu selection with the folder defined by the input … … 271 285 DataSeries=[]; 272 286 end 273 [ListFiles,indices]=list_dir_3(SourceDir,ListExperiments,ListDevices,DataSeries); 287 check_fix=strcmp(get(handles.DataSeries,'enable'),'off'); 288 [ListFiles,indices]=list_dir_3(SourceDir,ListExperiments,ListDevices,DataSeries,check_fix); 274 289 set(handles.DataSeries,'String',ListFiles) 275 290 set(handles.DataSeries,'Value',indices)% initialise the menu selection with the folder defined by the input … … 346 361 % Provide a list to display 347 362 %------------------------------------------------------------------------ 348 function [ListFilesTot,indices]=list_dir_2(SourceDir,ListDir,ListSub )363 function [ListFilesTot,indices]=list_dir_2(SourceDir,ListDir,ListSub,check_fix) 349 364 ListFilesTot={}; 350 365 for ilist=1:numel(ListDir) … … 358 373 cell_remove=regexp(ListFiles,'^(-|\.|\+/\.)');% detect strings beginning by '-' ,'.' or '+/.'(dir beginning by . ) 359 374 check_keep=cellfun('isempty', cell_remove); 360 ListFilesTot=[ListFilesTot ;(ListFiles(check_keep))'];375 ListFilesTot=[ListFilesTot (ListFiles(check_keep))]; 361 376 end 362 377 end … … 370 385 indices=[indices index]; 371 386 end 387 if check_fix 388 index_init=1:numel(ListFilesTot); 389 %indices=sort(indices) 390 index_init(indices)=[]; 391 ListFilesTot=ListFilesTot([indices index_init]); 392 indices=1:numel(indices); 393 end 372 394 end 373 395 if isempty(indices), indices=1; end … … 377 399 % Provide a list to display 378 400 %------------------------------------------------------------------------ 379 function [ListFilesTot,indices]=list_dir_3(SourceDir,ListDir,ListSub,ListSubSub )401 function [ListFilesTot,indices]=list_dir_3(SourceDir,ListDir,ListSub,ListSubSub,check_fix) 380 402 ListFilesTot={}; 381 403 for ilist=1:numel(ListDir) … … 392 414 cell_remove=regexp(ListFiles,'^(-|\.|\+/\.)');% detect strings beginning by '-' ,'.' or '+/.'(dir beginning by . ) 393 415 check_keep=cellfun('isempty', cell_remove); 394 ListFilesTot=[ListFilesTot ;(ListFiles(check_keep))'];416 ListFilesTot=[ListFilesTot (ListFiles(check_keep))]; 395 417 end 396 418 end … … 406 428 indices=[indices index]; 407 429 end 430 if check_fix 431 index_init=1:numel(ListFilesTot); 432 index_init(indices)=[]; 433 ListFilesTot=ListFilesTot([indices index_init]); 434 indices=1:numel(indices); 435 end 408 436 end 409 437 if isempty(indices), indices=1; end -
trunk/src/series.m
r1068 r1069 1613 1613 for iexp=1:numel(ListExp) 1614 1614 if ~isempty(regexp(ListExp{iexp},'^\+/'))% if it is a folder 1615 for idevice=1:numel(ListDevices) 1616 if ~isempty(regexp(ListDevices{idevice},'^\+/'))% if it is a folder 1617 for isubdir=1:numel(ListDataSeries) 1618 if ~isempty(regexp(ListDataSeries{isubdir},'^\+/'))% if it is a folder 1619 lpath= fullfile(SourceDir,regexprep(ListExp{iexp},'^\+/',''),... 1620 regexprep(ListDevices{idevice},'^\+/','')); 1621 ldir= regexprep(ListDataSeries{isubdir},'^\+/',''); 1622 if exist(fullfile(lpath,ldir),'dir') 1623 NbExp=NbExp+1; 1624 ListPath{NbExp}=lpath; 1625 ListSubdir{NbExp}=ldir; 1626 ExpIndex{NbExp}=iexp; 1615 if strcmp(get(BrowseData.DataSeries,'enable'),'off');%case of a multiple input line for series 1616 NbExp=NbExp+1; 1617 ExpIndex{NbExp}=iexp; 1618 for idevice=1:numel(ListDevices) 1619 lpath= fullfile(SourceDir,regexprep(ListExp{iexp},'^\+/',''),... 1620 regexprep(ListDevices{idevice},'^\+/','')); 1621 ldir=regexprep(ListDataSeries{idevice},'^\+/',''); 1622 ListPath{idevice,NbExp}=lpath; 1623 ListSubdir{idevice,NbExp}=ldir; 1624 end 1625 else 1626 for idevice=1:numel(ListDevices) 1627 if ~isempty(regexp(ListDevices{idevice},'^\+/'))% if it is a folder 1628 for isubdir=1:numel(ListDataSeries) 1629 if ~isempty(regexp(ListDataSeries{isubdir},'^\+/'))% if it is a folder 1630 lpath= fullfile(SourceDir,regexprep(ListExp{iexp},'^\+/',''),... 1631 regexprep(ListDevices{idevice},'^\+/','')); 1632 ldir= regexprep(ListDataSeries{isubdir},'^\+/',''); 1633 if exist(fullfile(lpath,ldir),'dir') 1634 NbExp=NbExp+1; 1635 ExpIndex{NbExp}=iexp; 1636 ListPath{NbExp}=lpath; 1637 ListSubdir{NbExp}=ldir; 1638 end 1627 1639 end 1628 1640 end … … 1647 1659 end 1648 1660 set(BrowseData.ListExperiments,'Value',ExpIndex{iexp}) 1649 Param.InputTable{1,1}=ListPath{iexp}; 1650 Param.InputTable{1,2}=ListSubdir{iexp}; 1661 Param.InputTable(:,1)=ListPath(:,iexp); 1662 Param.InputTable(:,2)=ListSubdir(:,iexp); 1663 if size(Param.InputTable,1)==1% case of single input line 1651 1664 Param.OutputSubDir=ListSubdir{iexp}; 1665 end 1652 1666 set(handles.InputTable,'Data',Param.InputTable) 1653 1667 % set(handles.OutputSubDir,'String',ListSubdir{iexp}) … … 3830 3844 function Replicate_Callback(hObject, eventdata, handles) 3831 3845 if get(handles.Replicate,'Value') 3832 InputTable=get(handles.InputTable,'Data'); 3833 browse_data(fullfile(InputTable{1,1},InputTable{1,2})) 3846 InputTable=get(handles.InputTable,'Data'); 3847 for ilist=1:size(InputTable,1) 3848 InputDir{ilist}=fullfile(InputTable{ilist,1},InputTable{ilist,2}); 3849 end 3850 browse_data(InputDir) 3834 3851 else 3835 3852 hh=findobj(allchild(0),'Tag','browse_data'); -
trunk/src/series/time_series.m
r1061 r1069 304 304 VarMesh=[]; 305 305 checkhisto=0; 306 if isfield(Param,'ProjObject') && ismember(Param.ProjObject.ProjMode,{'inside','outside'}) 306 checkline=0; 307 if isfield(Param,'ProjObject') 308 if ismember(Param.ProjObject.ProjMode,{'inside','outside'}) 307 309 checkhisto=1; 308 310 if isfield(Param,'ActionInput') && isfield(Param.ActionInput,'VarMesh')%case of histograms … … 311 313 VarMesh=[]; 312 314 disp_uvmat('WARNING','automatic bin size for histograms, select time_series again to set the value',checkrun) 315 end 316 elseif ismember(Param.ProjObject.Type,{'line'}) 317 checkline=1; 313 318 end 314 319 end … … 401 406 DataOut.ListVarName=[DataOut.ListVarName {[VarName 'Histo']}]; 402 407 DataOut.VarDimName=[DataOut.VarDimName {{'Time',VarName}}]; 403 % if isfield(DataOut.VarAttribute{ivar},'Role')404 % DataOut.VarAttribute{ivar}=rmfield(DataOut.VarAttribute{ivar},'Role');405 % end406 408 StatName=pdf2stat;% get the names of statistical quantities to calcuilate at each time 407 409 for istat=1:numel(StatName) … … 430 432 eval(['DataOut=rmfield(DataOut,''' Field.ListVarName{ivar} ''');']);%remove variable 431 433 end 432 if strcmp(var_role,'coord_x')||strcmp(var_role,'coord_ y')||strcmp(var_role,'coord_z')||strcmp(var_role,'coord')434 if strcmp(var_role,'coord_x')||strcmp(var_role,'coord_z')||strcmp(var_role,'coord') 433 435 testsum(ivar)=1; %constant coordinates, record without time evolution 436 end 437 if strcmp(var_role,'coord_y')&& ~checkline 438 testsum(ivar)=1; 434 439 end 435 440 end … … 567 572 end 568 573 569 % %case of histograms570 % if checkhisto571 % for ivar=1:numel(Field.ListVarName)572 % VarName=Field.ListVarName{ivar};573 % if isfield(Data{1},VarName)574 % DataOut.ListVarName=[DataOut.ListVarName {[VarName 'Histo']}];575 % DataOut.VarDimName=[DataOut.VarDimName {{'Time',VarName}}];576 % end577 % end578 % end579 % display nbmissing580 574 if ~isequal(nbmissing,0) 581 575 disp_uvmat('WARNING',[num2str(nbmissing) ' files skipped: missing files or bad input, see command window display'],checkrun)
Note: See TracChangeset
for help on using the changeset viewer.