Ignore:
Timestamp:
Feb 19, 2015, 2:17:59 AM (9 years ago)
Author:
sommeria
Message:

merge_proj corrected + various bugs

File:
1 edited

Legend:

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

    r872 r874  
    9292        end
    9393    end
     94    % test for subtraction
     95       if size(Param.InputTable,1)==2
     96            answer=msgbox_uvmat('INPUT_Y-N','substract the two input file series (Yes) or concatene them (No)');
     97            ParamOut.ActionInput.CheckSub=str2double(answer);
     98        end
    9499    % check the existence of the first and last file in the series
    95100     first_j=[];
     
    161166CheckNc=cell(1,nbview);
    162167frame_index=cell(1,nbview);
     168
    163169for iview=1:nbview
    164170    if ~exist(filecell{iview,1}','file')
     
    284290    VarMesh=Param.ActionInput.VarMesh;
    285291    end
     292end
     293CheckSub=0;%default
     294if isfield(Parma,'ActionInput') && isfield(Param.ActionInput,'CheckSub')
     295CheckSub=ParamOut.ActionInput.CheckSub;
    286296end
    287297%%%%%%%%%%%%%%%% loop on field indices %%%%%%%%%%%%%%%%
     
    312322        % coordinate transform (or other user defined transform)
    313323        if ~isempty(transform_fct)
    314             switch nargin(transform_fct)
    315                 case 4
    316                     if length(Data)==2
    317                         Field=transform_fct(Data{1},XmlData{1},Data{2},XmlData{2});
    318                     else
     324            if CheckSub
     325                switch nargin(transform_fct)
     326                    case 4
     327                        if length(Data)==2
     328                            Field=transform_fct(Data{1},XmlData{1},Data{2},XmlData{2});
     329                        else
     330                            Field=transform_fct(Data{1},XmlData{1});
     331                        end
     332                    case 3
     333                        if length(Data)==2
     334                            Field=transform_fct(Data{1},XmlData{1},Data{2});
     335                        else
     336                            Field=transform_fct(Data{1},XmlData{1});
     337                        end
     338                    case 2
    319339                        Field=transform_fct(Data{1},XmlData{1});
    320                     end
    321                 case 3
    322                     if length(Data)==2
    323                         Field=transform_fct(Data{1},XmlData{1},Data{2});
    324                     else
    325                         Field=transform_fct(Data{1},XmlData{1});
    326                     end
    327                 case 2
    328                     Field=transform_fct(Data{1},XmlData{1});
    329                 case 1
    330                     Field=transform_fct(Data{1});
     340                    case 1
     341                        Field=transform_fct(Data{1});
     342                end
     343            else
     344                if nargin(transform_fct)>=2
     345                    for iview=1:nbview
     346                        Data{iview}=transform_fct(Data{iview},XmlData{iview});
     347                    end
     348                else
     349                    for iview=1:nbview
     350                        Data{iview}=transform_fct(Data{iview});
     351                    end
     352                end
    331353            end
    332354        end
     
    344366            end
    345367        end
    346 %         nbfile=nbfile+1;
     368        %         nbfile=nbfile+1;
    347369       
    348370        % initiate the time series at the first iteration
     
    441463                VarVal=Field.(VarName);
    442464                if testsum(ivar)==2% test for recorded variable
    443                     if isempty(errormsg)                     
     465                    if isempty(errormsg)
    444466                        VarVal=shiftdim(VarVal,-1); %shift dimension
    445467                        DataOut.(VarName)(index,:,:)=VarVal;%concanete the current field to the time series
Note: See TracChangeset for help on using the changeset viewer.