Changeset 81 for trunk/src/civ.m


Ignore:
Timestamp:
Apr 13, 2010, 10:37:08 AM (14 years ago)
Author:
sommeria
Message:

several bug repairs:
option movie backward introduced for uvmat

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/civ.m

    r73 r81  
    631631   
    632632% no image documentation file found: look for a series of existing images or .nc files
    633 if isempty(time) && ~isequal(ext,'.nc')
     633if isempty(time) && ~isequal(ext,'.nc') && ~strcmp(nom_type_ima,'none') && ~strcmp(nom_type_ima,'') && ~strcmp(nom_type_ima,'*')
    634634    subdir=get(handles.subdir_civ1,'String');
    635635    incr_pair=[0 0];%default
     
    637637            incr_pair=browse.incr_pair;
    638638    end
    639     nbdetect=0;%test of detected images
     639%     nbdetect=0;%test of detected images
    640640    field_i=field_count;
    641641    idetect=1;
    642     while idetect==1 %look for the maximum file number in the series
     642    while idetect==1 %look for the maximum file number in the series     
     643        imagename=name_generator(filebase,field_i+1,1,ext_ima,nom_type_ima);
     644        idetect=(exist(imagename,'file')==2);
     645        if idetect
    643646            field_i=field_i+1;
    644             imagename=name_generator(filebase,field_i,1,ext_ima,nom_type_ima);
    645             if strcmp(nom_type_ima,'none')||strcmp(nom_type_ima,'')
    646                idetect=0; %stop if the same image is repeated (if nom_type='none')
    647                nbdetect=1;
    648             else
    649                 idetect=(exist(imagename,'file')==2);
    650             end
     647        end
    651648            %SEE CASE OF NETCDF FILES
    652             nbdetect=nbdetect+(exist(imagename,'file')==2);
     649%             nbdetect=nbdetect+(exist(imagename,'file')==2);
    653650    end
    654651    nb_field=field_i;% last detected field number
     
    656653    idetect=1;
    657654    while idetect==1
    658                 field_i=field_i-1;
    659                 imagename=name_generator(filebase,field_i,1,ext_ima,nom_type_ima);
    660                 if isequal(nom_type_ima,'none')||strcmp(nom_type_ima,'')
    661                     idetect=0; %stop if the same image is repeated (if nom_type='none')
    662                     nbdetect=1;
    663                 else
    664                     idetect=(exist(imagename,'file')==2);
    665                 end
    666                 nbdetect=nbdetect+idetect;
    667     end
    668     first_i=max(field_i+1,1);
     655        imagename=name_generator(filebase,field_i-1,1,ext_ima,nom_type_ima);
     656        idetect=(exist(imagename,'file')==2);
     657        if idetect
     658           field_i=field_i-1;
     659        end
     660    end
     661    first_i=max(field_i,1);
    669662        %determine the set of times and possible intervals for CIV
    670663 %   dt=(1/1000)*str2num(get(handles.dt,'String'));
     
    672665    set(handles.mode,'String',{'series(Di)'})
    673666end
    674 if isequal(nom_type_ima,'none')% no file numbering used
    675   first_i=1;
    676   last_i=1;
    677    first_j=1;
    678   last_j=1;
    679 end
     667% if isequal(nom_type_ima,'none')% no file numbering used
     668%   first_i=1;
     669%   last_i=1;
     670%    first_j=1;
     671%   last_j=1;
     672% end
    680673if exist('time','var')
    681674    if size(time,1)+size(time,2)>=3 % if there are at least two time values to define dt
Note: See TracChangeset for help on using the changeset viewer.