Changeset 377


Ignore:
Timestamp:
Jan 17, 2012, 12:11:44 AM (12 years ago)
Author:
sommeria
Message:

check_data_file corrected to fit with the new conventions of series

File:
1 edited

Legend:

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

    r374 r377  
    2525
    2626%requests for the visibility of input windows in the GUI series  (activated directly by the selection in the menu ACTION)
    27 if ~exist('num_i1_cell','var')
     27if ~exist('Param','var')
    2828    GUI_input={'RootPath';'many';...%nbre of possible input series (options 'on'/'two'/'many', default:'one')
    2929        'SubDir';'on';... % subdirectory of derived files (PIV fields), ('on' by default)
     
    6767% number of views
    6868count=0; 
    69 nbview=length(RootFile);
     69nbview=numel(RootFile);
    7070
    7171for iview=1:nbview
    72     filebase=fullfile(Series.RootPath{iview},Series.RootFile{iview});%root file name
    73     if testcell
    74         num_i1=num_i1_cell{iview}; num_i2=num_i2_cell{iview}; num_j1=num_j1_cell{iview}; num_j2=num_j2_cell{iview};
    75     else
    76         num_i1=num_i1_cell; num_i2=num_i2_cell; num_j1=num_j1_cell; num_j2=num_j2_cell;
    77     end
    78     siz=size(num_i1);
    79     nbfield2=siz(1); %nb of consecutive fields at each level(burst
    80     nbfield=siz(1)*siz(2);
     72    filebase=fullfile(RootPath{iview},RootFile{iview});%root file name
     73%     if testcell
     74%         num_i1=num_i1_cell{iview}; num_i2=num_i2_cell{iview}; num_j1=num_j1_cell{iview}; num_j2=num_j2_cell{iview};
     75%     else
     76%         num_i1=num_i1_cell; num_i2=num_i2_cell; num_j1=num_j1_cell; num_j2=num_j2_cell;
     77%     end
     78%     siz=size(num_i1);
     79    nbfield=size(i1_series{iview},1);
     80    nbfield2=size(i1_series{iview},2); %nb of consecutive fields at each level(burst
     81    nbfield=numel(i1_series{iview});
    8182    nbfield=floor(nbfield/(nbfield2*NbSlice));%total number of i indexes (adjusted to an integer number of slices)
    82     if isequal(lower(Series.FileExt{iview}),'.avi')
    83         info=aviinfo([filebase Series.FileExt{iview}]);
     83    if isequal(lower(FileExt{iview}),'.avi')
     84        info=aviinfo([filebase FileExt{iview}]);
    8485        message{1}=info.Filename;
    8586        message{2}=info.FileModDate;
     
    103104                    update_waitbar(hseries.waitbar_frame,WaitbarPos,index/(nbfield*nbfield2))
    104105                    ifile=indselect(index);               
    105                     file=...
    106                        name_generator(filebase,num_i1(ifile),num_j1(ifile),Series.FileExt{iview},Series.NomType{iview},1,num_i2(ifile),num_j2(ifile),Series.SubDir{iview});               
     106%                     file=...
     107%                        name_generator(filebase,num_i1(ifile),num_j1(ifile),FileExt{iview},NomType{iview},1,num_i2(ifile),num_j2(ifile),SubDir{iview});               
     108                    file=filecell{iview,ifile};
    107109                    [Path,Name,ext]=fileparts(file);
    108110                    detect=exist(file,'file'); % check the existence of the file
     
    117119                        filefound(ifile)={datfile.name};
    118120                        lastfield='';
    119                         if isequal(Series.FileExt{iview},'.nc') || isequal(Series.FileExt{iview},'.cdf')
    120                             % check the content  netcdf file
    121                             Data=nc2struct(file,'ListGlobalAttribute','patch2','fix2','civ2','patch','fix','absolut_time_T0','hart');
    122                             if ~isempty(Data.patch2) && isequal(Data.patch2,1)
    123                                 lastfield='patch2';
    124                             elseif ~isempty(Data.fix2) && isequal(Data.fix2,1)
    125                                 lastfield='fix2';
    126                             elseif ~isempty(Data.civ2) && isequal(Data.civ2,1);
    127                                 lastfield='civ2';
    128                             elseif ~isempty(Data.patch) && isequal(Data.patch,1);
    129                                 lastfield='patch1';
    130                             elseif ~isempty(Data.fix) && isequal(Data.fix,1);
    131                                 lastfield='fix1';
    132                             elseif ~isempty(Data.absolut_time_T0) && ~isempty(Data.hart)
    133                                 lastfield='civ1';
    134                             end                         
    135                         end
     121                        [FileType,FileInfo,Object]=get_file_type(file);
     122                        if strcmp(FileType,'civx')||strcmp(FileType,'civdata')
     123                            if isfield(FileInfo,'CivStage')
     124                            liststage={'civ1','fix1','patch1','civ2','fix2','patch2'};
     125                            lastfield=liststage{FileInfo.CivStage};
     126                            end
     127                        end
     128                        lastfield=[FileType ', ' lastfield];                   
    136129                    end
    137130                    Tabchar(1,i_slice)={['slice #' num2str(i_slice)]};
Note: See TracChangeset for help on using the changeset viewer.