Changeset 54 for trunk/src/civ.m


Ignore:
Timestamp:
Mar 16, 2010, 7:41:52 AM (11 years ago)
Author:
sommeria
Message:

sub_background modified to accept various movie and image inputs
geometry_calib, editxml, civ modified to read a unique PARAM.xml parameter file (instead of PARAM_LINUX...)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/civ.m

    r45 r54  
    114114if isunix
    115115    syst='LINUX';
    116     xmlfile=fullfile(path_UVMAT,'PARAM_LINUX.xml');
    117     if exist(xmlfile,'file')
    118         try
    119         t=xmltree(xmlfile);
    120         sparam=convert(t);
    121         catch
    122              errormsg={[' Problem for reading ' xmlfile]; lasterr};   
    123         end
    124     else
    125         erromsg=[xmlfile ' not found: path to civx binaries undefined'];
    126     end
    127116else
    128117    syst='WIN';
    129     xmlfile=fullfile(path_UVMAT,'PARAM_WIN.xml');
    130     if exist(xmlfile,'file')
    131         try
    132         t=xmltree(xmlfile);
    133         sparam=convert(t);
    134         catch
    135              errormsg={[' Problem for reading ' xmlfile]; lasterr};
    136         end
    137     else
    138         erromsg=[xmlfile ' not found: path to civx binaries undefined'];
    139     end
     118end
     119xmlfile=fullfile(path_UVMAT,'PARAM.xml');
     120if exist(xmlfile,'file')
     121    try
     122    t=xmltree(xmlfile);
     123    sparam=convert(t);
     124    catch
     125         errormsg={[' Problem for reading ' xmlfile]; lasterr};   
     126    end
     127else
     128    errormsg=[xmlfile ' not found: path to civx binaries undefined'];
    140129end
    141130display(syst)
     
    160149if ~sge
    161150    if isequal(todo_path,'') || isequal(todo_path,[])
    162         display(['no batch distributed processing available:file path TODO.txt not defined in UVMAT/PARAM_' syst])
     151        display(['no batch distributed processing available:file path TODO.txt not defined in UVMAT/PARAM.xml'])
    163152        test_batch=0;
    164153    end
     
    327316   end
    328317end
    329 [RootPath,RootFile,str1,str2,str_a,str_b,ext,nom_type,subdir]=name2display(fileinput)
     318[RootPath,RootFile,str1,str2,str_a,str_b,ext,nom_type,subdir]=name2display(fileinput);
    330319filebase=fullfile(RootPath,RootFile);
    331 if isequal(nom_type,'*')% all fields in a single file ( movie files)
    332     num_i1=1;num_i2=1;num_j1=1;num_j2=1;
    333 else
    334     num_i1=str2double(str1);
    335     num_i2=str2double(str2);
    336     num_j1=str2double(str_a);
    337     num_j2=str2double(str_b);
    338 end
     320% if isequal(nom_type,'*')% all fields in a single file ( movie files)
     321%     num_i1=1;num_i2=1;num_j1=1;num_j2=1;
     322% else
     323num_i1=stra2num(str1);
     324if isempty(num_i1),num_i1=1;end
     325num_i2=stra2num(str2);
     326if isempty(num_i2),num_i2=1;end
     327num_j1=stra2num(str_a);
     328if isempty(num_j1),num_j1=1;end
     329num_j2=stra2num(str_b);
     330if isempty(num_j2),num_j2=1;end
    339331if isequal(get(handles.compare,'Value'),1)
    340332    browse=[];%initialisation
     
    460452
    461453%------------------------------------------------------------------------
    462 %function activated when a new filebase (image series) is introduced
     454% --- function activated when a new filebase (image series) is introduced
    463455function displ_filebase_Callback(hObject, eventdata, handles)
    464456%------------------------------------------------------------------------
     
    566558    if isfield(XmlData,'Time')
    567559        time=XmlData.Time;
    568         nbfield=size(XmlData.Time,1);
    569         nburst=size(XmlData.Time,2);
     560        nbfield=size(time,1);
     561        nburst=size(time,2);
    570562    end
    571563    ext_ima_read=[];
     
    835827end
    836828displ_num=[];%default
    837 first_i=str2num(get(handles.first_i,'String'));
     829ref_i=str2num(get(handles.ref_i,'String'));
    838830% last_i=str2num(get(handles.last_i,'String'));
    839831time=get(handles.displ_filebase,'UserData'); %get the set of times
     
    857849             numlist_b(index)=numod_b;
    858850             if ~isempty(time)
    859                 dt(numod_a,numod_b)=time(first_i,numod_b)-time(first_i,numod_a);%first time interval dt
     851                dt(numod_a,numod_b)=time(ref_i,numod_b)-time(ref_i,numod_a);%first time interval dt
    860852                displ_dt(index)=dt(numod_a,numod_b);
    861853             else
     
    16341626    path_uvmat=which('uvmat');% check the path detected for source file uvmat
    16351627    path_UVMAT=fileparts(path_uvmat); %path to UVMAT
    1636     if isunix
    1637         %fid = fopen(fullfile(path_UVMAT,'PARAM_LINUX.txt'),'r');%open the file with civ binary names
    1638         xmlfile=fullfile(path_UVMAT,'PARAM_LINUX.xml');
    1639         if exist(xmlfile,'file')
    1640             t=xmltree(xmlfile);
    1641             sparam=convert(t);
    1642         end
    1643     else
    1644         %fid = fopen(fullfile(path_UVMAT,'PARAM_WIN.txt'),'r');%open the file with civ binary names
    1645         xmlfile=fullfile(path_UVMAT,'PARAM_WIN.xml');
    1646         if exist(xmlfile,'file')
    1647             t=xmltree(xmlfile);
    1648             sparam=convert(t);
    1649         end
    1650     end
     1628    %fid = fopen(fullfile(path_UVMAT,'PARAM_LINUX.txt'),'r');%open the file with civ binary names
     1629    xmlfile=fullfile(path_UVMAT,'PARAM.xml');
     1630    if exist(xmlfile,'file')
     1631        t=xmltree(xmlfile);
     1632        sparam=convert(t);
     1633    end
    16511634    if isfield(sparam,'Civ1_exe')
    16521635        civ1_exe=sparam.Civ1_exe;
    1653         if isequal(civ1_exe(1:4),'civx')%the binary is defined in /civx, default setting
     1636        if ~exist(civ1_exe,'file')
    16541637            civ1_exe=fullfile(path_UVMAT,civ1_exe);
    16551638        end
     
    16571640    if isfield(sparam,'Civ2_exe')
    16581641        civ2_exe=sparam.Civ2_exe;
    1659         if isequal(civ2_exe(1:4),'civx')%the binary is defined in /civx, default setting
     1642        if ~exist(civ2_exe,'file')%the binary is defined in /bin, default setting
    16601643            civ2_exe=fullfile(path_UVMAT,civ2_exe);
    16611644        end
     
    16631646    if isfield(sparam,'Patch_exe')
    16641647        patch_exe=sparam.Patch_exe;
    1665         if isequal(patch_exe(1:4),'civx')%the binary is defined in /civx, default setting
     1648        if ~exist(patch_exe,'file')%the binary is defined in /bin, default setting
    16661649            patch_exe=fullfile(path_UVMAT,patch_exe);
    16671650        end
     
    21182101path_uvmat=which('uvmat');% check the path detected for source file uvmat
    21192102path_UVMAT=fileparts(path_uvmat); %path to UVMAT
    2120 if isunix
    2121     xmlfile=fullfile(path_UVMAT,'PARAM_LINUX.xml');
    2122     if exist(xmlfile,'file')
    2123         t=xmltree(xmlfile);
    2124         sparam=convert(t);
    2125     end
    2126 else
    2127     xmlfile=fullfile(path_UVMAT,'PARAM_WIN.xml');
    2128     if exist(xmlfile,'file')
    2129         t=xmltree(xmlfile);
    2130         sparam=convert(t);
    2131     end
    2132 end
     2103xmlfile=fullfile(path_UVMAT,'PARAM.xml');
     2104if exist(xmlfile,'file')
     2105    t=xmltree(xmlfile);
     2106    sparam=convert(t);
     2107end
     2108% else
     2109%     xmlfile=fullfile(path_UVMAT,'PARAM_WIN.xml');
     2110%     if exist(xmlfile,'file')
     2111%         t=xmltree(xmlfile);
     2112%         sparam=convert(t);
     2113%     end
     2114% end
    21332115sge=0;
    21342116if isfield(sparam,'Civ_exe')
     
    23502332time=get(handles.displ_filebase,'UserData'); %get the set of times
    23512333civAll=get(handles.Experimental,'Value'); % Boolean for new civ excution method
    2352 'TESTbatch'
    2353 size(filecell.nc.civ1)
    2354 nbslice
    2355 nbfield
    23562334for ifile=1:nbfield
    23572335    for j=1:nbslice
     
    24092387            end
    24102388           
    2411             %TESTgrid
    24122389            test_grid=get(handles.browse_gridciv1,'Value');
    24132390            if test_grid
     
    24322409                  par_civ1.gridflag='n';
    24332410            end
    2434             %endTESTgrid
    2435            
     2411            %           
    24362412            i_cmd=i_cmd+1;
    24372413            if isequal(civAll,0)
Note: See TracChangeset for help on using the changeset viewer.