Changeset 134
- Timestamp:
- Nov 25, 2010, 3:49:11 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/civ.m
r133 r134 1849 1849 time=get(handles.RootName,'UserData'); %get the set of times 1850 1850 civAll=get(handles.Experimental,'Value'); % Boolean for new civ excution method 1851 super_cmd='#!/bin/bash \n'; 1852 super_cmd=[super_cmd '#$ -cwd \n']; 1853 super_cmd=[super_cmd 'hostname && date \n']; 1851 super_cmd=[]; 1852 1854 1853 for ifile=1:nbfield 1855 1854 for j=1:nbslice … … 2096 2095 %endTESTgrid 2097 2096 i_cmd=i_cmd+1; 2098 cmd_CIV2=CIV2_CMD(filename_cmx,namelog,par_civ2,sparam); 2097 filename_cmx(1:end-4) 2098 cmd_CIV2=CIV2_CMD(filename_cmx(1:end-4),namelog,par_civ2,sparam); 2099 2099 if isequal(civAll,0) 2100 2100 if(isunix) … … 2233 2233 %% to lauch the jobs locally : 2234 2234 if(isunix) 2235 %cmd_str=['!. ' filename_bat ' &'];2236 cmd_str=['!. ' filename_bat];2235 cmd_str=['!. ' filename_bat ' &']; 2236 % cmd_str=['!. ' filename_bat]; 2237 2237 display(cmd_str) 2238 % super_cmd=[super_cmd filename_bat]2239 2238 % cmd_str=['!at -qb now -f ' filename_bat ' &']; %ou at -qb now -f bad idea... 2240 2239 else %case of Windows 2241 2240 cmd_str=['!' filename_bat ' &']; 2242 2241 end 2243 eval(cmd_str); 2244 display(cmd_str); 2245 end 2246 end 2247 end 2242 super_cmd=[super_cmd '. ' filename_bat '\n'] 2243 % eval(cmd_str); 2244 % display(cmd_str); 2245 end 2246 end 2247 end 2248 2249 2250 % filename_superbat(end-2:end)='bat'; 2251 % fid=fopen(filename_bat,'w'); 2252 % fprintf(fid,cmd); 2253 % fclose(fid); 2254 2248 2255 if ~batch%TODO: a revoir, cas 'run as background task' 2249 eval(['!.' super_cmd]) 2250 end 2256 eval(['!. ' filename_superbat ' &']) 2257 [Rootbat,Filebat,extbat]=fileparts(filename_cmx); 2258 filename_superbat=fullfile(Rootbat,['toto.bat']); 2259 fid=fopen(filename_superbat,'w'); 2260 fprintf(fid,super_cmd'); 2261 fclose(fid); 2262 end 2263 2251 2264 2252 2265 %save interface state … … 2272 2285 end 2273 2286 saveas(gcbf,namefigfull);%save the interface with name namefigfull (A CHANGER EN FICHIER .xml) 2287 2288 2274 2289 2275 2290 function [filecell,num1_civ1,num2_civ1,num_a_civ1,num_b_civ1,num1_civ2,num2_civ2,num_a_civ2,num_b_civ2,nom_type_nc,file_ref_fix1,file_ref_fix2]=... … … 2446 2461 if isequal(subdir_civ1,''),subdir_civ1='A'; end% put default subdir 2447 2462 if isequal(subdir_civ2,''),subdir_civ2=subdir_civ1; end% put default subdir 2448 currentdir=pwd ;%store the current working directory2463 currentdir=pwd%store the current working directory 2449 2464 [Path_ima,Name]=fileparts(filebase);%Path of the image files (.civ) 2450 2465 if ~exist(Path_ima,'dir') … … 2453 2468 return 2454 2469 end 2455 cd(Path_ima);%move to the directory of the images: needed to create the result dir by 'mkdir'2456 dircur=pwd; %current working directory2457 m2='';2458 2470 [xx,message]=fileattrib(Path_ima); 2459 2471 if ~isempty(message) && ~isequal(message.UserWrite,1) … … 2493 2505 end 2494 2506 end 2507 2495 2508 %create the new subdir_civ1 2496 2509 if ~exist(fullfile(Path_ima,subdir_civ1_new),'dir') 2510 cd(Path_ima); 2497 2511 [xx,msg1]=mkdir(subdir_civ1_new); 2512 2498 2513 if ~strcmp(msg1,'') 2499 2514 msgbox_uvmat('ERROR',['cannot create ' subdir_civ1_new ': ' msg1])%error message for directory creation 2500 cd(currentdir)2501 2515 filecell={}; 2502 2516 return 2503 else 2517 else 2504 2518 [xx,msg2] = fileattrib(subdir_civ1_new,'+w','g'); %yield writing access (+w) to user group (g) 2505 2519 if ~strcmp(msg2,'') 2506 msgbox_uvmat('ERROR',['cannot create ' subdir_civ1_new ': ' msg2])%error message for directory creation 2507 cd(currentdir) 2520 msgbox_uvmat('ERROR',['pb of permission for ' subdir_civ1_new ': ' msg2])%error message for directory creation 2508 2521 filecell={}; 2509 2522 return 2510 2523 end 2511 2524 end 2525 cd(currentdir); 2512 2526 end 2513 2527 if strcmp(compare,'stereo PIV')&&(strcmp(mode,'pair j1-j2')||strcmp(mode,'series(Dj)')||strcmp(mode,'series(Di)'))%check second nc series … … 2538 2552 % subdir_civ1=subdir_civ1_new; 2539 2553 %create the new subdir_civ1 2540 if ~exist(fullfile(Path_ima,subdir_civ1_new),'dir') 2554 if exist(fullfile(Path_ima,subdir_civ1_new),'dir') 2555 cd(Path_ima); 2541 2556 [xx,msg1]=mkdir(subdir_civ1_new); 2557 cd(currentdir); 2542 2558 if ~strcmpl(msg1,'') 2543 2559 msgbox_uvmat('ERROR',['cannot create ' subdir_civ1_new ': ' msg1]) … … 4182 4198 %------------------------------------------------------------------------ 4183 4199 % --- CIV2 CIV2 CIV2 CIV2 4184 function cmd_CIV2=CIV2_CMD(filename _cmx,namelog,par,sparam)4200 function cmd_CIV2=CIV2_CMD(filename,namelog,par,sparam) 4185 4201 %------------------------------------------------------------------------ 4186 4202 %pixels per cm and matrix of the image times, read from the .civ file by uvmat … … 4226 4242 par.filename_ima_a=regexprep(par.filename_ima_a,'.png',''); 4227 4243 par.filename_ima_b=regexprep(par.filename_ima_b,'.png','');% bug : .png appears two times ? 4228 fid=fopen([filename _cmx '2'],'w');4244 fid=fopen([filename '.cmx2'],'w'); 4229 4245 fprintf(fid,['############## CMX file' '\n' ]); 4230 4246 fprintf(fid, ['FirstImage ' regexprep(par.filename_ima_a,'\\','\\\\') '\n' ]);% for windows compatibility … … 4259 4275 fclose(fid); 4260 4276 4261 cmd_CIV2=[sparam.Civ2Bin ' -f ' filename _cmx]; % redirect standard output to the log file4277 cmd_CIV2=[sparam.Civ2Bin ' -f ' filename '.cmx >' filename '.log' ]; % redirect standard output to the log file 4262 4278 cmd_CIV2=regexprep(cmd_CIV2,'\\','\\\\'); 4279 namelog=regexprep(namelog,'\\','\\\\'); 4280 4281 if(isunix) 4282 [Rootbat,Filebat,extbat]=fileparts(namelog); 4283 ncName=fullfile(Rootbat,[ Filebat '.nc']); 4284 cmd_CIV2=[cmd_CIV2 '\n' 'mv ' namelog ' ' regexprep(namelog,'\.log','') '.civ2.log' '\n' 'chmod g+w ' ncName]; 4285 else 4286 cmd_CIV2=[cmd_CIV2 '\n' 'copy /Y ' namelog ' ' regexprep(namelog,'\.log','') '.civ2.log']; 4287 end 4288 4289 4263 4290 4264 4291 %------------------------------------------------------------------------
Note: See TracChangeset
for help on using the changeset viewer.