Changeset 85 for trunk


Ignore:
Timestamp:
Apr 25, 2010, 9:46:07 PM (15 years ago)
Author:
sommeria
Message:

uvmat;fig: cleaning out of buttons for mask record
view_field, write_plot_param: improve plot by view_field (projection)
uvmat: bug fixing for yellow coloring of buttons, improve switch from velocity to images
find_field_indices: bug fix for NbDim?
name_generator: help comments improved
civ: bugs corrected for BATCH button colouring

Location:
trunk/src
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/civ.m

    r84 r85  
    528528    end
    529529    if isfield(XmlData,'Time')
    530         time=XmlData.Time
     530        time=XmlData.Time;
    531531        nbfield=size(time,1);
    532532        nburst=size(time,2);
     
    21492149    else
    21502150         msgbox_uvmat('ERROR','for BATCH option, UBC file names, beginning by \\, are needed');
    2151          set(handles.BATCH, 'Enable','On')
    2152          set(handles.BATCH,'BackgroundColor',[1 0 0])
     2151%          set(handles.BATCH, 'Enable','On')
     2152%          set(handles.BATCH,'BackgroundColor',[1 0 0])
    21532153         return
    21542154    end
     
    21592159[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]=...
    21602160       set_civ_filenames(handles,compare,box_test);
    2161 
     2161if isempty(filecell)
     2162    return
     2163end
    21622164%choice of batch priority
    21632165ind_answer=2;
     
    22092211    nbslice_mask=get(handles.mask_fix1,'UserData'); % get the number of slices (= number of masks)
    22102212    %%%%%%%%%%%%%COMPLETER LE PROGRAMME FIX
    2211 %     inf_sup=get(handles.inf_sup1,'Value');
     2213%     inf_sup=get(handles.inf_sup1,'Value');80
    22122214%     fileref=get(handles.ref_fix1,'String');
    22132215%     refpath=get(handles.ref_fix1,'UserData');
     
    26802682              display(['!' filename_bat ' &'])
    26812683            end
    2682 %             if(isunix)
    2683 %               cmdtodo=['. ' filename_bat ];%removed for Mathieu tests %' && rm -f ' filename_bat] ;
    2684 %             else
    2685 %                cmdtodo=[filename_bat];%removed for Mathieu tests %' && del /F /Q ' filename_bat' ;
    2686 %             end
    2687 %             count= fprintf(p1,'%s\n', cmdtodo);
    26882684        end
    26892685     end
    26902686end
    2691 % if ~sge
    2692 %     fclose(p1);
    2693 %     fclose(p0);
    2694 %     delete(name_lock);
    2695 % end
    2696 
    2697 set(handles.BATCH, 'Enable','On')
    2698 set(handles.BATCH,'BackgroundColor',[1 0 0])
     2687% set(handles.BATCH, 'Enable','On')
     2688% set(handles.BATCH,'BackgroundColor',[1 0 0])
    26992689
    27002690%save interface state
     
    27402730    set_civ_filenames(handles,compare,box_test)
    27412731%------------------------------------------------------------------------
     2732filecell=[];%default
    27422733%get the filename root, nomenclature and numbers
    27432734filebase=get(handles.RootName,'String');
     
    30483039                        set(handles.RUN, 'Enable','On')
    30493040                        set(handles.RUN,'BackgroundColor',[1 0 0])
    3050                         set(handles.BATCH, 'Enable','On')
    3051                     set(handles.BATCH,'BackgroundColor',[1 0 0])
    3052                     filecell=[];
     3041%                         set(handles.BATCH, 'Enable','On')
     3042%                         set(handles.BATCH,'BackgroundColor',[1 0 0])
     3043                        filecell=[];
    30533044                        cd(currentdir)
    30543045                        return
     
    31603151                        set(handles.RUN, 'Enable','On')
    31613152                        set(handles.RUN,'BackgroundColor',[1 0 0])
    3162                                set(handles.BATCH, 'Enable','On')
    3163                     set(handles.BATCH,'BackgroundColor',[1 0 0])
     3153%                                set(handles.BATCH, 'Enable','On')
     3154%                     set(handles.BATCH,'BackgroundColor',[1 0 0])
    31643155                        cd(currentdir)
    31653156                        return
     
    50014992path_to_uvmat=which ('uvmat');% check the path of uvmat
    50024993pathelp=fileparts(path_to_uvmat);
    5003 helpfile=fullfile(pathelp,'uvmat_doc','uvmat_doc.html')
     4994helpfile=fullfile(pathelp,'uvmat_doc','uvmat_doc.html');
    50044995if isempty(dir(helpfile)), msgbox_uvmat('ERROR','Please put the help file uvmat_doc.html in the sub-directory /uvmat_doc of the UVMAT package')
    50054996else
  • trunk/src/find_field_indices.m

    r19 r85  
    1818%      .discrete: like scalar, but set of data points without continuity, represented as dots in a usual plot, instead of continuous lines otherwise
    1919%      .scalar: scalar field (default)
    20 
     20%
    2121%   
    2222%INPUT:
     
    7272    testnewcell=1;
    7373    for icell_prev=1:numel(CellVarIndex)%detect whether the dimensions of ivar fit with an existing cell
    74         PrevVarIndex=CellVarIndex{icell_prev};
    75         PrevDimName=Data.VarDimName{PrevVarIndex(1)};
     74        PrevVarIndex=CellVarIndex{icell_prev};%list of variable indices in cell # icell_prev
     75        PrevDimName=Data.VarDimName{PrevVarIndex(1)};%list of corresponding variable names
    7676        if isequal(PrevDimName,DimCell)
    7777            CellVarIndex{icell_prev}=[CellVarIndex{icell_prev} ivar];% add variable index #ivar to the cell #icell_prev
     
    154154    end
    155155    NbDim(icell)=0;% nbre of space dimensions
    156     if ~isempty(ivar_coord_z)
    157         NbDim(icell)=3;
    158     elseif ~isempty(ivar_coord_y)
    159         NbDim(icell)=2;
    160     elseif ~isempty(ivar_coord_x)
    161         NbDim(icell)=1;
    162     end
    163            
     156    if numel(VarIndex)>1
     157        if ~isempty(ivar_coord_z)
     158            NbDim(icell)=3;
     159        elseif ~isempty(ivar_coord_y)
     160            NbDim(icell)=2;
     161        elseif ~isempty(ivar_coord_x)
     162            NbDim(icell)=1;
     163        end
     164    end
    164165    % look at coordinates variables 
    165166    coord=zeros(1,numel(DimCell));%default
  • trunk/src/name_generator.m

    r65 r85  
    22%---------------------------------------------------------------------
    33% [filename,idetect,num_i1_out,num_j1_out,num_i2_out,num_j2_out,subdir_out]=...
    4             % name_generator(filebase,num_i1,num_j1,ext,nom_type,comp_input,num_i2,num_j2,subdir);
     4%        name_generator(filebase,num_i1,num_j1,ext,nom_type,comp_input,num_i2,num_j2,subdir);
    55%---------------------------------------------------------------------           
    66% This function detects the existence the constructed file name and it can
    77% find indices according to file existence if they are not specified
    8 %%rmq: this function is related to the reverse functions display2name and name2diplay
     8% rmq: this function is related to the reverse functions display2name and name2diplay
    99%---------------------------------------------------------------------
    1010% OUTPUT:
    11 %filename: string representing the file name (including path)
    12 %idetect: =1 if the file is detected, 0 otherwise
    13 %num_i1_out,num_j1_out,num_i2_out,num_j2_out,subdir_out: index numbers and subdirectory detected
    14              %for free input (= to the corresponding input indices when comp_input=1)
     11% filename: string representing the file name (including path)
     12% idetect: =1 if the file is detected, 0 otherwise
     13% num_i1_out,num_j1_out,num_i2_out,num_j2_out,subdir_out: index numbers and subdirectory detected
     14%            for free input (= to the corresponding input indices when comp_input=1)
    1515%---------------------------------------------------------------------
    1616% INPUT:
     
    2020% 'ext': file name extension (e.g. '.png' or '.nc')
    2121% 'nom_type': string defining the kind of nomenclature used:
    22      %nom_type='': constant name [filebase ext] (default output if 'nom_type' is undefined)
    23      %nom_type='*': the same  file [filebase ext] contains successive fields (ex avi movies)
    24      %nom_type='_i': series of files with a single index i preceded by '_'(e.g. 'aa_45.png').
    25      %nom_type='#' series of indexed images wich is not series_i [filebase index ext], e.g. 'aa045.jpg' or 'aa45.tif'
    26      %nom_type='_i_j' matrix of files with two indices i and j separated by '_'(e.g. 'aa_45_2.png')
    27      %nom_type='_i1-i2' from pairs from a single index (e.g. 'aa_45-47.nc')
    28      %nom_type='_i_j1-j2'pairs of j indices (e.g. 'aa_45_2-3.nc')
    29      %nom_type='_i1-i2_j' pairs of i indices (e.g. 'aa_45-46_2.nc')
    30      %nom_type='#a','#A' with a numerical index and an index letter(e.g.'aa045b.png'), OBSOLETE (replaced by 'series_i_j')
    31      %nom_type='%03d' or '%04d', series of indexed images with numbers completed with zeros to 3 or 4 digits, e.g.'aa045.tif'
    32      %nom_type='_%03d', '_%04d', or '_%05d', series of indexed images with _ and numbers completed with zeros to 3, 4 or 5 digits, e.g.'aa_045.tif'
    33      %nom_type='raw_SMD', same as '#a' but with no extension ext='', OBSOLETE
    34      %nom_type='#_ab' from pairs of '#a' images (e.g. 'aa045bc.nc'), ext='.nc', OBSOLETE (replaced by 'netc_2D')
    35      %nom_type='%3dab' from pairs of '%3da' images (e.g. 'aa045bc.nc'), ext='.nc', OBSOLETE (replaced by 'netc_2D')
    36 % A REVOIR: 'comp_input'=1 for writting =0 for reading ,  'comp_input'(for nom_type involving index pairs (e.g. netc))
    37      %comp_input=1: the index pair is imposed,
    38      %comp_input=0: the index pair is automatically searched, choosing the most recent  file in case of multiple choice
     22%       nom_type='': constant name [filebase ext] (default output if 'nom_type' is undefined)
     23%       nom_type='*': the same  file [filebase ext] contains successive fields (ex avi movies)
     24%       nom_type='_i': series of files with a single index i preceded by '_'(e.g. 'aa_45.png').
     25%       nom_type='#' series of indexed images wich is not series_i [filebase index ext], e.g. 'aa045.jpg' or 'aa45.tif'
     26%       nom_type='_i_j' matrix of files with two indices i and j separated by '_'(e.g. 'aa_45_2.png')
     27%       nom_type='_i1-i2' from pairs from a single index (e.g. 'aa_45-47.nc')
     28%       nom_type='_i_j1-j2'pairs of j indices (e.g. 'aa_45_2-3.nc')
     29%       nom_type='_i1-i2_j' pairs of i indices (e.g. 'aa_45-46_2.nc')
     30%       nom_type='#a','#A' with a numerical index and an index letter(e.g.'aa045b.png'), OBSOLETE (replaced by 'series_i_j')
     31%       nom_type='%03d' or '%04d', series of indexed images with numbers completed with zeros to 3 or 4 digits, e.g.'aa045.tif'
     32%       nom_type='_%03d', '_%04d', or '_%05d', series of indexed images with _ and numbers completed with zeros to 3, 4 or 5 digits, e.g.'aa_045.tif'
     33%       nom_type='raw_SMD', same as '#a' but with no extension ext='', OBSOLETE
     34%       nom_type='#_ab' from pairs of '#a' images (e.g. 'aa045bc.nc'), ext='.nc', OBSOLETE (replaced by 'netc_2D')
     35%       nom_type='%3dab' from pairs of '%3da' images (e.g. 'aa045bc.nc'), ext='.nc', OBSOLETE (replaced by 'netc_2D')
     36%'comp_input' (for nom_type involving index pairs (e.g. netc))
     37%       comp_input=1: the index pair is imposed,
     38%       comp_input=0: the index pair is automatically searched, choosing the most recent  file in case of multiple choice
    3939% 'num_i2': second index i (for nom_type involving index pairs (e.g. netc))
    4040% 'num_j2': second index j (for nom_type involving index pairs (e.g. netc))
    4141% 'subdir': (used for nom_type=netc...) string representing the name of the subdirectory 'subdir' containing file.
    42      %subdir='': no subdirectory,
    43      %subdir='?', the file is first searched with no subdirectory, then in the most recently modified subdirectory if not detected.
     42%       subdir='': no subdirectory,
     43%       subdir='?', the file is first searched with no subdirectory, then in the most recently modified subdirectory if not detected.
    4444
    4545% A FAIRE: si comp_inpu=0, si _i_j n'existe pas, chercher _i,
  • trunk/src/plot_field.m

    r82 r85  
    195195    ind_select=find(NbDim>=2);
    196196    if numel(ind_select)>2
    197         msgbox_uvmat('ERROR',['more than two fields to map'])
    198         display(['more than two fields to map'])
     197        msgbox_uvmat('ERROR','more than two fields to map')
     198        display('more than two fields to map')
    199199        return
    200200    end
  • trunk/src/uvmat.m

    r84 r85  
    16221622% III - MAIN REFRESH FUNCTIONS : 'FRAME PLOT'
    16231623%-------------------------------------------------------------------
    1624 %-------------------------------------------------------------------
    1625 
    1626 %Executes on button press in runplus: make one step forward and call
    1627 %run0. The step forward is along the fields series 1 or 2 depending on
    1628 %the scan_i and scan_j check box (exclusive each other)
    1629 %-------------------------------------------------------------------
     1624
     1625%-------------------------------------------------------------------
     1626% --- Executes on button press in runplus: make one step forward and call
     1627% --- run0. The step forward is along the fields series 1 or 2 depending on
     1628% --- the scan_i and scan_j check box (exclusive each other)
    16301629function runplus_Callback(hObject, eventdata, handles)
     1630%-------------------------------------------------------------------
     1631set(handles.runplus,'BackgroundColor',[1 1 0])%paint the command button in yellow
     1632drawnow
    16311633increment=str2num(get(handles.increment_scan,'String')); %get the field increment d
    16321634runpm(hObject,eventdata,handles,increment)
    1633 
    1634 %-------------------------------------------------------------------
    1635 %Executes on button press in runmin: make one step backward and call
    1636 %run0. The step backward is along the fields series 1 or 2 depending on
    1637 %the scan_i and scan_j check box (exclusive each other)
    1638 %-------------------------------------------------------------------
     1635set(handles.runplus,'BackgroundColor',[1 0 0])%paint the command button in yellow
     1636
     1637%-------------------------------------------------------------------
     1638% --- Executes on button press in runmin: make one step backward and call
     1639% --- run0. The step backward is along the fields series 1 or 2 depending on
     1640% --- the scan_i and scan_j check box (exclusive each other)
    16391641function runmin_Callback(hObject, eventdata, handles)
     1642%-------------------------------------------------------------------
     1643set(handles.runmin,'BackgroundColor',[1 1 0])%paint the command button in yellow
     1644drawnow
    16401645increment=-str2num(get(handles.increment_scan,'String')); %get the field increment d
    16411646runpm(hObject,eventdata,handles,increment)
     1647set(handles.runmin,'BackgroundColor',[1 0 0])%paint the command button in yellow
    16421648
    16431649%-------------------------------------------------------------------
     
    17031709set(handles.MovieBackward,'BusyAction','Cancel')
    17041710set(handles.MenuExportMovie,'BusyAction','Cancel')
    1705 
     1711set(handles.movie_pair,'BackgroundColor',[1 0 0])%paint the command buttonback to red
     1712set(handles.Movie,'BackgroundColor',[1 0 0])%paint the command buttonback to red
     1713set(handles.MovieBackward,'BackgroundColor',[1 0 0])%paint the command buttonback to red
    17061714
    17071715%------------------------------------------------------------------
     
    18361844    else
    18371845        msgbox_uvmat('ERROR','an image or movie must be first introduced as input')
     1846        set(handles.movie_pair,'BackgroundColor',[1 0 0])%paint the command button in red
    18381847        return
    18391848    end
     
    18471856    if isempty(num_i2)   
    18481857        msgbox_uvmat('ERROR', 'a second image index i2 or j2 is needed to show the pair as a movie')
     1858        set(handles.movie_pair,'BackgroundColor',[1 0 0])%paint the command button in red
    18491859        return
    18501860    else
     
    18581868if ~exist(imaname_1,'file')
    18591869      msgbox_uvmat('ERROR',['second input open (-)  ' imaname_1 ' not found']);
     1870      set(handles.movie_pair,'BackgroundColor',[1 0 0])%paint the command button in red
    18601871      return
    18611872end
    1862 % set(handles.i2,'String',''); % indicates that the second index i2 is not used
    1863 % set(handles.j2,'String',''); % indicates that the second index i2 is not used
    18641873
    18651874%read the second image
     
    19491958function run0_Callback(hObject, eventdata, handles)
    19501959%------------------------------------------------------------------------
     1960set(handles.run0,'BackgroundColor',[1 1 0])%paint the command button in yellow
     1961drawnow
    19511962filename=read_file_boxes(handles);
    19521963
     
    19631974      msgbox_uvmat('ERROR',errormsg);
    19641975end   
    1965 
     1976set(handles.run0,'BackgroundColor',[1 0 0])
    19661977%------------------------------------------------------------------------
    19671978% --- read the input files and refresh all the plots, including projection.
     
    19781989
    19791990%initialisation
    1980 set(handles.run0,'BackgroundColor',[1 1 0])%paint the command button in yellow
    1981 drawnow
     1991
    19821992errormsg=[]; % default error message
    19831993abstime=[];
     
    28152825    end
    28162826end
    2817 set(handles.run0,'BackgroundColor',[1 0 0])
     2827
    28182828
    28192829
     
    30513061FileName=[FileName FileIndices FileExt];
    30523062
    3053 %----------------------------------------------
    3054 %read the data displayed for the second input rootfile windows
    3055 %-------------------------------------------------
     3063%------------------------------------------------------------------------
     3064% ---- read the data displayed for the second input rootfile windows
    30563065function [FileName_1,RootPath_1,FileBase_1,FileIndices_1,FileExt_1,SubDir_1]=read_file_boxes_1(handles)
    3057 RootPath_1=get(handles.RootPath_1,'String'); % read the data from the file1_input window
    3058 if isequal(RootPath_1,'"'),RootPath_1=get(handles.RootPath,'String'); end;
     3066%------------------------------------------------------------------------
     3067RootPath_1=get(handles.RootPath_1,'String') % read the data from the file1_input window
     3068if isequal(get(handles.RootPath_1,'Visible'),'off') || isequal(RootPath_1,'"')
     3069    RootPath_1=get(handles.RootPath,'String');
     3070end;
    30593071FileName_1=RootPath_1; %default
    30603072SubDir_1=get(handles.SubDir_1,'String');
    3061 if isequal(SubDir_1,'"')
     3073if isequal(get(handles.SubDir_1,'Visible'),'off')|| isequal(SubDir_1,'"')
    30623074    SubDir_1=get(handles.SubDir,'String');
    30633075end
    3064 if ~isempty(SubDir_1) && ~isequal(SubDir_1,'')
     3076if numel(SubDir_1)>=1
    30653077    if (isequal(SubDir_1(1),'/')|| isequal(SubDir_1(1),'\'))
    30663078        SubDir_1(1)=[]; %suppress possible / or \ separator
     
    30693081end
    30703082RootFile_1=get(handles.RootFile_1,'String');
    3071 if isequal(RootFile_1,'"'),RootFile_1=get(handles.RootFile,'String'); end;
    3072 if ~isempty(RootFile_1) && ~isequal(RootFile_1,'')
     3083if isequal(get(handles.RootFile_1,'Visible'),'off') || isequal(RootFile_1,'"')
     3084    RootFile_1=get(handles.RootFile,'String');
     3085end
     3086if numel(RootFile_1)>=1
    30733087    if ~(isequal(RootFile_1(1),'/')|isequal(RootFile_1(1),'\'))
    30743088        RootFile_1(1)=[];%suppress possible / or \ separator
     
    30773091end
    30783092FileBase_1=fullfile(RootPath_1,RootFile_1);
    3079 FileIndices_1=get(handles.FileIndex_1,'String');
     3093if isequal(get(handles.FileIndex_1,'Visible'),'off')
     3094    FileIndices_1=get(handles.FileIndex,'String');
     3095else
     3096    FileIndices_1=get(handles.FileIndex_1,'String');
     3097end
    30803098FileExt_1=get(handles.FileExt_1,'String');
    30813099if isequal(FileExt_1,'"'),FileExt_1=get(handles.FileExt,'String'); end;
    30823100FileName_1=[FileName_1 FileIndices_1 FileExt_1];
    30833101
    3084 %---------------------------------------------------
     3102%------------------------------------------------------------------------
    30853103% --- Executes on menu selection Fields
    30863104function Fields_Callback(hObject, eventdata, handles)
    3087 %-------------------------------------------------
    3088 
     3105%------------------------------------------------------------------------
    30893106list_fields=get(handles.Fields,'String');% list menu fields
    30903107index_fields=get(handles.Fields,'Value');% selected string index
     
    31123129if isequal(field,'image')
    31133130    % transform netc type to the corresponding image type
    3114     if isequal(NomType,'_i1-i2_j')||isequal(NomType,'_i_j1-j2')|| isequal(NomType,'#_ab')|| isequal(NomType,'_i1-i2')
    3115         UvData.SubDir=get(handles.SubDir,'String'); %preserve the subdir in memory
    3116         if ~isempty(UvData.SubDir) && (isequal(UvData.SubDir(1),'/')||isequal(UvData.SubDir(1),'/'))
    3117             UvData.SubDir(1)=[];
    3118         end
    3119         set(handles.SubDir,'String','')
    3120         set(handles.FileExt,'String','.png');
     3131%     if isequal(NomType,'_i1-i2_j')||isequal(NomType,'_i_j1-j2')|| isequal(NomType,'#_ab')|| isequal(NomType,'_i1-i2')
     3132%         UvData.SubDir=get(handles.SubDir,'String'); %preserve the subdir in memory
     3133%         if ~isempty(UvData.SubDir) && (isequal(UvData.SubDir(1),'/')||isequal(UvData.SubDir(1),'/'))
     3134%             UvData.SubDir(1)=[];
     3135%         end
     3136%         set(handles.SubDir,'String','')
     3137%         set(handles.FileExt,'String','.png');
    31213138        if isequal(NomType,'_i1-i2_j')||isequal(NomType,'_i_j1-j2')
    31223139            NomTypeNew='_i_j';
     
    31253142        elseif isequal(NomType,'_i1-i2')
    31263143            NomTypeNew='_i';
    3127             % TODO: look for other types
    31283144        end 
    3129     end
    3130     veltype_handles=[handles.civ1 handles.interp1 handles.filter1 handles.civ2 handles.interp2 handles.filter2];
    3131     set_veltype_display(veltype_handles,0) % unvisible civ buttons
     3145        imagename=name_generator(FileBase,str2double(str1),str2double(str_a),'.png',NomTypeNew,1,str2double(str2),str2double(str_b),'')
     3146        if ~exist(imagename,'file')
     3147                [FileName,PathName] = uigetfile( ...
     3148           {'*.png;*.jpg;*.tif;*.avi;*.AVI;*.vol', ' (*.png, .tif, *.avi,*.vol)';
     3149            '*.jpg',' jpeg image files'; ...
     3150            '*.png','.png image files'; ...
     3151            '*.tif','.tif image files'; ...
     3152            '*.avi;*.AVI','.avi movie files'; ...
     3153            '*.vol','.volume images (png)'; ...
     3154            '*.*',  'All Files (*.*)'}, ...
     3155            'Pick an image',imagename)           
     3156            % display the selected field and related information
     3157           imagename=[PathName FileName];
     3158        end
     3159        display_file_name(hObject, eventdata, handles,imagename)%display the image
     3160        return
     3161%     end
     3162%     veltype_handles=[handles.civ1 handles.interp1 handles.filter1 handles.civ2 handles.interp2 handles.filter2];
     3163%     set_veltype_display(veltype_handles,0) % unvisible civ buttons
    31323164else
    31333165    ext=get(handles.FileExt,'String');
    31343166    if ~isequal(ext,'.nc') %find the new NomType if the previous display was not already a netcdf file
    3135          MenuBrowse_Callback(hObject, eventdata, handles)
     3167                [FileName,PathName] = uigetfile( ...
     3168           {'*.nc', ' (*.nc)';
     3169            '*.nc',' netcdf files'; ...
     3170            '*.*',  'All Files (*.*)'}, ...
     3171            'Pick a netcdf file',FileBase)           
     3172            % display the selected field and related information
     3173           filename=[PathName FileName];
     3174        display_file_name(hObject, eventdata, handles,filename)
     3175        return
     3176       %  MenuBrowse_Callback(hObject, eventdata, handles)
    31363177    end
    31373178    if isequal(field,'vort') || isequal(field,'div') || isequal(field,'strain')
     
    31633204    set(handles.npx,'Visible','on')
    31643205    set(handles.npy,'Visible','on')
    3165 %     set(handles.fix_pair,'Value',0)
    31663206else
    31673207    set(handles.npx_title,'Visible','off')% visible npx,pxcm... buttons
     
    31693209    set(handles.npx,'Visible','off')
    31703210    set(handles.npy,'Visible','off')
    3171 %     set(handles.fix_pair,'Value',1)
    31723211end
    31733212setfield(handles);% update the field structure ('civ1'....)
     
    31953234
    31963235%read the rootfile input display
    3197 FileExt_prev=get(handles.FileExt_1,'String');
     3236[FileName,RootPath,FileBase,FileIndices,FileExt_prev]=read_file_boxes_1(handles);
     3237[P,F,str1,str2,str_a,str_b,E,NomType]=name2display(['xxx' get(handles.FileIndex,'String') FileExt_prev]);
    31983238if isempty(FileExt_prev)|isequal(FileExt_prev,'')
    31993239    FileExt_1=get(handles.FileExt,'String');
     
    32393279if isequal(field_1,'image')
    32403280    % transform netc type to the corresponding image type
    3241     set(handles.FileExt_1,'String','.png');
     3281%     set(handles.FileExt_1,'String','.png');
    32423282    if isequal(NomType_1,'_i1-i2_j')|isequal(NomType_1,'_i_j1-j2')| isequal(NomType_1,'#_ab')| isequal(NomType_1,'_i1-i2')
    32433283        UvData.SubDir_1=get(handles.SubDir_1,'String'); %preserve the subdir in memory
    3244         set(handles.SubDir_1,'String','')
     3284%         set(handles.SubDir_1,'String','')
    32453285%         set(handles.FileExt_1,'String','.png');       
    32463286        if isequal(NomType_1,'_i1-i2_j')|isequal(NomType_1,'_i_j1-j2')
     
    32523292        end 
    32533293    end
    3254     veltype_handles=[handles.civ1_1 handles.interp1_1 handles.filter1_1 handles.civ2_1 handles.interp2_1 handles.filter2_1];
    3255     set_veltype_display(veltype_handles,0) % unvisible civ buttons
     3294    imagename=name_generator(FileBase,str2double(str1),str2double(str_a),'.png',NomTypeNew,1,str2double(str2),str2double(str_b),'');
     3295    if ~exist(imagename,'file')
     3296        [FileName,PathName] = uigetfile( ...
     3297            {'*.png;*.jpg;*.tif;*.avi;*.AVI;*.vol', ' (*.png, .tif, *.avi,*.vol)';
     3298            '*.jpg',' jpeg image files'; ...
     3299            '*.png','.png image files'; ...
     3300            '*.tif','.tif image files'; ...
     3301            '*.avi;*.AVI','.avi movie files'; ...
     3302            '*.vol','.volume images (png)'; ...
     3303            '*.*',  'All Files (*.*)'}, ...
     3304            'Pick an image',imagename)
     3305        % display the selected field and related information
     3306        imagename=[PathName FileName];
     3307    end
     3308    display_file_name_1(hObject, eventdata, handles,imagename)%display the image
     3309    return
     3310%     veltype_handles=[handles.civ1_1 handles.interp1_1 handles.filter1_1 handles.civ2_1 handles.interp2_1 handles.filter2_1];
     3311%     set_veltype_display(veltype_handles,0) % unvisible civ buttons
    32563312else
    32573313    set(handles.SubDir_1,'Visible','on')
     
    47174773edit_vect_Callback(hObject, eventdata, handles)
    47184774set(handles.edit,'BackgroundColor',[0.7 0.7 0.7])
    4719 set(handles.edit_vect,'Value',0) 
    4720 edit_vect_Callback(hObject, eventdata, handles)
    4721 set(handles.edit,'BackgroundColor',[0.7 0.7 0.7])
    47224775set(handles.list_object_1,'Value',1)     
    47234776
  • trunk/src/view_field.m

    r75 r85  
    9292
    9393[PlotType,PlotParamOut,haxes]= plot_field(Field,handles.axes3)%,PlotParam,KeepLim,PosColorbar)
     94'TEST'
     95if isfield(PlotParamOut,'Vectors')
     96    set(handles.VECT_title,'Visible','on')
     97end
     98handles
     99write_plot_param(handles,PlotParamOut);% update the display of the plotting parameters
     100
    94101%-------------------------------------------------------------------
    95102% --- Outputs from this function are returned to the command menuline.
     
    20292036       set(handles.slider2,'Min',0);
    20302037       set(handles.slider2,'Max',1);
    2031  %      set(handles.min_title_vec,'String','0')
     2038 %      set(handles.min_C_title_vec,'String','0')
    20322039       set(handles.max_vec,'String','1')
    20332040       set(handles.colcode1,'String','0.333')
     
    21072114% set(handles.slider2,'Min',minC)
    21082115% set(handles.slider2,'Max',maxC)
    2109 % set(handles.min_title_vec,'String',num2str(minC))
     2116% set(handles.min_C_title_vec,'String',num2str(minC))
    21102117% set(handles.max_vec,'String',num2str(maxC))
    21112118% if auto
     
    23322339%-------------------------------------------------------------------
    23332340haxes= handles.axes3;
    2334 AxeData=get(haxes,'UserData');
     2341huvmat=findobj(allchild(0),'tag','uvmat');
     2342UvData=get(huvmat,'UserData');
     2343%
     2344% AxeData=get(haxes,'UserData');
    23352345PlotParam=read_plot_param(handles);
    2336 [PlotType,PlotParamOut]= plot_field(AxeData,haxes,PlotParam,1);
     2346[PlotType,PlotParamOut]= plot_field(UvData.ProjField_2,haxes,PlotParam,1);
    23372347write_plot_param(handles,PlotParamOut); %update the auto plot parameters
    23382348
  • trunk/src/write_plot_param.m

    r72 r85  
    5656else
    5757    set_vect_display(handles,'off')
    58     set(handles.edit_vect,'Visible','off')
     58    if isfield(handles,'edit_vect')
     59        set(handles.edit_vect,'Visible','off')
     60        set(handles.record,'Visible','off')
     61    end
    5962end
    6063
     
    9093set(handles.HideFalse,'Visible',state)
    9194set(handles.HideWarning,'Visible',state)
    92 if isfield(handles,'record')
    93     set(handles.record,'Visible',state)
    94 end
     95% if isfield(handles,'record')
     96%     set(handles.record,'Visible',state)
     97% end
    9598set(handles.colcode1,'Visible',state)
    9699set(handles.colcode2,'Visible',state)
     
    104107set(handles.color_code,'Visible',state)
    105108set(handles.vec_col_bar,'Visible',state)
    106 set(handles.record,'Visible',state)
     109% set(handles.record,'Visible',state)
    107110set(handles.AutoVecColor,'Visible',state)
    108111set(handles.decimate4,'Visible',state)
    109112set(handles.min_C_title,'Visible',state)
    110113set(handles.max_C_title,'Visible',state)
    111 set(handles.MenuEditVectors,'Enable',state)
     114if isfield(handles,'MenuEditVectors')
     115    set(handles.MenuEditVectors,'Enable',state)
     116end
Note: See TracChangeset for help on using the changeset viewer.