Changeset 183 for trunk/src/civ.m


Ignore:
Timestamp:
Jan 26, 2011, 5:03:40 PM (13 years ago)
Author:
sommeria
Message:

small bug repair: reading movies in read_fields, plotting rectangles and ellipes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/civ.m

    r182 r183  
    17241724        end
    17251725    end
    1726     %test_interp=get(handles.test_interp,'Value');
    1727 
    17281726    if  isfield(sparam,'PatchBin')
    17291727        if ~exist(sparam.PatchBin,'file')
     
    17311729        end
    17321730    end
    1733     % if test_interp && isfield(sparam,'PatchNewBin')
    1734     %     if ~exist(sparam.PatchNewBin,'file')
    1735     %          sparam.PatchNewBin=fullfile(path_UVMAT,sparam.PatchNewBin);
    1736     %     end
    1737     % end
    17381731    if isfield(sparam,'FixBin')
    17391732        if ~exist(sparam.FixBin,'file')
     
    17461739        batch_mode=sparam.BatchMode;
    17471740    end
    1748 else
    1749 %     MaxCivProcesses=50;
    1750 %     if isfield(sparam,'MaxCivProcesses')
    1751 %         MaxCivProcesses=str2double(sparam.MaxCivProcesses);
    1752 %     end
    17531741end
    17541742
     
    17561744%% get civ1 parameters:
    17571745display('files OK, processing...')
    1758 %get civ parameters
    17591746if box_test(1)==1
    17601747    par_civ1=read_param_civ1(handles,filecell.ima1.civ1{1,1});
     
    18631850        cmd='';
    18641851        if isunix % check: necessaire aussi en RUN?
    1865             %fid=fopen([filename '.cmx'],'w')
    18661852            cmd='#!/bin/bash \n';
    18671853            cmd=[cmd '#$ -cwd \n'];
     
    18741860            civAllxml=set(civAllxml,1,'name','CivDoc');
    18751861        end
    1876         %filename_cur=filecell.nc.civ1{ifile,j};%output netcdf file
    18771862        [Rootbat,Filebat]=fileparts(filecell.nc.civ1{ifile,j});%output netcdf file (without extention)
    18781863        flname=fullfile(Rootbat,Filebat);
    1879         %filename_cmx(end-1:end+6)='civ1.cmx';%name of cmx file
    18801864        if batch
    1881 %             [Rootbat,Filebat,extbat]=fileparts(filename_cmx);
    18821865            filename_bat=fullfile(Rootbat,['job_' Filebat]);
    18831866         else
     
    18901873            par_civ1.filename_ima_a=filecell.ima1.civ1{ifile,j};
    18911874            par_civ1.filename_ima_b=filecell.ima2.civ1{ifile,j};
    1892             %namelog=[fullfile(Rootbat,Filebat) '.civ1.log'];
    18931875            par_civ1.Dt=num2str(time(num2_civ1(ifile),num_b_civ1(j))-time(num1_civ1(ifile),num_a_civ1(j)));
    18941876            par_civ1.T0=num2str((time(num2_civ1(ifile),num_b_civ1(j))+time(num1_civ1(ifile),num_a_civ1(j)))/2);
     
    19431925            i_cmd=i_cmd+1;
    19441926            if isequal(civAll,0)
    1945                 cmd=[cmd CIV1_CMD(fullfile(Rootbat,Filebat),'',par_civ1,handles,sparam) '\n'];
     1927                if(isunix)
     1928                     cmd=[cmd 'cp -f ' flname '.civ1.cmx ' flname '.cmx\n'];
     1929                else
     1930                    flname=regexprep(flname,'\\','\\\\');
     1931                    cmd=[cmd 'copy /Y "' flname '.civ1.cmx" "' flname '.cmx"\n'];
     1932                end
     1933                cmd=[cmd CIV1_CMD(fullfile(Rootbat,Filebat),'',par_civ1,handles,sparam) '\n']
    19461934            else
    19471935                civAllCmd=[civAllCmd ' civ1 '];
     
    20542042            filename_cmx=filecell.nc.civ2{ifile,j};%output netcdf file
    20552043            filename_cmx([end-1:end+1])=[ 'cmx'];%name of cmx file
    2056 %             filename_cmx=[filename_cmx 'x'];
    20572044        end
    20582045       
    20592046        if box_test(4)==1
    20602047            par_civ2.filename_ima_a=filecell.ima1.civ2{ifile,j};
    2061             %par_civ2.filename_ima_a([end-3:end])=[];%remove .png extension
    20622048            par_civ2.filename_ima_b=filecell.ima2.civ2{ifile,j};
    2063             %par_civ2.filename_ima_b([end-3:end])=[];%remove .png extension
    20642049            [Rootbat,Filebat]=fileparts(filecell.nc.civ2{ifile,j});%output netcdf file (without extention)
    2065             %namelog=[fullfile(Rootbat,Filebat) '.civ2.log'];
    20662050            par_civ2.Dt=num2str(time(num2_civ2(ifile),num_b_civ2(j))-time(num1_civ2(ifile),num_a_civ2(j)));
    20672051            par_civ2.T0=num2str((time(num2_civ1(ifile),num_b_civ2(j))+time(num1_civ2(ifile),num_a_civ2(j)))/2);
     
    21152099                end
    21162100            end
    2117             %endTESTgrid
    21182101            i_cmd=i_cmd+1;
    21192102            flname=fullfile(Rootbat,Filebat);
     
    22342217        if isequal(civAll,1)
    22352218            save(civAllxml,[filename_cmx([1:end-4]) '.xml']);
    2236             %cmd=char({cmd;[CivBin ' -f ' [filename_cmx([1:end-4]) '.xml'] ' ' civAllCmd]});
    22372219            cmd=[cmd CivBin ' -f ' filename_cmx(1:end-4) '.xml '  civAllCmd  '\n'];
    22382220        end
     
    22452227        fprintf(fid,cmd);
    22462228        fclose(fid);
    2247         %dlmwrite(filename_bat,cmd,'');%write commands in filename_bat
    22482229        if batch
    22492230            switch batch_mode
    22502231                case 'sge'
    22512232                    pvalue=num2str((1-ind_answer)*500);
    2252                     %namelog=[filename_bat '.patch.log'];
    22532233                    display(['!qsub -p ' pvalue ' -q civ.q -e ' flname '.errors -o ' flname '.log' ' ' filename_bat]);
    22542234                    eval(  ['!qsub -p ' pvalue ' -q civ.q -e ' flname '.errors -o ' flname '.log' ' ' filename_bat]);
     
    22582238            if(isunix)
    22592239                cmd_str=['. ' filename_bat];
    2260                 % cmd_str=['!at -qb now -f ' filename_bat ' &']; %ou at -qb now -f bad idea...
    22612240            else %case of Windows
    22622241                cmd_str=['@call "' regexprep(filename_bat,'\\','\\\\') '"'];
Note: See TracChangeset for help on using the changeset viewer.