Changeset 531 for trunk/src/series


Ignore:
Timestamp:
Aug 27, 2012, 4:39:28 PM (12 years ago)
Author:
sommeria
Message:

bug on times corrected

File:
1 edited

Legend:

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

    r526 r531  
    132132        displ_uvmat('WARNING',['times of series differ by (max) ' num2str(diff_time)],checkrun)
    133133    end   
     134    time=time(1,:);% choose the time data from the first sequence
    134135end
    135136
     
    225226        end
    226227        if isequal(stopstate,'queue')% enable STOP command
    227             Data=cell(1,nbview);%initiate the set Data
     228            Data=cell(1,nbview);%initiate the set Data;
    228229            nbtime=0;
    229230            dt=[];
     
    233234                [Data{iview},tild,errormsg] = read_field(filecell{iview,index},FileType{iview},InputFields{iview},frame_index{iview}(index));
    234235                if ~isempty(errormsg)
    235                     errormsg=['time_series/read_field/' errormsg];
     236                    errormsg=['time_series / read_field / ' errormsg];
    236237                    display(errormsg)
    237238                    break
    238                 end
    239                 timeread(iview)=0;
    240                 if isfield(Data{iview},'Time')
    241                     timeread(iview)=Data{iview}.Time;
    242                     nbtime=nbtime+1;
    243239                end
    244240                if ~isempty(NbSlice_calib)
     
    279275                [Field,errormsg]=proj_field(Field,Param.ProjObject);
    280276                if ~isempty(errormsg)
    281                     msgbox_uvmat('ERROR',['error in aver_stat/proj_field:' errormsg])
     277                    msgbox_uvmat('ERROR',['time_series / proj_field / ' errormsg])
    282278                    return
    283279                end
     
    289285                % stop program if the first field reading is in error
    290286                if ~isempty(errormsg)
    291                     displ_uvmat('ERROR',['error in time_series/sub_field:' errormsg],checkrun)
     287                    displ_uvmat('ERROR',['time_series / sub_field / ' errormsg],checkrun)
    292288                    return
    293289                end
     
    296292                nbvar=length(Field.ListVarName);
    297293                if nbvar==0
    298                     displ_uvmat('ERROR','no input variable selected in get_field',checkrun)
     294                    displ_uvmat('ERROR','no input variable selected',checkrun)
    299295                    return
    300296                end
     
    363359           
    364360            % record the time:
    365             if isempty(time)% time read in ncfiles
    366                 if isfield(Field,'Time')
     361            if isempty(time)% time not set by xml filer(s)
     362                if isfield(Data{1},'Time')
    367363                    DataOut.Time(nbfile,1)=Field.Time;
    368364                else
     
    370366                end
    371367            else % time from ImaDoc prevails  TODO: correct
    372                 DataOut.Time(nbtime,1)=i1_series{1}(index);% TODO : generalise
     368                DataOut.Time(nbfile,1)=time(index);%
    373369            end
    374370           
     
    419415    test_time=diff(DataOut.Time)>0;% test that the readed time is increasing (not constant)
    420416    if ~test_time
    421         DataOut.Time=[1:filecounter];
     417        DataOut.Time=1:filecounter;
    422418    end
    423419   
Note: See TracChangeset for help on using the changeset viewer.