Changeset 72 for trunk/src/civ_3D.m


Ignore:
Timestamp:
Mar 30, 2010, 11:03:42 AM (14 years ago)
Author:
sommeria
Message:

ima2vol: write image volumes in 16 bits (test for civ_3D)
plot-text removed: put as a sub-function of plot_field
uvmat: movie stops in case of error in reding files
bug fixes for reading 3D vel fields

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/civ_3D.m

    r71 r72  
    581581        first_i=max(field_i+1,1);
    582582            %determine the set of times and possible intervals for CIV_3D
    583         dt=(1/1000)*str2num(get(handles.dt,'String'));
    584         time=(dt*[0:nb_field-1])';
     583%         dt=(1/1000)*str2num(get(handles.dt,'String'));
     584        time=(0:nb_field-1)';
    585585%             set(handles.incr_i,'UserData',dt);%store the time interval
    586586%             between successive images
     
    594594  last_j=1;
    595595end
    596 UvData.XmlData=XmlData;
    597596
    598597if exist('time','var')
     
    15481547for ifile=1:nbfield
    15491548    i_cmd=0;
    1550     cmd='';
    1551     if sge
    15521549       cmd='#!/bin/bash';
    15531550       cmd=char({cmd;'#$ -cwd'});
    15541551       cmd=char({cmd;'hostname && date'});
    1555     end
    15561552    filename_cmx=cell2mat(filecell_nc1(ifile));%output netcdf file
    15571553    filename_cmx([end-1:end])='cm';%name of cmx file
     
    15791575         pvalue=num2str((1-ind_answer)*500)
    15801576        save(civAllxml,par_civ1_3d_xml);
    1581    
    1582 %       if(isunix && sge)
    1583          ['echo /CIVX/bin/MPI/lam-7.1.3_g95/bin/mpirun C  ' Civ3D3CBin ' -p ' par_civ1_3d_xml '|qsub -p ' pvalue ' -q lam.q -pe lam_loose 16 -e ' par_civ1_3d_xml '.errors -o ' par_civ1_3d_xml '.log' ]
    1584          eval ( ['!echo /CIVX/bin/MPI/lam-7.1.3_g95/bin/mpirun C  ' Civ3D3CBin ' -p ' par_civ1_3d_xml '|qsub -p ' pvalue ' -q lam.q -pe lam_loose 16 -e ' par_civ1_3d_xml '.errors -o ' par_civ1_3d_xml '.log' ])
    1585 %       else
    1586 %           '3D mode is NOT supported without sge'
    1587 %       end
    1588      return
    1589         % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    1590         %  fichier xml produit
    1591         %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    1592         % A CONTINUER
    1593         %civAllxml
    1594         civAllCmd=[];
    1595         civAllxml=set(civAllxml,1,'name','civ3d3c');
    1596         namelog=[filename_cmx([1:end-3]) 'log'];
    1597         %par_civ1.Dt=num2str(time(num2_civ1(ifile),num_b_civ1(j))-time(num1_civ1(ifile),num_a_civ1(1)));
    1598         %par_civ1.T0=num2str((time(num2_civ1(ifile),num_b_civ1(j))+time(num1_civ1(ifile),num_a_civ1(1)))/2);
    1599        % test_mask=get(handles.get_mask_civ1,'Value');
    1600         i_cmd=i_cmd+1;
    1601 %         if isequal(civAll,0)
    1602 %             cmd=char({cmd;BATCH_CIV1(filename_cmx([1:end-4]),namelog,par_civ1,handles)});
    1603 %         else
    1604              civAllCmd=[civAllCmd ' civ1 '];
    1605              str=BATCH_CIV1_Unified(filename_cmx([1:end-4]),namelog,par_civ1,handles);
    1606             fieldnames=fields(str);
    1607             [civAllxml,uid_civ1]=add(civAllxml,1,'element','civ1');
    1608             for ilist=1:length(fieldnames)
    1609               val=eval(['str.' fieldnames{ilist}]);
    1610               if ischar(val)
    1611                 [civAllxml,uid_t]=add(civAllxml,uid_civ1,'element',fieldnames{ilist});
    1612                 [civAllxml,uid_t2]=add(civAllxml,uid_t,'chardata',val);
    1613                end
    1614             end   
    1615 %         end
    1616     end         
    1617     if(isunix)
    1618             cmd=char({cmd ; ['cp -f ' filename_cmx '2 ' filename_cmx]; cmd_CIV2});
    1619     else
    1620         cmd=char({cmd ; ['copy /Y ' filename_cmx '2 ' filename_cmx]; cmd_CIV2});
    1621     end
    1622 end
    1623      
    1624 %  if isequal(civAll,1)
    1625     save(civAllxml,[filename_cmx([1:end-4]) '.xml']);
    1626     cmd=char({cmd;[Civ_exe ' -f ' [filename_cmx([1:end-4]) '.xml'] ' ' civAllCmd]});
    1627 
    1628      %save(civAllxml,'/tmp/test.xml');
    1629 %  end
    1630 
    1631 
    1632 % create the .bat file:
    1633 if sge
    1634         [Rootbat,Filebat,extbat]=fileparts(filename_cmx);
    1635         filename_bat=fullfile(Rootbat,['job_' Filebat extbat]);
    1636 else
    1637     filename_bat=filename_cmx;
    1638 end
    1639 filename_bat(end-2:end)='bat';
    1640 
    1641 %     pbat=fopen(filename_bat,'w'); %create the file filename_bat
    1642 dlmwrite(filename_bat,cmd,'');%write commands in filename_bat
    1643 if sge
    1644     pvalue=num2str((1-ind_answer)*500);
    1645     namelog=[filename_bat '.patch.log'];
    1646     ['!qsub -p ' pvalue ' -q civ_3D.q -e ' filename_cmx(1:end-4) '.errors -o ' filename_cmx(1:end-4) '.log' ' ' filename_bat];
    1647     eval(  ['!qsub -p ' pvalue ' -q civ_3D.q -e ' filename_cmx(1:end-4) '.errors -o ' filename_cmx(1:end-4) '.log' ' ' filename_bat]);
    1648 else
    1649     if(isunix)
    1650       cmdtodo=['. ' filename_bat ];%removed for Mathieu tests %' && rm -f ' filename_bat] ;
    1651     else
    1652 %      cmdtodo=[filename_bat ' && del /F /Q ' filename_bat];
    1653        cmdtodo=[filename_bat];%removed for Mathieu tests %' && del /F /Q ' filename_bat' ;
    1654     end
    1655     count= fprintf(p1,'%s\n', cmdtodo);
    1656 end
    1657 if ~sge
    1658     fclose(p1);
    1659     fclose(p0);
    1660     delete(name_lock);
    1661 end
     1577     nb_processor='8';
     1578         ['echo /CIVX/bin/MPI/lam-7.1.3_g95/bin/mpirun C  ' Civ3D3CBin ' -p ' par_civ1_3d_xml '|qsub -p ' pvalue ' -q lam.q -pe lam_loose ' nb_processor ' -e ' par_civ1_3d_xml '.errors -o ' par_civ1_3d_xml '.log' ]
     1579         eval ( ['!echo /CIVX/bin/MPI/lam-7.1.3_g95/bin/mpirun C  ' Civ3D3CBin ' -p ' par_civ1_3d_xml '|qsub -p ' pvalue ' -q lam.q -pe lam_loose ' nb_processor ' -e ' par_civ1_3d_xml '.errors -o ' par_civ1_3d_xml '.log' ])
     1580
     1581    end           
     1582end
     1583
    16621584set(handles.BATCH, 'Enable','On')
    16631585set(handles.BATCH,'BackgroundColor',[1 0 0])
    1664 %save interface state
     1586
     1587%save GUI state
    16651588[Path,Name]=fileparts(filebase);
    16661589namefig=fullfile(Path,subdir_civ2,Name);
Note: See TracChangeset for help on using the changeset viewer.