Ignore:
Timestamp:
Nov 9, 2016, 7:12:32 PM (4 years ago)
Author:
sommeria
Message:

various

File:
1 edited

Legend:

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

    r960 r970  
    172172ImageTypeOptions={'image','multimage','mmreader','video'};
    173173NcTypeOptions={'netcdf','civx','civdata'};
    174 FileType=cell(1,nbview);
    175 FileInfo=cell(1,nbview);
    176 MovieObject=cell(1,nbview);
    177 CheckImage=cell(1,nbview);
    178 CheckNc=cell(1,nbview);
    179 frame_index=cell(1,nbview);
    180 
    181 for iview=1:nbview
     174FileType=cell(1,NbView);
     175FileInfo=cell(1,NbView);
     176MovieObject=cell(1,NbView);
     177CheckImage=cell(1,NbView);
     178CheckNc=cell(1,NbView);
     179frame_index=cell(1,NbView);
     180
     181for iview=1:NbView
    182182    if ~exist(filecell{iview,1}','file')
    183183        disp_uvmat('ERROR',['the first input file ' filecell{iview,1} ' does not exist'],checkrun)
     
    233233    return
    234234end
    235 if nbview==2 && ~isequal(CheckImage{1},CheckImage{2})
     235if NbView==2 && ~isequal(CheckImage{1},CheckImage{2})
    236236    disp_uvmat('ERROR','input must be two image series or two netcdf file series',checkrun)
    237237    return
     
    252252%% Set field names and velocity types
    253253InputFields{1}=[];%default (case of images)
    254 if nbview==2
     254if NbView==2
    255255    InputFields{2}=[];%default (case of images)
    256256end
    257257if isfield(Param,'InputFields')
    258258    InputFields{1}=Param.InputFields;
    259     if nbview==2
     259    if NbView==2
    260260        InputFields{2}=Param.InputFields;%default
    261261        if isfield(Param.InputFields,'FieldName_1')
     
    311311
    312312%%%%%%%%%%%%%%%% loop on field indices %%%%%%%%%%%%%%%%
    313 for index=1:nbfield
    314     update_waitbar(WaitbarHandle,index/nbfield)
     313for index=1:NbField
     314    update_waitbar(WaitbarHandle,index/NbField)
    315315    if ~isempty(RUNHandle) && ~strcmp(get(RUNHandle,'BusyAction'),'queue')
    316316        disp('program stopped by user')
    317317        break % leave the loop if stop is ordered
    318318    end
    319     Data=cell(1,nbview);%initiate the set Data;
     319    Data=cell(1,NbView);%initiate the set Data;
    320320    nbtime=0;
    321321    dt=[];
    322322    %%%%%%%%%%%%%%%% loop on views (input lines) %%%%%%%%%%%%%%%%
    323     for iview=1:nbview
     323    for iview=1:NbView
    324324        % reading input file(s)
    325325        [Data{iview},tild,errormsg] = read_field(filecell{iview,index},FileType{iview},InputFields{iview},frame_index{iview}(index));
     
    407407                    testsum(ivar)=1;
    408408                    DataOut.(VarName)=Field.(VarName);
    409                     DataOut.([VarName 'Histo'])=zeros([nbfield numel(DataOut.(VarName))]);
     409                    DataOut.([VarName 'Histo'])=zeros([NbField numel(DataOut.(VarName))]);
    410410                    VarMesh=Field.(VarName)(2)-Field.(VarName)(1);
    411411                end
     
    444444                    VarName=Field.ListVarName{ivar};
    445445                    siz=size(Field.(VarName));
    446                     DataOut.(VarName)=zeros([nbfield siz]);
     446                    DataOut.(VarName)=zeros([NbField siz]);
    447447                end
    448448            end
     
    466466                if MaxIndex_new>MaxIndex% the variable max for the current field exceeds the previous one
    467467                    DataOut.(VarName)=[DataOut.(VarName) VarMesh*(MaxIndex+1:MaxIndex_new)];% append the new variable values
    468                     DataOut.([VarName 'Histo'])=[DataOut.([VarName 'Histo']) zeros(nbfield,MaxIndex_new-MaxIndex)]; % append the new histo values
     468                    DataOut.([VarName 'Histo'])=[DataOut.([VarName 'Histo']) zeros(NbField,MaxIndex_new-MaxIndex)]; % append the new histo values
    469469                end
    470470                if MinIndex_new <= MinIndex-1
    471471                    DataOut.(VarName)=[VarMesh*(MinIndex_new:MinIndex-1) DataOut.(VarName)];% insert the new variable values
    472                     DataOut.([VarName 'Histo'])=[zeros(nbfield,MinIndex-MinIndex_new) DataOut.([VarName 'Histo'])];% insert the new histo values
     472                    DataOut.([VarName 'Histo'])=[zeros(NbField,MinIndex-MinIndex_new) DataOut.([VarName 'Histo'])];% insert the new histo values
    473473                    ind_start=1;
    474474                else
     
    560560test_time=diff(DataOut.Time)>0;% test that the readed time is increasing (not constant)
    561561if ~test_time
    562     DataOut.Time=1:nbfield;
     562    DataOut.Time=1:NbField;
    563563end
    564564
Note: See TracChangeset for help on using the changeset viewer.