Changeset 29 for trunk/src/series
- Timestamp:
- Mar 3, 2010, 10:48:08 AM (15 years ago)
- Location:
- trunk/src/series
- Files:
-
- 1 added
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/series/aver_stat.m
r27 r29 32 32 WaitbarPos=get(hseries.waitbar_frame,'Position'); 33 33 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 34 35 34 %root input file and type 36 35 if ~iscell(Series.RootPath)% case of a single input field series … … 235 234 236 235 % 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'; 236 subdir_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'; 240 240 % filebasemean=fullfile(RootPath{1},subdir_result); 241 242 243 244 245 246 247 248 249 250 251 else252 subdir_result=SubDir{1};253 filebase_out=[filebase{1} '_mean'];% output root name obtained by adding the suffix _mean to the input254 end241 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 255 255 %output nomtype (to generalise) 256 256 NomTypeOut=nomtype2pair(NomType{1},num_i2{end}(end)-num_i1{1}(1),num_j2{end}(end)-num_j1{1}(1)); 257 257 258 if NbSlice==1259 filebase_out=[filebasesub '_mean'];260 else261 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 return265 end266 end258 % 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 267 267 268 268 % coordinate transform or other user defined transform … … 394 394 %writing the result file 395 395 if testima 396 if NbSlice==1397 [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 simplicity399 [filemean]=name_generator(filebase_out,i_slice,1,'.png','_i');400 end396 % 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 401 401 if exist(filemean,'file') 402 402 backupfile=filemean; … … 429 429 DataMean.ListGlobalAttribute=[DataMean.ListGlobalAttribute {'Time','Time_end'}]; 430 430 end 431 if NbSlice==1432 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 simplicity434 [filemean]=name_generator(filebase_out,i_slice,1,'.nc','_i');435 end431 % 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 436 436 if exist(filemean,'file') 437 437 backupfile=filemean; … … 459 459 hget_field=findobj(allchild(0),'name','get_field');%find the get_field... GUI 460 460 delete(hget_field) 461 'TEST'462 461 uvmat(filemean)
Note: See TracChangeset
for help on using the changeset viewer.