Changeset 569 for trunk/src/uvmat.m


Ignore:
Timestamp:
Feb 19, 2013, 7:19:07 PM (11 years ago)
Author:
sommeria
Message:

many corrections; introduction of browse_data to scan the whole set of data, used also to replicate data in calibration mode

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/uvmat.m

    r567 r569  
    334334function MenuBrowse_Callback(hObject, eventdata, handles)
    335335[RootPath,SubDir,RootFile,FileIndices,FileExt]=read_file_boxes(handles);
    336 %oldfile=[fullfile(RootPath,SubDir,RootFile) FileIndices FileExt];
    337336oldfile=fullfile(RootPath,SubDir);
    338337if isempty(oldfile)||isequal(oldfile,'') %loads the previously stored file name and set it as default in the file_input box
     
    352351%% display the selected field and related information
    353352display_file_name( handles,fileinput)
     353
     354% -----------------------------------------------------------------------
     355% --- Executes on the menu Open/Browse campaign...
     356% search the file inside a campaign, using the GUI view_data
     357function MenuBrowseCampaign_Callback(hObject, eventdata, handles)
     358% -----------------------------------------------------------------------
     359CampaignPath=fileparts(fileparts(get(handles.RootPath,'String')));
     360DirFull = uigetdir(CampaignPath,'Select a Campaign dir, then press OK');
     361if ~ischar(DirFull)|| ~exist(DirFull,'dir')
     362    return
     363end
     364OutPut=browse_data(DirFull);% open the GUI browse_data to get select a campaign dir, experiment and device
     365if ~isfield(OutPut,'Campaign')
     366    return
     367end
     368DirName=fullfile(OutPut.Campaign,OutPut.Experiment{1},OutPut.Device{1});
     369hdir=dir(DirName); %list files and dirs
     370for ilist=1:numel(hdir)
     371    if ~isequal(hdir(ilist).isdir,1)%look for files, not dir
     372        FileName=hdir(ilist).name;
     373        FileType=get_file_type(fullfile(DirName,FileName));
     374        switch FileType
     375            case {'image','multimage','civx','civdata','netcdf'}
     376            break
     377        end
     378    end
     379end
     380
     381%% display the selected field and related information
     382display_file_name( handles,fullfile(DirName,FileName))
    354383
    355384% -----------------------------------------------------------------------
     
    432461    end
    433462end
     463
     464% --------------------------------------------------------------------
     465function MenuBrowseCampaign_1_Callback(hObject, eventdata, handles)
     466% -----------------------------------------------------------------------
     467CampaignPath=fileparts(fileparts(get(handles.RootPath,'String')));
     468DirFull = uigetdir(CampaignPath,'Select a Campaign dir, then press OK');
     469if ~ischar(DirFull)|| ~exist(DirFull,'dir')
     470    return
     471end
     472OutPut=browse_data(DirFull);% open the GUI browse_data to get select a campaign dir, experiment and device
     473if ~isfield(OutPut,'Campaign')
     474    return
     475end
     476DirName=fullfile(OutPut.Campaign,OutPut.Experiment{1},OutPut.Device{1});
     477hdir=dir(DirName); %list files and dirs
     478for ilist=1:numel(hdir)
     479    if ~isequal(hdir(ilist).isdir,1)%look for files, not dir
     480        FileName=hdir(ilist).name;
     481        FileType=get_file_type(fullfile(DirName,FileName));
     482        switch FileType
     483            case {'image','multimage','civx','civdata','netcdf'}
     484            break
     485        end
     486    end
     487end
     488
     489%% display the selected field and related information
     490set(handles.SubField,'Value',1)
     491display_file_name( handles,fullfile(DirName,FileName),2)
    434492
    435493% -----------------------------------------------------------------------
     
    26232681            ObjectData.A=flag_mask.*double(ObjectData.A);
    26242682            ObjectData.A=feval(AClass,ObjectData.A);
    2625 %             ind_off=[];
    2626 %             if isfield(ObjectData,'ListVarName')
    2627 %                 for ilist=1:length(ObjectData.ListVarName)
    2628 %                     if isequal(ObjectData.ListVarName{ilist},'Mask')||isequal(ObjectData.ListVarName{ilist},'MaskX')||isequal(ObjectData.ListVarName{ilist},'MaskY')
    2629 %                         ind_off=[ind_off ilist];
    2630 %                     end
    2631 %                 end
    2632 %                 ObjectData.ListVarName(ind_off)=[];
    2633 %                 VarDimIndex(ind_off)=[];
    2634 %                 ind_off=[];
    2635 %             
    2636 %             end
    26372683        end
    26382684        if ~isempty(ObjectData)
    2639             PlotType='none'; %default
     2685            %PlotType='none'; %default
    26402686            if imap==2 && isempty(view_field_handle)
    26412687                view_field(ObjectData)
     
    49474993end
    49484994
    4949 
    4950 % --------------------------------------------------------------------
    4951 function MenuSetProject_Callback(hObject, eventdata, handles)
    4952 RootPath=get(handles.RootPath,'String');
    4953 ProjectDir = uigetdir(fileparts(fileparts(RootPath)), 'select the project source directory');
    4954 datatree_browser(ProjectDir)
    4955 
    4956 
    4957 % --------------------------------------------------------------------
    4958 function MenuBrowseProject_Callback(hObject, eventdata, handles)
    4959 RootPath=get(handles.RootPath,'String');
    4960 ProjectDir = uigetdir(fileparts(fileparts(RootPath)), 'select the project directory');
    4961 datatree_browser(ProjectDir)
    4962 
    4963 
    49644995% --- Executes on selection change in Coord_y.
    49654996function Coord_y_Callback(hObject, eventdata, handles)
     
    49715002% --- Executes on button press in CheckColorBar.
    49725003function CheckColorBar_Callback(hObject, eventdata, handles)
    4973 % hObject    handle to CheckColorBar (see GCBO)
    4974 % eventdata  reserved - to be defined in a future version of MATLAB
    4975 % handles    structure with handles and user data (see GUIDATA)
    4976 
    4977 % Hint: get(hObject,'Value') returns toggle state of CheckColorBar
    4978 
Note: See TracChangeset for help on using the changeset viewer.