Changeset 875 for trunk/src


Ignore:
Timestamp:
Feb 19, 2015, 8:54:16 AM (9 years ago)
Author:
sommeria
Message:

time serie input messages improved

File:
1 edited

Legend:

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

    r874 r875  
    6161
    6262%% set the input elements needed on the GUI series when the action is selected in the menu ActionName or InputTable refreshed
    63 if isstruct(Param) && isequal(Param.Action.RUN,0)% function activated from the GUI series but not RUN 
     63if isstruct(Param) && isequal(Param.Action.RUN,0)% function activated from the GUI series but not RUN
    6464    ParamOut.AllowInputSort='off';% allow alphabetic sorting of the list of input file SubDir (options 'off'/'on', 'off' by default)
    6565    ParamOut.WholeIndexRange='off';% prescribes the file index ranges from min to max (options 'off'/'on', 'off' by default)
     
    7575    % check for selection of a projection object
    7676    hseries=findobj(allchild(0),'Tag','series');% handles of the GUI series
     77    hhseries=guidata(hseries);
    7778    if  ~isfield(Param,'ProjObject')
    7879        answer=msgbox_uvmat('INPUT_Y-N','use a projection object for the time_series?');
    7980        if strcmp(answer,'Yes')
    80             hhseries=guidata(hseries);
    8181            set(hhseries.CheckObject,'Visible','on')
    8282            set(hhseries.CheckObject,'Value',1)
     
    8484        end
    8585    end
     86   
    8687    % introduce bin size for histograms
    8788    if isfield(Param,'CheckObject') &&Param.CheckObject
    8889        SeriesData=get(hseries,'UserData');
    8990        if ismember(SeriesData.ProjObject.ProjMode,{'inside','outside'})
    90              answer=msgbox_uvmat('INPUT_TXT','set bin size for histograms (or keep ''auto'' by default)?','auto');
     91            answer=msgbox_uvmat('INPUT_TXT','set bin size for histograms (or keep ''auto'' by default)?','auto');
    9192            ParamOut.ActionInput.VarMesh=str2double(answer);
    9293        end
    9394    end
     95   
    9496    % 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
     97    if size(Param.InputTable,1)>2
     98        msgbox_uvmat('WARNING','''time_series'' uses only one or two input lines (two for substraction). To concatene fields first use ''merge_proj''');
     99    end
     100    if size(Param.InputTable,1)>=2
     101        answer=msgbox_uvmat('INPUT_Y-N','substract the two input file series?');
     102        if strcmp(answer,'Yes')
     103            if isempty(Param.FieldTransform.TransformName)
     104                set(hhseries.TransformName,'value',2) %select sub_field
     105            end
     106        else
     107            set(hhseries.InputTable,'Data',Param.InputTable(1,:))
     108        end
     109    end
     110   
    99111    % check the existence of the first and last file in the series
    100      first_j=[];
     112    first_j=[];
    101113    if isfield(Param.IndexRange,'first_j'); first_j=Param.IndexRange.first_j; end
    102114    last_j=[];
     
    291303    end
    292304end
    293 CheckSub=0;%default
    294 if isfield(Parma,'ActionInput') && isfield(Param.ActionInput,'CheckSub')
    295 CheckSub=ParamOut.ActionInput.CheckSub;
    296 end
     305
    297306%%%%%%%%%%%%%%%% loop on field indices %%%%%%%%%%%%%%%%
    298307for index=1:nbfield
     
    322331        % coordinate transform (or other user defined transform)
    323332        if ~isempty(transform_fct)
    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
     333            switch nargin(transform_fct)
     334                case 4
     335                    if length(Data)==2
     336                        Field=transform_fct(Data{1},XmlData{1},Data{2},XmlData{2});
     337                    else
    339338                        Field=transform_fct(Data{1},XmlData{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
     339                    end
     340                case 3
     341                    if length(Data)==2
     342                        Field=transform_fct(Data{1},XmlData{1},Data{2});
     343                    else
     344                        Field=transform_fct(Data{1},XmlData{1});
     345                    end
     346                case 2
     347                    Field=transform_fct(Data{1},XmlData{1});
     348                case 1
     349                    Field=transform_fct(Data{1});
    353350            end
    354351        end
Note: See TracChangeset for help on using the changeset viewer.