Changeset 29 for trunk/src/series


Ignore:
Timestamp:
Mar 3, 2010, 10:48:08 AM (15 years ago)
Author:
sommeria
Message:

read_imadoc suppressed (obsolete, replaced by imadoc2struct)
update_imadoc: bug repaired: existing xml file was erased
various cleaning (deals with non existing input file for series and uvmat)

Location:
trunk/src/series
Files:
1 added
1 edited

Legend:

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

    r27 r29  
    3232WaitbarPos=get(hseries.waitbar_frame,'Position');
    3333%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    34 
    3534%root input file and type
    3635if ~iscell(Series.RootPath)% case of a single input field series
     
    235234
    236235% Root name of output files (TO GENERALISE FOR TWO INPUT SERIES)
    237 filebasesub=fullfile(RootPath{1},SubDir{1},RootFile{1});
    238 if isempty(SubDir{1}) % create a subdirectory '/mean'
    239     subdir_result='mean';
     236subdir_result='aver_stat';
     237% filebasesub=fullfile(RootPath{1},subdir_result,RootFile{1});
     238% if isempty(SubDir{1}) % create a subdirectory '/aver_stat'
     239%     subdir_result='aver_stat';
    240240%     filebasemean=fullfile(RootPath{1},subdir_result);
    241     if ~exist(fullfile(RootPath{1},subdir_result),'dir')
    242         dircur=pwd; %record current working directory
    243         cd(RootPath{1})% goes to the iamge directory
    244         [m1,m2,m3]=mkdir(subdir_result);
    245         if ~isequal(m2,'')
    246              msgbox_uvmat('CONFIRMATION',m2);%error message for directory creation
    247         end
    248         cd(dircur) %back to the initial working directory
    249     end
    250     filebase_out=filebase{1};
    251 else
    252    subdir_result=SubDir{1};
    253    filebase_out=[filebase{1} '_mean'];% output root name obtained by adding the suffix _mean to the input
    254 end
     241if ~exist(fullfile(RootPath{1},subdir_result),'dir')
     242    dircur=pwd; %record current working directory
     243    cd(RootPath{1})% goes to the iamge directory
     244    [m1,m2,m3]=mkdir(subdir_result);
     245    if ~isequal(m2,'')
     246         msgbox_uvmat('CONFIRMATION',m2);%error message for directory creation
     247    end
     248    cd(dircur) %back to the initial working directory
     249end
     250filebase_out=filebase{1};
     251% else
     252%    subdir_result=SubDir{1};
     253%    filebase_out=[filebase{1} '_mean'];% output root name obtained by adding the suffix _mean to the input
     254% end
    255255%output nomtype (to generalise)
    256256NomTypeOut=nomtype2pair(NomType{1},num_i2{end}(end)-num_i1{1}(1),num_j2{end}(end)-num_j1{1}(1));
    257257   
    258 if NbSlice==1 
    259     filebase_out=[filebasesub '_mean'];
    260 else
    261     filebase_out=[filebasesub '_' NbSlice_name 'mean'];
    262     answeryes=questdlg({['will make average in ' num2str(NbSlice) ' slices'];['results stored as files ' filebase_out ' ...']});
    263     if ~isequal(answeryes,'Yes')
    264         return
    265     end
    266 end
     258% if NbSlice==1 
     259%     filebase_out=[filebasesub '_mean'];
     260% else
     261%     filebase_out=[filebasesub '_' NbSlice_name 'mean'];
     262%     answeryes=questdlg({['will make average in ' num2str(NbSlice) ' slices'];['results stored as files ' filebase_out ' ...']});
     263%     if ~isequal(answeryes,'Yes')
     264%         return
     265%     end
     266% end
    267267
    268268% coordinate transform or other user defined transform
     
    394394    %writing the result file
    395395   if testima   
    396        if NbSlice==1
    397         [filemean]=name_generator(filebase_out,num_i1{1}(1),num_j1{1}(1),'.png',NomTypeOut,1,num_i2{end}(end),num_j2{end}(end));
    398        else % label the file number by the slice # for simplicity
    399           [filemean]=name_generator(filebase_out,i_slice,1,'.png','_i');
    400        end
     396%        if NbSlice==1
     397        [filemean]=name_generator(filebase_out,num_i1{1}(1),num_j1{1}(1),'.png',NomTypeOut,1,num_i2{end}(end),num_j2{end}(end),subdir_result);
     398%        else % label the file number by the slice # for simplicity
     399%           [filemean]=name_generator(filebase_out,i_slice,1,'.png','_i');
     400%        end
    401401        if exist(filemean,'file')
    402402            backupfile=filemean;
     
    429429            DataMean.ListGlobalAttribute=[DataMean.ListGlobalAttribute {'Time','Time_end'}];
    430430        end 
    431         if NbSlice==1
    432           filemean=name_generator(filebase_out,num_i1{1}(1),num_j1{1}(1),'.nc',NomTypeOut,1,num_i2{end}(end),num_j2{end}(end));
    433         else % label the file number by the slice # for simplicity
    434           [filemean]=name_generator(filebase_out,i_slice,1,'.nc','_i');
    435         end
     431%         if NbSlice==1
     432          filemean=name_generator(filebase_out,num_i1{1}(1),num_j1{1}(1),'.nc',NomTypeOut,1,num_i2{end}(end),num_j2{end}(end),subdir_result);
     433%         else % label the file number by the slice # for simplicity
     434%           [filemean]=name_generator(filebase_out,i_slice,1,'.nc','_i');
     435%         end
    436436        if exist(filemean,'file')
    437437            backupfile=filemean;
     
    459459hget_field=findobj(allchild(0),'name','get_field');%find the get_field... GUI
    460460delete(hget_field)
    461 'TEST'
    462461uvmat(filemean)
Note: See TracChangeset for help on using the changeset viewer.