Changeset 286 for trunk


Ignore:
Timestamp:
Nov 18, 2011, 8:32:10 PM (12 years ago)
Author:
gostiaux
Message:

Patch1 OK

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/civ.m

    r285 r286  
    16541654
    16551655
    1656 %% get checkpatch1 parameters
    1657 if Param.CheckPatch1
    1658     param.Patch1=read_panel(handles.Patch1);
    1659     %param.checkpatch1=read_param_patch1(handles)
    1660 end
    1661 
    1662 %% get checkciv2 parameters:
    1663 if Param.CheckCiv2
    1664     param.civ2=read_param_civ2(handles,cell2mat(filecell.ima1.civ2(1,1)));
    1665 end
    1666 
    1667 %% get checkfix2 parameters
    1668 if Param.CheckFix2
    1669     flagindex2(1)=get(handles.vec_Fmin2_2, 'Value');
    1670     flagindex2(2)=get(handles.vec_F3_2, 'Value');
    1671     flagindex2(3)=get(handles.vec_F4, 'Value');
    1672     thresh_vec2C=str2double(get(handles.thresh_vec2C,'String'));%threshold on image correlation vec_C
    1673     thresh_vel2=str2double(get(handles.thresh_vel2,'String'));%threshold on velocity modulus
    1674     test_mask=get(handles.CheckMask,'Value');
    1675     nbslice_mask=get(handles.mask_fix2,'UserData'); % get the number of slices (= number of masks)
    1676     %%%%%%%%%%%%%COMPLETER LE PROGRAMME FIX AVEC REF FILE ET OPTION inf_sup=2
    1677     %     inf_sup=get(handles.inf_sup2,'Value');
    1678     %     ref=get(handles.ref_fix2,'UserData');
    1679    
    1680     %%%%%%%%%%%%%%%%%%%
    1681 end
    1682 
    1683 %% get checkpatch2 parameters
    1684 if Param.CheckPatch2==1
    1685     param.Patch2=read_panel(handles.Patch1);
    1686 end
    1687 
    1688 %%
    1689 
    1690 
    16911656%% MAIN LOOP
    16921657time=get(handles.ImaDoc,'UserData'); %get the set of times
     
    18321797            switch CivMode
    18331798                case 'CivX'
    1834                     cmd_PATCH=cmd_patch(filecell.nc.civ1{ifile,j},param.Patch1,Param.xml.PatchBin);
    1835                     cmd=[cmd cmd_PATCH '\n'];
     1799                    cmd=[cmd...
     1800                        cmd_patch(filecell.nc.civ1{ifile,j},Param,'Patch1') '\n'];
    18361801                case 'CivAll'
    18371802                    patch1.inputFileName=filecell.nc.civ1{ifile,j} ;
     
    31893154
    31903155%------------------------------------------------------------------------
    3191 % --- PATCH
    3192 function cmd=cmd_patch(filename_nc,Param,PatchBin)
    3193 %------------------------------------------------------------------------
    3194 namelog=[filename_nc(1:end-3) '_patch.log'];
    3195 
    3196 % if test_interp==0
    3197     if isunix
    3198     cmd=[PatchBin...
    3199         ' -f ' filename_nc ' -m ' num2str(Param.Nx)...
    3200         ' -n ' num2str(Param.Ny) ' -ro ' num2str(Param.SmoothingParam)...
    3201         ' -nopt ' num2str(Param.SubdomainSize) ...
    3202         '  > ' namelog ' 2>&1']; % redirect standard output to the log file
    3203     else
    3204       cmd=['"' Param.xml.PatchBin...
    3205           '" -f "' filename_nc '" -m ' param.Patch1.Nx...
    3206           ' -n ' param.Patch1.Ny ' -ro ' param.Patch1.SmoothParam...
    3207           ' -nopt ' Param.Patch1.SubdomainSize ...
    3208         '  > "' namelog '" 2>&1']; % redirect standard output to the log file
    3209     end
    3210 % else %nouveau programme patch
    3211 %     cmd=[PatchBin ' -f ' filename_nc ' -m ' nx_patch  ' -n ' ny_patch ' -ro ' rho_patch ...
    3212 %         ' -max ' thresh_value ' -nopt ' subdomain_patch  '  > ' namelog ' 2>&1']; % redirect standard output to the log file
    3213 % end
    3214 cmd=regexprep(cmd,'\\','\\\\');
    3215 
    3216 %------------------------------------------------------------------------
    32173156% --- STEREO Interp
    32183157function cmd=RUN_STINTERP(stinterpBin,filename_A_nc,filename_B_nc,filename_nc,nx_patch,ny_patch,rho_patch,subdomain_patch,thresh_value,xmlA,xmlB)
     
    43434282% end
    43444283%
    4345 %------------------------------------------------------------------------
    4346 function par=read_param_fix1(handles,filecell)
    4347 %------------------------------------------------------------------------
    4348     par.flagindex1(1)=get(handles.CheckFmin2, 'Value');
    4349     par.flagindex1(2)=get(handles.CheckF3, 'Value');
    4350     par.flagindex1(3)=get(handles.CheckF2, 'Value');
    4351     par.thresh_vecC1=str2double(get(handles.num_MinCorr,'String'));%threshold on image correlation vec_C
    4352     par.thresh_vel1=str2double(get(handles.num_MaxVel,'String'));%threshold on velocity modulus
    4353     par.test_mask=get(handles.CheckMask,'Value');
    4354     par.nbslice_mask=get(handles.txt_MaskName,'UserData'); % get the number of slices (= number of masks)
    4355     %%%%%%%%%%%%%COMPLETER LE PROGRAMME FIX
    4356     %     inf_sup=get(handles.inf_sup1,'Value');80
    4357     %     fileref=get(handles.ref_fix1,'String');
    4358     %     refpath=get(handles.ref_fix1,'UserData');
    4359     %     fileref=fullfile(refpath,fileref);
    4360     par.menu=get(handles.field_ref1,'String');
    4361     par.index=get(handles.field_ref1,'Value');
    4362     if isempty(par.menu)
    4363         par.fieldchoice='';
    4364     else
    4365         par.fieldchoice=menu{index};
    4366         msgbox_uvmat('WARNING','reference field is not used presently with batch, use RUN option')
    4367     end
    4368            if par.test_mask==0
    4369                 par.maskname='';
    4370             else
    4371                 maskdispl=get(handles.txt_MaskName,'String');
    4372                 nbslice_mask=str2double(maskdispl(1:end-4)); %
    4373                 num1_mask=mod(num1_civ1(ifile)-1,nbslice_mask)+1;
    4374                 maskbase=[filecell.filebase '_' maskdispl];
    4375                 par.maskname=name_generator(maskbase,num1_mask,1,'.png','_i');
    4376            end
    43774284 
    4378 %------------------------------------------------------------------------
    4379 function par=read_param_patch1(handles)
    4380 %------------------------------------------------------------------------
    4381 
    4382 par.rho_patch=str2double(get(handles.rho_patch1,'String'));
    4383 if isnan(par.rho_patch)
    4384     par.rho_patch='1000';
    4385     set(handles.rho_patch1,'String','1')
    4386 else
    4387     par.rho_patch=num2str(1000*par.rho_patch);
    4388 end
    4389 par.nx_patch=get(handles.nx_patch1,'String');
    4390 par.ny_patch=get(handles.ny_patch1,'String');
    4391 if isnan(str2double(par.nx_patch))
    4392     par.nx_patch='50' ;%default
    4393     set(handles.nx_patch1,'String','50');
    4394 end
    4395 if isnan(str2double(par.ny_patch))
    4396     par.ny_patch='50' ;%default
    4397     set(handles.ny_patch1,'String','50');
    4398 end
    4399 par.subdomain_patch=get(handles.subdomain_patch1,'String');
    4400 par.thresh_patch=get(handles.thresh_patch1,'String');
    4401 
    44024285           
    44034286%------------------------------------------------------------------------
     
    54685351    cmd=[Param.xml.FixBin ' -f ' filename '.nc -fi1 ' num2str(Param.(fixname).flagindex(1)) ...
    54695352        ' -fi2 ' num2str(Param.(fixname).flagindex(2)) ' -fi3 ' num2str(Param.(fixname).flagindex(3)) ...
    5470         ' -threshC ' num2str(Param.(fixname).thresh_vecC) ' -threshV ' num2str(Param.(fixname).thresh_vel)...
    5471         ' -maskName ' Param.(fixname).MaskName '" > ' filename '.fix1.log'];
     5353        ' -threshC ' num2str(Param.(fixname).thresh_vecC)...% ' -threshV ' num2str(Param.(fixname).thresh_vel)...
     5354        ' -maskName ' Param.(fixname).MaskName...
     5355        '" > ' filename '.' lower(fixname) '.log 2>&1'];
    54725356else
    54735357    cmd=['"' Param.xml.FixBin '" -f "' filename '.nc" -fi1 ' num2str(Param.(fixname).CheckFmin2)...
    54745358        ' -fi2 ' num2str(Param.(fixname).CheckF2) ' -fi3 ' num2str(Param.(fixname).CheckF3) ...
    54755359        ' -threshC ' num2str(Param.(fixname).MinCorr)...
    5476         ' -maskName "' Param.(fixname).MaskName '" > "' filename '.fix1.log"'];
     5360        ' -maskName "' Param.(fixname).MaskName...
     5361        '" > "' filename '.' lower(fixname) '.log" 2>&1'];
    54775362%         ' -threshV ' num2str(Param.(fixname).thresh_vel)...
    54785363    cmd=regexprep(cmd,'\\','\\\\');
    54795364end
     5365
     5366
     5367function cmd=cmd_patch(filename,Param,patchname)
     5368%% ------------------------------------------------------------------------
     5369filename=regexprep(filename,'.nc','');
     5370% if test_interp==0
     5371if isunix
     5372    cmd=[Param.xml.PatchBin...
     5373        ' -f ' filename '.nc -m ' num2str(Param.(patchname).Nx)...
     5374        ' -n ' num2str(Param.(patchname).Ny) ' -ro ' num2str(Param.(patchname).SmoothingParam)...
     5375        ' -nopt ' num2str(Param.(patchname).SubdomainSize) ...
     5376        '  > ' filename '.' lower(patchname) '.log 2>&1']; % redirect standard output to the log file
     5377else
     5378    cmd=['"' Param.xml.PatchBin...
     5379        '" -f "' filename '.nc" -m ' num2str(Param.(patchname).Nx)...
     5380        ' -n ' num2str(Param.(patchname).Ny) ' -ro ' num2str(Param.(patchname).SmoothingParam)...
     5381        ' -nopt ' num2str(Param.(patchname).SubdomainSize)...
     5382        '  > "' filename '.' lower(patchname) '.log" 2>&1']; % redirect standard output to the log file
     5383    cmd=regexprep(cmd,'\\','\\\\');
     5384end
     5385% else %nouveau programme patch
     5386%     cmd=[PatchBin ' -f ' filename_nc ' -m ' nx_patch  ' -n ' ny_patch ' -ro ' rho_patch ...
     5387%         ' -max ' thresh_value ' -nopt ' subdomain_patch  '  > ' namelog ' 2>&1']; % redirect standard output to the log file
     5388% end
Note: See TracChangeset for help on using the changeset viewer.