Ignore:
Timestamp:
Apr 9, 2013, 8:20:00 PM (11 years ago)
Author:
sommeria
Message:

various bugs corrected after tests with Windows OS.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/series/aver_stat.m

    r605 r609  
    7373OutputDir=[Param.OutputSubDir Param.OutputDirExt];
    7474   
    75 %% root input file(s) and type
     75%% root input file(s) name, type and index series
    7676RootPath=Param.InputTable(:,1);
    7777RootFile=Param.InputTable(:,3);
     
    8888% i1_series(iview,fileindex) expresses the same indices as a 1D array in file indices
    8989%%%%%%%%%%%%
    90 % NbSlice=1;%default
    91 % if isfield(Param.IndexRange,'NbSlice')&&~isempty(Param.IndexRange.NbSlice)
    92 %     NbSlice=Param.IndexRange.NbSlice;
    93 % end
    9490nbview=numel(i1_series);%number of input file series (lines in InputTable)
    9591nbfield_j=size(i1_series{1},1); %nb of fields for the j index (bursts or volume slices)
    9692nbfield_i=size(i1_series{1},2); %nb of fields for the i index
    9793nbfield=nbfield_j*nbfield_i; %total number of fields
    98 %nbfield_i=floor(nbfield/NbSlice);%total number of  indexes in a slice (adjusted to an integer number of slices)
    99 %nbfield=nbfield_i*NbSlice; %total number of fields after adjustement
    100 
    101 %determine the file type on each line from the first input file
     94[first_i,tild,last_i,first_j,tild,last_j,errormsg]=get_index_range(Param.IndexRange);
     95if ~isempty(errormsg),display(errormsg),return,end
     96
     97%% determine the file type on each line from the first input file
    10298ImageTypeOptions={'image','multimage','mmreader','video'};
    10399NcTypeOptions={'netcdf','civx','civdata'};
     
    150146    return
    151147end
    152 NomTypeOut='_1-2_1';% output file index will indicate the first and last ref index in the series
    153 
     148%NomTypeOut='_1-2_1';% output file index will indicate the first and last ref index in the series
     149NomTypeOut=nomtype2pair(NomType{1});% determine the index nomenclature type for the output file
    154150
    155151%% Set field names and velocity types
     
    272268        %%%%%%%%%%%%   END MAIN RUNNING OPERATIONS  %%%%%%%%%%%%
    273269    else
    274         display(errormsg)
     270        disp(errormsg)
    275271    end
    276272end
     
    303299end
    304300
    305 %writting the result file
    306 OutputFile=fullfile_uvmat(RootPath{1},OutputDir,RootFile{1},FileExtOut,NomTypeOut,i1_series{1}(1),i1_series{1}(end),j1_series{1}(1),j1_series{1}(end));
     301%% writing the result file
     302OutputFile=fullfile_uvmat(RootPath{1},OutputDir,RootFile{1},FileExtOut,NomTypeOut,first_i,last_i,first_j,last_j);
    307303if CheckImage{1} %case of images
    308304    if isequal(FileInfo{1}.BitDepth,16)||(numel(FileInfo)==2 &&isequal(FileInfo{2}.BitDepth,16))
     
    313309        imwrite(DataOut.A,OutputFile,'BitDepth',8); % case of 16 bit images
    314310    end
    315     display([OutputFile ' written']);
     311    disp([OutputFile ' written']);
    316312else %case of netcdf input file , determine global attributes
    317313    errormsg=struct2nc(OutputFile,DataOut); %save result file
    318314    if isempty(errormsg)
    319         display([OutputFile ' written']);
    320     else
    321         msgbox_uvmat('ERROR',['error in writting result file: ' errormsg])
    322         display(errormsg)
     315        disp([OutputFile ' written']);
     316    else
     317        disp(['error in writting result file: ' errormsg])
    323318    end
    324319end  % end averaging  loop
Note: See TracChangeset for help on using the changeset viewer.