- Timestamp:
- Feb 6, 2017, 8:05:39 PM (8 years ago)
- Location:
- trunk/src
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/series.m
r996 r997 1455 1455 % --- called by RUN_Callback 1456 1456 %------------------------------------------------------------------------ 1457 % The calculations are launched in three different ways: 1458 % RunMode='local': calculation on the local Matlab session, will prevent other actions during that time. 1459 % RunMode='background': calculation on the local computer, but in a new Matlab session (with no graphic output). 1460 % RunMode='cluster': calculations dispatched in a cluster, using a managing system, 'oar, 'sge, or 'sgb'. 1461 % In the latter case, the calculation is split in 'packets' of i index (all j indices are contained in a single packet). 1462 % This splitting is possible only if the different calculations in the series are independent. Otherwise the action 1463 % function imposes a number of processes NbSlice in input, for instance NbSlice=1 for a time series. 1464 % If NbSlice is not imposed, the splitting in packets (jobs) is determined 1465 % so that a job is optimum length AdvisedJobCPUTime), and the total job number in any case smaller 1466 % than MaxJobNumber (these parameters are defined in the file series.xml in 1467 % accordance with the management strategy for the cluster). The jobs are 1468 % dispatched in parallel into NbCore processors by the cluster managing system. 1469 1457 1470 function errormsg=launch_action(handles) 1458 1471 errormsg=''; % default … … 1568 1581 NbCore=1; % no need to split the calculation 1569 1582 case 'cluster_oar' 1570 NbCoreDefault=SeriesData.OarParam.NbCoreDefault;%proposed number of cores (for cluster) 1571 if strcmp(ActionExt,'.m')% case of Matlab function (uncompiled) 1583 %proposed number of cores to reserve in the cluster 1584 NbCoreAdvised=SeriesData.SeriesParam.OarParam.NbCoreAdvised; 1585 NbCoreMax=SeriesData.SeriesParam.OarParam.NbCoreMax; 1586 if strcmp(ActionExt,'.m')% case of Matlab function (uncompiled) 1572 1587 warning_string=', preferably use .sh option to save Matlab licences'; 1573 else 1574 warning_string=''; 1575 end 1576 answer=inputdlg({['Number of cores (max 36)' warning_string],'extra oar options'},'oarsub parameter',1,{num2str(NbCoreDefault),''}); 1577 if isempty(answer) 1578 errormsg='Action launch interrupted by user'; 1579 return 1580 end 1581 NbCore=str2double(answer{1}); 1582 extra_oar=answer{2}; 1583 % end 1588 else 1589 warning_string=')'; 1590 end 1591 answer=inputdlg({['Number of cores (max ' num2str(NbCoreMax) warning_string],'extra oar options'},'oarsub parameter',1,{num2str(NbCoreAdvised),''}); 1592 if isempty(answer) 1593 errormsg='Action launch interrupted by user'; 1594 return 1595 end 1596 NbCore=str2double(answer{1}); 1597 extra_oar=answer{2}; 1584 1598 case {'cluster_pbs', 'cluster_sge', 'cluster_qstat_unknown'} 1585 1599 if strcmp(ActionExt,'.m')% case of Matlab function (uncompiled) … … 1722 1736 switch RunMode 1723 1737 case {'cluster_oar','cluster_pbs','cluster_sge','cluster_qstat_unknown'} 1738 JobNumberMax=SeriesData.SeriesParam.OarParam.JobNumberMax; 1739 JobCPUTimeAdvised=SeriesData.SeriesParam.OarParam.JobCPUTimeAdvised; 1724 1740 if isempty(Param.IndexRange.NbSlice)% if NbSlice is not defined 1725 BlockLength= ceil( 20/(CPUTime*nbfield_j)); % short iterations are grouped such that the minimum time of a process is 20 min.1726 BlockLength=max(BlockLength,ceil(numel(ref_i)/ 500)); % possibly increase the BlockLength to have less than 500jobs1741 BlockLength= ceil(JobCPUTimeAdvised/(CPUTime*nbfield_j)); % iterations are grouped in sets with length BlockLength such that the typical CPU time of a job is MinJobNumber. 1742 BlockLength=max(BlockLength,ceil(numel(ref_i)/JobNumberMax)); % possibly increase the BlockLength to have less than MaxJobNumber jobs 1727 1743 NbProcess=ceil(numel(ref_i)/BlockLength) ; % nbre of processes sent to oar 1728 1744 else 1729 1745 NbProcess=Param.IndexRange.NbSlice; % the parameter NbSlice sets the nbre of run processes 1730 NbCore=min(NbCore,NbProcess); % reduces the number of cores if it exceeds the number of processes1731 end1746 end 1747 NbCore=min(NbCore,NbProcess); % reduces the number of cores if it exceeds the number of processes 1732 1748 otherwise 1733 1749 if ~isempty(Param.IndexRange.NbSlice) … … 1858 1874 filelog_global=fullfile(OutputDir,'0_LOG',filelog_global); 1859 1875 1860 for iprocess=1:NbProcess 1861 1862 %create the executable file 1863 1876 for iprocess=1:NbProcess 1877 %create the executable file 1864 1878 batch_file_list{iprocess}=fullfile(OutputDir,'0_EXE',regexprep(extxml{iprocess},'.xml$',ExeExt)); 1865 1879 1866 1880 % set the log file name 1867 filelog{iprocess}=fullfile(OutputDir,'0_LOG',regexprep(extxml{iprocess},'.xml$','.log')); 1868 1881 filelog{iprocess}=fullfile(OutputDir,'0_LOG',regexprep(extxml{iprocess},'.xml$','.log')); 1869 1882 end 1870 1883 end … … 2001 2014 % shorter than the wall time: in the time interval 'checkpoint' (WallTimeOneJob) before the end of the allowed duration, 2002 2015 % the oar job restarts when an individual job ends. 2003 JobTime=CPUTime*BlockLength*nbfield_j; % estimated time for one individual job (in minutes) 2016 WallTimeMax=SeriesData.SeriesParam.OarParam.WallTimeMax; 2017 JobTime=CPUTime*BlockLength*nbfield_j; % estimated CPU time for one individual job (in minutes) 2004 2018 % wall time (in hours ) for each oar job, allowing 10 individual jobs, but limited to 23 h: 2005 WallTimeTotal=min( 23,4*JobTime/60);2019 WallTimeTotal=min(WallTimeMax,4*JobTime/60); 2006 2020 %disp(['WallTimeTotal: ' num2str(WallTimeTotal) ' hours']) 2007 2021 % estimated time of an individual job (in min), with a margin of error … … 2314 2328 %% Activate the Action fct to adapt the configuration of the GUI series and bring specific parameters in SeriesData 2315 2329 Param=read_GUI_series(handles); % read the parameters from the GUI series 2330 Param.Action.RUN=0; 2316 2331 ParamOut=h_fun(Param); % run the selected Action function to get the relevant input 2317 2332 … … 2527 2542 set(handles.NbSlice_title,'Visible','off') 2528 2543 end 2529 if is numeric(ParamOut.NbSlice)2544 if isfield(ParamOut,'NbSlice') && isnumeric(ParamOut.NbSlice) 2530 2545 set(handles.num_NbSlice,'String',num2str(ParamOut.NbSlice)) 2531 2546 set(handles.num_NbSlice,'Enable','off'); % NbSlice set by the activation of the Action function -
trunk/src/series.xml.default
r996 r997 3 3 <DiskQuotaCmd>quota -s -g -A</DiskQuotaCmd> 4 4 <OarParam> 5 <NbCoreDefault>16</NbCoreDefault><!--proposed default number of parallel cores for a job --> 6 <MinEstimatedCPUTime unit="minute">20</MinEstimatedCPUTime><!--used to group the iterations into jobs of sufficient CPU time--> 7 <MaxJobNumber>500</MaxJobNumber><!--maximum number of jobs allowed (will group the iterations to fit in)--> 8 <JobStatCmd>oarstat |grep N=UVmat</JobStatCmd> 5 <NbCoreAdvised>16</NbCoreAdvised><!--proposed default number of parallel cores attributed for the computations --> 6 <NbCoreMax>36</NbCoreMax><!--maximum number of cores allowed for the computations --> 7 <JobCPUTimeAdvised unit="minute">20</JobCPUTimeAdvised><!--used to group the iterations into jobs of sufficient CPU time--> 8 <JobNumberMax>500</JobNumberMax><!--maximum number of jobs allowed (will group the iterations to fit in)--> 9 <WallTimeMax unit="hour">23</WallTimeMax> <!--maximum allowed time for a job --> 10 <JobStatCmd>oarstat |grep N=UVmat</JobStatCmd> <!--command to know the number of active and waiting job launches--> 9 11 </OarParam> 10 12 <SgeParam> -
trunk/src/series/check_data_files.m
r984 r997 52 52 function ParamOut=check_data_files(Param) 53 53 54 ParamOut=[]; 54 55 %% input preparation mode (no RUN) 55 56 if isstruct(Param) && isequal(Param.Action.RUN,0) -
trunk/src/series/civ_series.m
r996 r997 224 224 225 225 %% check the first image pair 226 try226 % try 227 227 if Param.ActionInput.CheckCiv1% Civ1 is performed 228 first_ima=1; 229 ImageName_A=fullfile_uvmat(RootPath_A,SubDir_A,RootFile_A,FileExt_A,NomType_A,i1_series_Civ1(1),[],j1_series_Civ1(1)); 230 if checkrun 231 if ~exist(ImageName_A,'file') 232 disp_uvmat('ERROR',['first input image ' ImageName_A ' does not exist'],checkrun) 233 return 234 end 235 else 236 % for ifile=1:numel(i1_series_Civ1) 237 % if 238 end 239 [FileInfo_A,VideoObject_A]=get_file_info(ImageName_A); 240 FileType_A=FileInfo_A.FileType; 241 if strcmp(FileInfo_A.FileType,'netcdf') 242 FieldName_A=Param.InputFields.FieldName; 243 [DataIn,tild,tild,errormsg]=nc2struct(ImageName_A,{FieldName_A}); 244 par_civ1.ImageA=DataIn.(FieldName_A); 245 else 246 [par_civ1.ImageA,VideoObject_A] = read_image(ImageName_A,FileType_A,VideoObject_A,FrameIndex_A_Civ1(1)); 247 end 248 ImageName_B=fullfile_uvmat(RootPath_B,SubDir_B,RootFile_B,FileExt_B,NomType_B,i2_series_Civ1(1),[],j2_series_Civ1(1)); 249 if ~exist(ImageName_B,'file') 250 disp_uvmat('ERROR',['first input image ' ImageName_B ' does not exist'],checkrun) 251 return 252 end 253 [FileInfo_B,VideoObject_B]=get_file_info(ImageName_B); 254 FileType_B=FileInfo_B.FileType; 255 if strcmp(FileInfo_B.FileType,'netcdf') 256 FieldName_B=Param.InputFields.FieldName; 257 [DataIn,tild,tild,errormsg]=nc2struct(ImageName_B,{FieldName_B}); 258 par_civ1.ImageB=DataIn.(FieldName_B); 259 else 260 [par_civ1.ImageB,VideoObject_B] = read_image(ImageName_B,FileType_B,VideoObject_B,FrameIndex_B_Civ1(1)); 261 end 228 % ImageName_A=fullfile_uvmat(RootPath_A,SubDir_A,RootFile_A,FileExt_A,NomType_A,i1_series_Civ1(1),[],j1_series_Civ1(1)); 229 % [FileInfo_A,VideoObject_A]=get_file_info(ImageName_A); 230 % FileType_A=FileInfo_A.FileType; 231 % if strcmp(FileInfo_A.FileType,'netcdf') 232 % FieldName_A=Param.InputFields.FieldName; 233 % [DataIn,tild,tild,errormsg]=nc2struct(ImageName_A,{FieldName_A}); 234 % par_civ1.ImageA=DataIn.(FieldName_A); 235 % else 236 % [par_civ1.ImageA,VideoObject_A] = read_image(ImageName_A,FileType_A,VideoObject_A,FrameIndex_A_Civ1(1)); 237 % end 238 % ImageName_B=fullfile_uvmat(RootPath_B,SubDir_B,RootFile_B,FileExt_B,NomType_B,i2_series_Civ1(1),[],j2_series_Civ1(1)); 239 % if ~exist(ImageName_B,'file') 240 % disp_uvmat('ERROR',['first input image ' ImageName_B ' does not exist'],checkrun) 241 % return 242 % end 243 % [FileInfo_B,VideoObject_B]=get_file_info(ImageName_B); 244 % FileType_B=FileInfo_B.FileType; 245 % if strcmp(FileInfo_B.FileType,'netcdf') 246 % FieldName_B=Param.InputFields.FieldName; 247 % [DataIn,tild,tild,errormsg]=nc2struct(ImageName_B,{FieldName_B}); 248 % par_civ1.ImageB=DataIn.(FieldName_B); 249 % else 250 % [par_civ1.ImageB,VideoObject_B] = read_image(ImageName_B,FileType_B,VideoObject_B,FrameIndex_B_Civ1(1)); 251 % end 262 252 NbField=numel(i1_series_Civ1); 263 253 elseif Param.ActionInput.CheckCiv2 % Civ2 is performed without Civ1 264 ImageName_A=fullfile_uvmat(RootPath_A,SubDir_A,RootFile_A,FileExt_A,NomType_A,i1_series_Civ2(1),[],j1_series_Civ2(1));265 if ~exist(ImageName_A,'file')266 disp_uvmat('ERROR',['first input image ' ImageName_A ' does not exist'],checkrun)267 return268 end269 [FileInfo_A,VideoObject_A]=get_file_info(ImageName_A);270 FileType_A=FileInfo_A.FileType;271 [par_civ1.ImageA,VideoObject_A] = read_image(ImageName_A,FileInfo_A.FileType,VideoObject_A,FrameIndex_A_Civ2(1));272 ImageName_B=fullfile_uvmat(RootPath_B,SubDir_B,RootFile_B,FileExt_B,NomType_B,i2_series_Civ2(1),[],j2_series_Civ2(1));273 if ~exist(ImageName_B,'file')274 disp_uvmat('ERROR',['first input image ' ImageName_B ' does not exist'],checkrun)275 return276 end277 [FileInfo_B,VideoObject_B]=get_file_info(ImageName_B);278 FileType_B=FileInfo_B.FileType;279 [par_civ1.ImageB,VideoObject_B] = read_image(ImageName_B,FileType_B,VideoObject_B,FrameIndex_B_Civ2(1));254 % ImageName_A=fullfile_uvmat(RootPath_A,SubDir_A,RootFile_A,FileExt_A,NomType_A,i1_series_Civ2(1),[],j1_series_Civ2(1)); 255 % if ~exist(ImageName_A,'file') 256 % disp_uvmat('ERROR',['first input image ' ImageName_A ' does not exist'],checkrun) 257 % return 258 % end 259 % [FileInfo_A,VideoObject_A]=get_file_info(ImageName_A); 260 % FileType_A=FileInfo_A.FileType; 261 % [par_civ1.ImageA,VideoObject_A] = read_image(ImageName_A,FileInfo_A.FileType,VideoObject_A,FrameIndex_A_Civ2(1)); 262 % ImageName_B=fullfile_uvmat(RootPath_B,SubDir_B,RootFile_B,FileExt_B,NomType_B,i2_series_Civ2(1),[],j2_series_Civ2(1)); 263 % if ~exist(ImageName_B,'file') 264 % disp_uvmat('ERROR',['first input image ' ImageName_B ' does not exist'],checkrun) 265 % return 266 % end 267 % [FileInfo_B,VideoObject_B]=get_file_info(ImageName_B); 268 % FileType_B=FileInfo_B.FileType; 269 % [par_civ1.ImageB,VideoObject_B] = read_image(ImageName_B,FileType_B,VideoObject_B,FrameIndex_B_Civ2(1)); 280 270 NbField=numel(i1_series_Civ2); 281 271 else 282 272 NbField=numel(i1_series_Civ1);% no image used (only fix or patch) TO CHECK 283 273 end 284 catch ME285 if ~isempty(ME.message)286 disp_uvmat('ERROR', ['error reading input image: ' ME.message],checkrun)287 return288 end289 end274 % catch ME 275 % if ~isempty(ME.message) 276 % disp_uvmat('ERROR', ['error reading input image: ' ME.message],checkrun) 277 % return 278 % end 279 % end 290 280 291 281 … … 326 316 end 327 317 end 328 if isempty(Time) && ~isempty(find(strcmp(FileType_A,{'mmreader','video','cine_phantom'})))% case of video input 329 Time=zeros(FileInfo_A.NumberOfFrames+1,2); 330 Time(:,2)=(0:1/FileInfo_A.FrameRate:(FileInfo_A.NumberOfFrames)/FileInfo_A.FrameRate)'; 331 TimeSource='video'; 332 ColorType='truecolor'; 333 end 334 if isempty(Time)% Time = index i +0.001 index j by default 335 %MinIndex_i=min(i1_series_Civ1); 336 MaxIndex_i=max(i2_series_Civ1); 337 %MinIndex_j=min(j1_series_Civ1); 338 MaxIndex_j=max(j2_series_Civ1); 339 Time=(1:MaxIndex_i)'*ones(1,MaxIndex_j); 340 Time=Time+0.001*ones(MaxIndex_i,1)*(1:MaxIndex_j); 341 Time=[zeros(1,MaxIndex_j);Time];% insert a first line of zeros 342 Time=[zeros(MaxIndex_i+1,1) Time];% insert a first column of zeros 343 end 344 345 if length(FileInfo_A) >1 %case of image with multiple frames 346 nbfield=length(FileInfo_A); 347 nbfield_j=1; 348 end 318 319 349 320 end 350 321 351 322 %%%%% MAIN LOOP %%%%%% 352 323 maskname='';% initiate the mask name 353 tic; 324 FileType_A=''; 325 FileType_B=''; 354 326 CheckOverwrite=1;%default 355 327 if isfield(Param,'CheckOverwrite') … … 357 329 end 358 330 for ifield=1:NbField 331 tic 359 332 if ~isempty(RUNHandle)% update the waitbar in interactive mode with GUI series (checkrun=1) 360 333 update_waitbar(WaitbarHandle,ifield/NbField) … … 382 355 end 383 356 end 384 ncfile_out=ncfile;% by default 357 ncfile_out=ncfile;% by default 385 358 if isfield (Param.ActionInput,'Civ2') 386 359 i1_civ2=i1_series_Civ2(ifield); … … 412 385 if isfield (Param.ActionInput,'Civ1') 413 386 if CheckInputFile 414 disp('civ1 started')387 disp('civ1 started') 415 388 end 416 389 par_civ1=Param.ActionInput.Civ1; … … 418 391 try 419 392 ImageName_A=fullfile_uvmat(RootPath_A,SubDir_A,RootFile_A,FileExt_A,NomType_A,i1_series_Civ1(ifield),[],j1_series_Civ1(ifield)); 420 if strcmp(File Info_A.FileType,'netcdf')% case of input images in format netcdf393 if strcmp(FileExt_A,'.nc')% case of input images in format netcdf 421 394 FieldName_A=Param.InputFields.FieldName; 422 395 [DataIn,tild,tild,errormsg]=nc2struct(ImageName_A,{FieldName_A}); 423 396 par_civ1.ImageA=DataIn.(FieldName_A); 424 397 else % usual image formats for image A 398 if isempty(FileType_A) 399 [FileInfo_A,VideoObject_A]=get_file_info(ImageName_A); 400 FileType_A=FileInfo_A.FileType; 401 if isempty(Time) && ~isempty(find(strcmp(FileType_A,{'mmreader','video','cine_phantom'})))% case of video input 402 Time=zeros(FileInfo_A.NumberOfFrames+1,2); 403 Time(:,2)=(0:1/FileInfo_A.FrameRate:(FileInfo_A.NumberOfFrames)/FileInfo_A.FrameRate)'; 404 TimeSource='video'; 405 ColorType='truecolor'; 406 end 407 if ~isempty(FileType_A) && isempty(Time)% Time = index i +0.001 index j by default 408 MaxIndex_i=max(i2_series_Civ1); 409 MaxIndex_j=max(j2_series_Civ1); 410 Time=(1:MaxIndex_i)'*ones(1,MaxIndex_j); 411 Time=Time+0.001*ones(MaxIndex_i,1)*(1:MaxIndex_j); 412 Time=[zeros(1,MaxIndex_j);Time];% insert a first line of zeros 413 Time=[zeros(MaxIndex_i+1,1) Time];% insert a first column of zeros 414 end 415 end 416 if ~exist(ImageName_A,'file') 417 disp([ImageName_A ' missing']) 418 continue 419 end 425 420 [par_civ1.ImageA,VideoObject_A] = read_image(ImageName_A,FileType_A,VideoObject_A,FrameIndex_A_Civ1(ifield)); 426 421 end 427 422 ImageName_B=fullfile_uvmat(RootPath_B,SubDir_B,RootFile_B,FileExt_B,NomType_B,i2_series_Civ1(ifield),[],j2_series_Civ1(ifield)); 428 if strcmp(File Info_B.FileType,'netcdf') % case of input images in format netcdf423 if strcmp(FileExt_B,'.nc') % case of input images in format netcdf 429 424 FieldName_B=Param.InputFields.FieldName; 430 425 [DataIn,tild,tild,errormsg]=nc2struct(ImageName_B,{FieldName_B}); 431 426 par_civ1.ImageB=DataIn.(FieldName_B); 432 427 else % usual image formats for image B 428 if isempty(FileType_B) 429 [FileInfo_B,VideoObject_B]=get_file_info(ImageName_B); 430 FileType_B=FileInfo_B.FileType; 431 end 432 if ~exist(ImageName_B,'file') 433 disp([ImageName_B ' missing']) 434 continue 435 end 433 436 [par_civ1.ImageB,VideoObject_B] = read_image(ImageName_B,FileType_B,VideoObject_B,FrameIndex_B_Civ1(ifield)); 434 437 end … … 465 468 Data.Civ1_Dt=1;% Time interval is 1, to yield displacement instead of velocity=displacement/Dt at reading 466 469 else 467 Data.Civ1_Time=(Time(i2+1,j2+1)+Time(i1+1,j1+1))/2;% the Time is the Time at the middle of the image pair468 Data.Civ1_Dt=Time(i2+1,j2+1)-Time(i1+1,j1+1);470 Data.Civ1_Time=(Time(i2+1,j2+1)+Time(i1+1,j1+1))/2;% the Time is the Time at the middle of the image pair 471 Data.Civ1_Dt=Time(i2+1,j2+1)-Time(i1+1,j1+1); 469 472 end 470 473 for ilist=1:length(list_param) … … 555 558 %% Fix1 556 559 if isfield (Param.ActionInput,'Fix1') 557 560 disp('fix1 started') 558 561 if ~isfield (Param.ActionInput,'Civ1')% if we use existing Civ1, remove previous data beyond Civ1 559 562 Fix1_attr=find(strcmp('Fix1',Data.ListGlobalAttribute)); … … 630 633 par_civ2.ImageA=[]; 631 634 par_civ2.ImageB=[]; 632 % i1_civ2=i1_series_Civ2(ifield);633 % i2_civ2=i1_civ2;634 % if ~isempty(i2_series_Civ2)635 % i2_civ2=i2_series_Civ2(ifield);636 % end637 % j1_civ2=1;638 % if ~isempty(j1_series_Civ2)639 % j1_civ2=j1_series_Civ2(ifield);640 % end641 % j2_civ2=i1_civ2;642 % if ~isempty(j2_series_Civ2)643 % j2_civ2=j2_series_Civ2(ifield);644 % end635 % i1_civ2=i1_series_Civ2(ifield); 636 % i2_civ2=i1_civ2; 637 % if ~isempty(i2_series_Civ2) 638 % i2_civ2=i2_series_Civ2(ifield); 639 % end 640 % j1_civ2=1; 641 % if ~isempty(j1_series_Civ2) 642 % j1_civ2=j1_series_Civ2(ifield); 643 % end 644 % j2_civ2=i1_civ2; 645 % if ~isempty(j2_series_Civ2) 646 % j2_civ2=j2_series_Civ2(ifield); 647 % end 645 648 ImageName_A_Civ2=fullfile_uvmat(RootPath_A,SubDir_A,RootFile_A,FileExt_A,NomType_A,i1_civ2,[],j1_civ2); 646 649 … … 656 659 [par_civ2.ImageB,VideoObject_B] = read_image(ImageName_B_Civ2,FileType_B,VideoObject_B,FrameIndex_B_Civ2(ifield)); 657 660 end 658 % if strcmp(Param.ActionInput.ListCompareMode,'PIV')659 % ncfile_out=fullfile_uvmat(RootPath_A,OutputDir,RootFile_A,'.nc',NomTypeNc,i1,i2,j1,j2);660 % else % displacement661 % ncfile_out=fullfile_uvmat(RootPath_A,OutputDir,RootFile_A,'.nc',NomTypeNc,i2,[],j2);662 % end661 % if strcmp(Param.ActionInput.ListCompareMode,'PIV') 662 % ncfile_out=fullfile_uvmat(RootPath_A,OutputDir,RootFile_A,'.nc',NomTypeNc,i1,i2,j1,j2); 663 % else % displacement 664 % ncfile_out=fullfile_uvmat(RootPath_A,OutputDir,RootFile_A,'.nc',NomTypeNc,i2,[],j2); 665 % end 663 666 par_civ2.ImageWidth=FileInfo_A.Width; 664 667 par_civ2.ImageHeight=FileInfo_A.Height; … … 784 787 Data.Civ2_ImageA=ImageName_A; 785 788 Data.Civ2_ImageB=ImageName_B; 786 789 if strcmp(Param.ActionInput.ListCompareMode,'displacement') 787 790 Data.Civ2_Time=Time(i2_civ2+1,j2_civ2+1);% the Time is the Time of the secodn image 788 791 Data.Civ2_Dt=1;% Time interval is 1, to yield displacement instead of velocity=displacement/Dt at reading 789 790 Data.Civ2_Time=(Time(i2_civ2+1,j2_civ2+1)+Time(i1_civ2+1,j1_civ2+1))/2;791 Data.Civ2_Dt=Civ2_Dt;792 792 else 793 Data.Civ2_Time=(Time(i2_civ2+1,j2_civ2+1)+Time(i1_civ2+1,j1_civ2+1))/2; 794 Data.Civ2_Dt=Civ2_Dt; 795 end 793 796 end 794 797 for ilist=1:length(list_param) … … 822 825 disp_uvmat('ERROR',errormsg,checkrun) 823 826 return 824 end 827 end 825 828 elseif isfield(Param,'Civ2_X')% use Civ2 data as input in Param (test mode) 826 829 Data.ListGlobalAttribute={}; … … 893 896 Data.VarAttribute{nbvar+6}.Role='vector_x'; 894 897 Data.VarAttribute{nbvar+7}.Role='vector_y'; 895 Data.Civ2_U_smooth=Data.Civ2_U; 896 Data.Civ2_V_smooth=Data.Civ2_V; 898 Data.Civ2_U_smooth=Data.Civ2_U; 899 Data.Civ2_V_smooth=Data.Civ2_V; 897 900 if isfield(Data,'Civ2_FF') 898 901 ind_good=find(Data.Civ2_FF==0); … … 1034 1037 end 1035 1038 check_undefined=(par_civ.Mask<200 & par_civ.Mask>=20 ); 1036 % par_civ.ImageA(check_undefined)=0;% put image A to zero (i.e. the min image value) in the undefined area1037 % par_civ.ImageB(check_undefined)=0;% put image B to zero (i.e. the min image value) in the undefined area1039 % par_civ.ImageA(check_undefined)=0;% put image A to zero (i.e. the min image value) in the undefined area 1040 % par_civ.ImageB(check_undefined)=0;% put image B to zero (i.e. the min image value) in the undefined area 1038 1041 end 1039 1042 -
trunk/src/xml2struct.m
r978 r997 64 64 end 65 65 else 66 try 66 67 ss=convert(t);%transform the xmltree object into a Matlab structure. 67 68 s=convert_string(ss); 69 catch ME 70 errormsg=ME.message; 71 end 68 72 end 69 73
Note: See TracChangeset
for help on using the changeset viewer.