Changeset 220


Ignore:
Timestamp:
Mar 11, 2011, 12:03:39 PM (14 years ago)
Author:
sommeria
Message:

correction in civ to reactivate civall. Cleaning of figures civ.fig and view_field

Location:
trunk/src
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/civ.m

    r219 r220  
    2222function varargout = civ(varargin)
    2323
    24 % Last Modified by GUIDE v2.5 05-Jan-2011 16:19:30
     24% Last Modified by GUIDE v2.5 11-Mar-2011 08:21:21
    2525% Begin initialization code - DO NOT EDIT
    2626gui_Singleton = 1;
     
    225225set(handles.ref_j_civ2,'String',num2str(num_ref_j));
    226226set(handles.browse_root,'UserData',browse);
    227 if exist('param','var')%varargin the interface is opened from uvmat
     227if exist('param','var') && isfield(param,'RootName') && ~isempty(param.RootName)%varargin the interface is opened from uvmat
    228228    RootName_Callback(hObject, eventdata, handles);
    229229end
     
    17111711    if isfield(sparam,'CivBin')
    17121712        if ~exist(sparam.CivBin,'file')
     1713            CivBin=sparam.CivBin;
    17131714            sparam.CivBin=fullfile(path_UVMAT,sparam.CivBin);
     1715            if ~exist(sparam.CivBin,'file')
     1716                 msgbox_uvmat('ERROR',['CIVx binary ' CivBin ' defined in PARAM.xm does not exist'])
     1717                 return
     1718            end
    17141719        end
    17151720    end
    17161721    if isfield(sparam,'Civ1Bin')
    17171722        if ~exist(sparam.Civ1Bin,'file')
     1723            CivBin=sparam.Civ1Bin;
    17181724            sparam.Civ1Bin=fullfile(path_UVMAT,sparam.Civ1Bin);
     1725            if ~exist(sparam.CivBin,'file')
     1726                 msgbox_uvmat('ERROR',['civ1 binary ' CivBin ' defined in PARAM.xm does not exist'])
     1727                 return
     1728            end
    17191729        end
    17201730    end
    17211731    if isfield(sparam,'Civ2Bin')
     1732        CivBin=sparam.Civ2Bin;
    17221733        if ~exist(sparam.Civ2Bin,'file')
    17231734            sparam.Civ2Bin=fullfile(path_UVMAT,sparam.Civ2Bin);
     1735            if ~exist(sparam.Civ2Bin,'file')
     1736                 msgbox_uvmat('ERROR',['civ2 binary ' CivBin ' defined in PARAM.xm does not exist'])
     1737                 return
     1738            end
    17241739        end
    17251740    end
     
    18421857%% MAIN LOOP
    18431858time=get(handles.RootName,'UserData'); %get the set of times
    1844 civAll=get(handles.Experimental,'Value'); % Boolean for new civ excution method
     1859civAll=get(handles.CivAll,'Value'); % Boolean for new civ excution method
    18451860super_cmd=[];
    18461861
     
    18531868            cmd=[cmd '#$ -cwd \n'];
    18541869            cmd=[cmd 'hostname && date \n'];
    1855             cmd=[cmd 'umask 002 \n'];%allow writting access for user group for created files
     1870            cmd=[cmd 'umask 002 \n'];%allow writting access to created files for user group
    18561871        end
    18571872        if civAll
     
    21112126            else
    21122127                civAllCmd=[civAllCmd ' civ2 '];
    2113                 str=CIV2_CMD_Unified(filename_cmx([1:end-4]),namelog,par_civ2);
     2128                str=CIV2_CMD_Unified(flname,'',par_civ2);
    21142129                fieldnames=fields(str);
    21152130                [civAllxml,uid_civ2]=add(civAllxml,1,'element','civ2');
     
    21752190            else
    21762191                patch2.inputFileName=filecell.nc.civ1{ifile,j} ;
    2177                 patch2.nopt=subdomain_patch1;
    2178                 patch2.maxdiff=thresh_patch1;
    2179                 patch2.ro=rho_patch1;
     2192                patch2.nopt=subdomain_patch2;
     2193                patch2.maxdiff=thresh_patch2;
     2194                patch2.ro=rho_patch2;
    21802195                test_grid=get(handles.get_gridpatch2,'Value');
    21812196                if test_grid
     
    22162231        end
    22172232        if isequal(civAll,1)
    2218             save(civAllxml,[filename_cmx([1:end-4]) '.xml']);
    2219             cmd=[cmd CivBin ' -f ' filename_cmx(1:end-4) '.xml '  civAllCmd  '\n'];
     2233            save(civAllxml,[flname '.xml']);
     2234            'TEST'
     2235            cmd=[cmd sparam.CivBin ' -f ' flname '.xml '  civAllCmd ' >' flname '.log' '\n']
     2236            'fincmd'
    22202237        end
    22212238        % create the .bat file:
     
    41244141    civ1.mask=par.maskname;
    41254142end
    4126 civ1.dt=par.Dt;
     4143civ1.dt=1%par.Dt;
    41274144civ1.unit='pixel';
    41284145civ1.absolut_time_T0=par.T0;
     
    47334750%-------------------------------------------------------------------
    47344751     delete(gcbf)
     4752
     4753
     4754% --- Executes on button press in CivAll.
     4755function CivAll_Callback(hObject, eventdata, handles)
     4756% hObject    handle to CivAll (see GCBO)
     4757% eventdata  reserved - to be defined in a future version of MATLAB
     4758% handles    structure with handles and user data (see GUIDATA)
     4759
     4760% Hint: get(hObject,'Value') returns toggle state of CivAll
     4761
     4762
  • trunk/src/view_field.m

    r198 r220  
    492492set_vec_col_bar(handles)
    493493
    494 % %--------------------------------------------
    495 % %update the display of color code for vectors
    496 % %--------------------------------------------
    497 % function set_vec_col_bar(handles)
    498 % %get the image of the color display button 'vec_col_bar' in pixels
    499 % uni=get(handles.vec_col_bar,'Unit');
    500 % set(handles.vec_col_bar,'Unit','pixel')
    501 % pos_vert=get(handles.vec_col_bar,'Position');
    502 % set(handles.vec_col_bar,'Unit','Normalized')
    503 % width=ceil(pos_vert(3));
    504 % height=ceil(pos_vert(4));
    505 % %get slider indications
    506 % colcode.min=get(handles.slider1,'Min');
    507 % colcode.max=get(handles.slider1,'Max');
    508 % colcode.colcode1=get(handles.slider1,'Value');
    509 % colcode.colcode2=get(handles.slider2,'Value');
    510 % colcode.option=get(handles.vec_col_bar,'Value');
    511 % colcode.auto=1;
    512 % list_code=get(handles.col_vec,'String');% list menu fields
    513 % index_code=get(handles.col_vec,'Value');% selected string index
    514 % colcode.CName= list_code{index_code(1)}; % selected field used for vector color
    515 % vec_C=colcode.min+(colcode.max-colcode.min)*[0.5:width-0.5]/width;%sample of vec_C values from min to max
    516 % [colorlist,col_vec]=set_col_vec(colcode,vec_C);
    517 % oneheight=ones(1,height);
    518 % A1=colorlist(col_vec,1)*oneheight;
    519 % A2=colorlist(col_vec,2)*oneheight;
    520 % A3=colorlist(col_vec,3)*oneheight;
    521 % A(:,:,1)=A1';
    522 % A(:,:,2)=A2';
    523 % A(:,:,3)=A3';
    524 % set(handles.vec_col_bar,'Cdata',A)
    525 
    526 
    527494%------------------------------------------------
    528495%CALLBACKS FOR PLOTTING PARAMETERS
     
    707674    colcode.colcode2=str2num(get(handles.colcode2,'String'));
    708675end
    709 % colcode.option=get(handles.vec_col_bar,'Value');
    710676colcode.FixedCbounds=0;
    711 % list_code=get(handles.col_vec,'String');% list menu fields
    712 % index_code=get(handles.col_vec,'Value');% selected string index
    713 % colcode.CName= list_code{index_code(1)}; % selected field used for vector color
    714677colcode.FixedCbounds=1;
    715678vec_C=colcode.MinC+(colcode.MaxC-colcode.MinC)*[0.5:width-0.5]/width;%sample of vec_C values from min to max
     
    724687set(handles.vec_col_bar,'Cdata',A)
    725688
    726 %-------------------------------------------------------------------
     689%------------------------------------------------------------------------
    727690function PlotType=update_plot(handles)
    728 %-------------------------------------------------------------------
     691%------------------------------------------------------------------------
    729692haxes= handles.axes3;
    730693
     
    737700write_plot_param(handles,PlotParamOut); %update the auto plot parameters
    738701
    739 %------------------------------------------------------
     702%------------------------------------------------------------------------
    740703% --- Executes on button press in Menu/Export/field in workspace.
    741 %------------------------------------------------------
    742704function MenuExportField_Callback(hObject, eventdata, handles)
    743 
     705%------------------------------------------------------------------------
    744706global Data_view_field
    745707% huvmat=findobj(allchild(0),'Name','uvmat');
     
    752714commandwindow;
    753715
    754 %------------------------------------------------------
     716%------------------------------------------------------------------------
    755717% --- Executes on button press in Menu/Export/extract figure.
    756 %------------------------------------------------------
    757718function MenuExport_plot_Callback(hObject, eventdata, handles)
     719%------------------------------------------------------------------------
    758720huvmat=get(handles.MenuExport_plot,'parent');
    759721UvData=get(huvmat,'UserData');
     
    764726colorbar
    765727
    766 
    767 
    768 function npx_Callback(hObject, eventdata, handles)
    769 
    770 function text_display_CreateFcn(hObject, eventdata, handles)%to suppress
    771 function MinX_CreateFcn(hObject, eventdata, handles)%to suppress
    772 function MaxX_CreateFcn(hObject, eventdata, handles)%to suppress
    773 function MinY_CreateFcn(hObject, eventdata, handles)%to suppress
    774 function MaxY_CreateFcn(hObject, eventdata, handles)%to suppress
    775 function npy_Callback(hObject, eventdata, handles)
    776 
    777 
    778 function edit86_Callback(hObject, eventdata, handles)
    779 
    780 
    781 function edit87_Callback(hObject, eventdata, handles)
    782 
    783 
    784 % --- Executes on button press in auto_sclar.
    785 function auto_sclar_Callback(hObject, eventdata, handles)
    786 % hObject    handle to auto_sclar (see GCBO)
    787 % eventdata  reserved - to be defined in a future version of MATLAB
    788 % handles    structure with handles and user data (see GUIDATA)
    789 
    790 % Hint: get(hObject,'Value') returns toggle state of auto_sclar
    791 
    792 
    793 
    794 % --- Executes on slider movement.
    795 function slider9_Callback(hObject, eventdata, handles)
    796 
    797 
    798 
    799 % --- Executes on slider movement.
    800 function slider10_Callback(hObject, eventdata, handles)
    801 
    802 
    803 
     728%------------------------------------------------------------------------
    804729function closefcn(hObject, eventdata, handles)
     730%------------------------------------------------------------------------
    805731huvmat=findobj(allchild(0),'Name','uvmat');
    806732if ~isempty(huvmat)
     
    812738
    813739
    814 % --- Executes on selection change in popupmenu18.
    815 function popupmenu18_Callback(hObject, eventdata, handles)
    816 
    817 
    818 
    819 
     740
     741
     742
Note: See TracChangeset for help on using the changeset viewer.