Changeset 453 for trunk


Ignore:
Timestamp:
Jun 13, 2012, 5:03:06 PM (12 years ago)
Author:
sommeria
Message:

series adapted to BATCH mode. Tests still needed.

Location:
trunk/src
Files:
1 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/get_file_series.m

    r450 r453  
    77%        iview: line in the table corresponding to a given file series
    88%        fileindex: file index within  the file series,
    9 % i1_series(iview,ref_j,ref_i)... are the corresponding arrays of indices i1,i2,j1,j2, depending on the input line iview and the two reference indices ref_i,ref_j
    10 % i1_series(iview,fileindex) expresses the same indices as a 1D array in file indices
     9% i1_series{iview}(ref_j,ref_i)... are the corresponding arrays of indices i1,i2,j1,j2, depending on the input line iview and the two reference indices ref_i,ref_j
     10% i1_series{iview}(fileindex) expresses the same indices as a 1D array in file indices
    1111
    1212% INPUT:
     
    5050        r(1).mode='';
    5151    end
    52     [i1_series_iview,i2_series_iview,j1_series_iview,j2_series_iview]=find_file_indices(ref_i,ref_j,str2num(r.num1),str2num(r.num2),r.mode);
     52    [i1_series{iview},i2_series{iview},j1_series{iview},j2_series{iview}]=find_file_indices(ref_i,ref_j,str2num(r.num1),str2num(r.num2),r.mode);
    5353    %case of pairs (.nc files)
    5454    i2=[];j1=[];j2=[];
    55     for ifile=1:numel(i1_series_iview)
    56         i1=i1_series_iview(ifile);
    57         if ~isempty(i2_series_iview)
    58             i2=i2_series_iview(ifile);
     55    for ifile=1:numel(i1_series{iview})
     56        i1=i1_series{iview}(ifile);
     57        if ~isempty(i2_series{iview})
     58            i2=i2_series{iview}(ifile);
    5959        end
    60         if ~isempty(j1_series_iview)
    61             j1=j1_series_iview(ifile);
     60        if ~isempty(j1_series{iview})
     61            j1=j1_series{iview}(ifile);
    6262        end
    63         if ~isempty(j2_series_iview)
    64             j2=j2_series_iview(ifile);
     63        if ~isempty(j2_series{iview})
     64            j2=j2_series{iview}(ifile);
    6565        end
    6666        filecell{iview,ifile}=fullfile_uvmat(InputTable{iview,1},InputTable{iview,2},InputTable{iview,3},InputTable{iview,5},InputTable{iview,4}...
    6767            ,i1,i2,j1,j2);
    6868    end
    69     i1_series(iview,:,:)=i1_series_iview;
    70     i2_series(iview,:,:)=i2_series_iview;
    71     j1_series(iview,:,:)=j1_series_iview;
    72     j2_series(iview,:,:)=j2_series_iview;
    7369end
    7470
  • trunk/src/series.m

    r450 r453  
    12591259set(handles.RUN, 'Enable','Off')
    12601260set(handles.RUN,'BackgroundColor',[0.831 0.816 0.784])
    1261 [h_fun,Series,errormsg]=prepare_jobs(handles);
     1261[h_fun,Series,filexml,errormsg]=prepare_jobs(handles);
    12621262if ~isempty(errormsg)
    12631263    msgbox_uvmat('ERROR',errormsg)
    12641264else
     1265   Series.Specific=h_fun(Series,0);   
     1266   t=struct2xml(Series);
     1267    t=set(t,1,'name','Series');
     1268    save(t,filexml);
    12651269    h_fun(Series);
    12661270end
     
    12831287set(handles.BATCH, 'Enable','Off')
    12841288set(handles.BATCH,'BackgroundColor',[0.831 0.816 0.784])
    1285 [h_fun,Series,errormsg]=prepare_jobs(handles);
     1289[h_fun,Series,filexml,errormsg]=prepare_jobs(handles);
    12861290if ~isempty(errormsg)
    12871291    msgbox_uvmat('ERROR',errormsg)
    12881292    return
    12891293end
     1294% update the xml file after interactive input with the function
     1295Series.Specific=h_fun(Series,0);   
     1296t=struct2xml(Series);
     1297t=set(t,1,'name','Series');
     1298save(t,filexml);
    12901299path_series=fileparts(which('series'));
    12911300filename_xml=fullfile(Series.OutputDir,[Series.OutputRootFile '.xml']);
     
    12961305    return
    12971306end
     1307fctpath=get(handles.ActionPath,'String');
    12981308text_matlabscript=[...
    12991309    '#!/bin/bash \n'...
     
    13011311    'matlab -nodisplay -nosplash -nojvm <<END_MATLAB \n'...
    13021312    'cd(''' path_series '''); \n'...
     1313    'addpath(''' fctpath '''); \n'...
    13031314    '' Series.Action  '( ''' filename_xml '''); \n'...
    13041315    'exit \n'...
     
    13231334%------------------------------------------------------------------------
    13241335% --- Main lauch command, called by RUN and BATCH
    1325 function [h_fun,Series,errormsg]=prepare_jobs(handles)
     1336function [h_fun,Series,filexml,errormsg]=prepare_jobs(handles)
    13261337%------------------------------------------------------------------------
    13271338errormsg='';
     
    16881699         delete(hget_field)%delete opened versions of get_field
    16891700     end
    1690      [filecell,i1_series,i2_series,j1_series,j2_series]=get_file_series(read_GUI(handles.series));
     1701     filecell=get_file_series(read_GUI(handles.series));
    16911702     if exist(filecell{1,1},'file')
    16921703        get_field(filecell{1,1})
  • trunk/src/struct2xml.m

    r450 r453  
    4848     [t,new_uid]=add(t,uid,'element',key);
    4949     [t]=add(t,new_uid,'chardata',val);
    50  elseif isnumeric(val)
     50 elseif isnumeric(val)||islogical(val)
    5151       siz=size(val);
    5252       if length(siz)<=2 %do not translate matrices with more than 2 indices
  • trunk/src/xml2struct.m

    r450 r453  
    3939    case 'cell'
    4040        for ilist=1:numel(ss)
     41            if ~isempty(str2num(ss{ilist}))
    4142            out(ilist,:)=str2num(ss{ilist});
     43            end
    4244        end
    4345    otherwise
Note: See TracChangeset for help on using the changeset viewer.