Changeset 89 for trunk/src/civ.m
- Timestamp:
- May 20, 2010, 1:48:25 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/civ.m
r87 r89 181 181 182 182 % set the range of fields (1:1 by default) and selected pair 183 if is empty(num2)||isequal(num2,num1)183 if isnan(num2)||isequal(num2,num1) 184 184 num_ref_i=num1; 185 185 else … … 188 188 browse.incr_pair(2)=0; 189 189 end 190 if is empty(num_b)||isequal(num_a,num_b)191 if is empty(num_a)190 if isnan(num_b)||isequal(num_a,num_b) 191 if isnan(num_a) 192 192 num_ref_j=1; 193 193 else … … 291 291 [RootPath,RootFile,str1,str2,str_a,str_b,ext,nom_type,subdir]=name2display(fileinput); 292 292 filebase=fullfile(RootPath,RootFile); 293 num_i1=str a2num(str1);294 if is empty(num_i1),num_i1=1;end295 num_i2=str a2num(str2);296 if is empty(num_i2),num_i2=num_i1;end293 num_i1=str2double(str1); 294 if isnan(num_i1),num_i1=1;end 295 num_i2=str2double(str2); 296 if isnan(num_i2),num_i2=num_i1;end 297 297 num_j1=stra2num(str_a); 298 if is empty(num_j1),num_j1=1;end298 if isnan(num_j1),num_j1=1;end 299 299 num_j2=stra2num(str_b); 300 if is empty(num_j2),num_j2=num_j1;end300 if isnan(num_j2),num_j2=num_j1;end 301 301 if isequal(get(handles.compare,'Value'),1) 302 302 browse=[];%initialisation … … 615 615 end 616 616 end 617 618 617 % no image documentation file found: look for a series of existing images or .nc files 619 618 if isempty(time) && ~isequal(ext,'.nc') && ~strcmp(nom_type_ima,'none') && ~strcmp(nom_type_ima,'') && ~strcmp(nom_type_ima,'*') … … 646 645 end 647 646 first_i=max(field_i,1); 648 %determine the set of times and possible intervals for CIV 647 648 if strcmp(nom_type_ima,'_i_j') 649 field_i=field_count; 650 field_j=1; 651 jdetect=1; 652 while jdetect==1 %look for the maximum file number in the series 653 imagename=name_generator(filebase,field_i,field_j,ext_ima,nom_type_ima); 654 jdetect=(exist(imagename,'file')==2); 655 if jdetect 656 field_j=field_j+1; 657 end 658 %SEE CASE OF NETCDF FILES 659 % nbdetect=nbdetect+(exist(imagename,'file')==2); 660 end 661 nb_field_j=field_j-1;% last detected field number 662 end 663 664 665 %determine the set of times and possible intervals for CIV 649 666 % dt=(1/1000)*str2num(get(handles.dt,'String')); 650 667 time=[0:nb_field-1]';% time=file index -1 by default 668 if strcmp(nom_type_ima,'_i_j') 669 % time=[0:nb_field-1]'*ones(1,nb_field_j);% time=file index -1 by default 670 time=[0:nb_field-1]'*[0:nb_field_j-1];% time=file index -1 by default 671 end 672 673 651 674 set(handles.mode,'String',{'series(Di)'}) 652 675 end … … 2662 2685 filename_bat(end-2:end)='bat'; 2663 2686 fid=fopen(filename_bat,'w'); 2687 2664 2688 fprintf(fid,cmd); 2665 2689 fclose(fid); … … 5152 5176 ref.num_a=stra2num(str_a); 5153 5177 ref.num_b=stra2num(str_b); 5154 ref.num1=str2 num(field_count);5155 ref.num2=str2 num(str2);5178 ref.num1=str2double(field_count); 5179 ref.num2=str2double(str2); 5156 5180 browse=[];%initialisation 5157 5181 if ~isequal(ref.ext,'.nc') … … 5248 5272 set(handles.thresh_vel2,'String','0'); 5249 5273 5250 % ------------------------------------------------------------------------5251 % transform letters to numbers5252 function numres=stra2num(str)5253 % ------------------------------------------------------------------------5254 numres=double(str)-96;5255 if double(str) >= 48 & double(str) <= 57 % = 1 for numbers5256 numres=str2num(str);5257 end5274 % %------------------------------------------------------------------------ 5275 % % transform letters to numbers 5276 % function numres=stra2num(str) 5277 % %------------------------------------------------------------------------ 5278 % numres=double(str)-96; 5279 % if double(str) >= 48 & double(str) <= 57 % = 1 for numbers 5280 % numres=str2num(str); 5281 % end 5258 5282 5259 5283 %------------------------------------------------------------------------
Note: See TracChangeset
for help on using the changeset viewer.