Changeset 1045 for trunk/src/uvmat.m


Ignore:
Timestamp:
May 21, 2018, 7:06:45 PM (6 years ago)
Author:
sommeria
Message:

find field cells improved

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/uvmat.m

    r1041 r1045  
    17481748set(handles.uvmat,'Pointer','watch') % set the mouse pointer to 'watch'
    17491749drawnow
    1750 % read the current input file name:
     1750% get the current input file name:
    17511751[RootPath,SubDir,RootFile,FileIndices,FileExt]=read_file_boxes(handles);
    17521752% detect the file type, get the movie object if relevant, and look for the corresponding file series:
     
    20022002UvData.NewSeries=1; %flag for REFRESH: begin a new series
    20032003UvData.FileName_1='';% name of the current second field (used to detect a  constant field during file scanning)
    2004 UvData.FileType{index}=FileInfo.FileType;
     2004%UvData.FileType{index}=FileInfo.FileType;
    20052005UvData.FileInfo{index}=FileInfo;
    20062006UvData.MovieObject{index}=VideoObject;
     
    21962196UvData.XmlData{index}=XmlData;
    21972197UvData.NewSeries=1;
     2198set(handles.uvmat,'UserData',UvData)
    21982199
    21992200%display warning message
     
    22332234    set(handles.Coord_y,'String','Coord_y');
    22342235end
    2235 set(handles.uvmat,'UserData',UvData)
     2236
    22362237
    22372238%% set index navigation options
     
    31573158if isempty(i2), set(handles.i2,'String',''); end % suppress the second i index display if not used
    31583159if isempty(j2), set(handles.j2,'String',''); end % suppress the second j index display if not used
    3159 % if strcmp(get(handles.NomType,'String'),'level')
    3160 %     jindex=str2num(get(handles.j1,'String'));
    3161 %     filename=[fullfile(RootPath,SubDir,['level' num2str(jindex)],RootFile) FileIndex FileExt];% build the input file name (first line)
    3162 % else
    31633160if isempty(regexp(RootPath,'^http://'))
    3164 filename=[fullfile(RootPath,SubDir,RootFile) FileIndex FileExt];% build the input file name (first line)
     3161    filename=[fullfile(RootPath,SubDir,RootFile) FileIndex FileExt];% build the input file name (first line)
    31653162else
    31663163    filename=[RootPath '/' SubDir '/' RootFile FileIndex FileExt];%
     
    32503247    for iobj=1:numel(UvData.ProjObject)
    32513248        if isfield(UvData.ProjObject{iobj},'ProjMode')&& strcmp(UvData.ProjObject{iobj}.ProjMode,'interp_tps')
    3252             check_proj_tps=1;
     3249            check_proj_tps=1;% tps projection proposed
    32533250            break
    32543251        end
     
    32853282    end
    32863283end
    3287 switch UvData.FileInfo{1}.FileType
    3288     case {'civx','civdata','netcdf','pivdata_fluidimage'};
     3284switch UvData.FileInfo{1}.FieldType
     3285    case {'civdata','netcdf'};
    32893286        list_fields=get(handles.FieldName,'String');% list menu fields
    32903287        FieldName= list_fields{get(handles.FieldName,'Value')}; % selected field
     
    37753772        set(handles.ListObject_1,'String',{'plane'})
    37763773        if UvData.Field.NbDim==3 %3D case
    3777 %             ZBounds(1)=UvData.Field.ZMin; %minimum for the Z slider
    3778 %             ZBounds(2)=UvData.Field.ZMax;%maximum for the Z slider
    37793774            UvData.ProjObject{1}.NbDim=3;%test for 3D objects
    37803775            UvData.ProjObject{1}.RangeZ=UvData.Field.CoordMesh;%main plotting plane
    37813776            UvData.ProjObject{1}.Coord(1,3)=(UvData.Field.ZMin+UvData.Field.ZMax)/2;%section at a middle plane chosen
    37823777            UvData.ProjObject{1}.Angle=[0 0];
     3778            if isfield(UvData.Field,'CoordUnit')
     3779                UvData.ProjObject{1}.CoordUnit=CoordUnit;
     3780            end
    37833781        elseif isfield(UvData,'Z')
    37843782            %multilevel case (single menuplane in a 3D space)
     
    38463844            UvData.ProjObject{iobj}.NbDim=3;%test for 3D objects
    38473845            if ~isfield(UvData.ProjObject{iobj},'RangeZ')
    3848             UvData.ProjObject{iobj}.RangeZ=UvData.Field.CoordMesh;%main plotting plane
     3846                UvData.ProjObject{iobj}.RangeZ=UvData.Field.CoordMesh;%main plotting plane
    38493847            end
    38503848            if iobj==1 && ~(isfield(UvData.ProjObject{iobj},'Coord') && size(UvData.ProjObject{iobj}.Coord,2)>=3 && UvData.ProjObject{iobj}.Coord(1,3)<UvData.Field.ZMax && UvData.ProjObject{iobj}.Coord(1,3)>UvData.Field.ZMin)
    3851                  UvData.ProjObject{iobj}.Coord(1,3)=(UvData.Field.ZMin+UvData.Field.ZMax)/2;%section at a middle plane chosen
     3849                UvData.ProjObject{iobj}.Coord(1,3)=(UvData.Field.ZMin+UvData.Field.ZMax)/2;%section at a middle plane chosen
    38523850            end
    38533851        end
     
    39793977    % display menus and plot histograms
    39803978    test_v=0;
    3981     if ~isempty(menu_histo)
    3982         set(handles.HistoMenu,'Value',1)
    3983         set(handles.HistoMenu,'String',menu_histo)
    3984         set(handles.Histogram,'Visible','on')
    3985         set(handles.HistoMenu,'Visible','on')
    3986         set(handles.HistoAxes,'Visible','on')
    3987         HistoMenu_Callback(handles.HistoMenu, [], handles)% plot first histogram
    3988     end
    3989 end
    3990 
     3979    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% A REMETTRE
     3980%     if ~isempty(menu_histo)
     3981%         set(handles.HistoMenu,'Value',1)
     3982%         set(handles.HistoMenu,'String',menu_histo)
     3983%         set(handles.Histogram,'Visible','on')
     3984%         set(handles.HistoMenu,'Visible','on')
     3985%         set(handles.HistoAxes,'Visible','on')
     3986%         HistoMenu_Callback(handles.HistoMenu, [], handles)% plot first histogram
     3987%     end
     3988end
     3989% open the set_object for interactive plane projection in 3D case
    39913990if UvData.Field.NbDim==3
    39923991    set(handles.CheckEditObject,'Value',1)
    39933992    CheckEditObject_Callback(handles.uvmat, [], handles)
    39943993end
    3995 %ResizeFcn(handles.uvmat,[],handles)
     3994
    39963995set(handles.uvmat,'Pointer',pointer)
    39973996
     
    43594358[RootPath,SubDir,RootFile,FileIndices,FileExt]=read_file_boxes(handles);
    43604359if isempty(regexp(RootPath,'^http://'))
    4361 FileName=[fullfile(RootPath,SubDir,RootFile) FileIndices FileExt];
     4360    FileName=[fullfile(RootPath,SubDir,RootFile) FileIndices FileExt];
    43624361else
    43634362    FileName=[RootPath '/' SubDir '/' RootFile FileIndices FileExt];
     
    44524451                set(handles.Coord_y,'Max',2)
    44534452                %set(huvmat,
    4454             case 'civdata...'%reinitiate input, return to automatic civ data reading
     4453            case 'civdata...'%reinitiate input, return to automatic civ data readingget_field
    44554454                display_file_name(handles,FileName,1)
    44564455        end
     
    44594458            if isfield(GetFieldData,'Coordinates')
    44604459                XName=GetFieldData.Coordinates.Coord_x;
    4461 %                set(handles.SwitchCoordIndex,'String','var'); % variable used as coordinate
    4462 %             else
    4463 %                 set(handles.SwitchCoordIndex,'String','dim'); % matrix index used a coordinate
    44644460            end
    44654461            TimeNameStr=GetFieldData.Time.SwitchVarIndexTime;
     
    44774473                    MaxIndex_i{1}=num2str(GetFieldData.Time.TimeDimension);
    44784474                    set(handles.MaxIndex_i,'String',MaxIndex_i)%TODO: record time unit
    4479                     UvData=get(handles.uvmat,'UserData');
    44804475                    UvData.TimeUnit=GetFieldData.Time.TimeUnit;
    44814476                    set(handles.uvmat,'UserData',UvData);
     
    44904485                    MaxIndex_i{1}=num2str(GetFieldData.Time.TimeDimension);
    44914486                    set(handles.MaxIndex_i,'String',MaxIndex_i)%TODO: record time unit
    4492                     UvData=get(handles.uvmat,'UserData');
    44934487                    UvData.TimeUnit=GetFieldData.Time.TimeUnit;
    44944488                    set(handles.uvmat,'UserData',UvData);
     
    44974491            end
    44984492            set(handles.Coord_x,'String',XName)
    4499 %             if ischar(YName)
    4500 %                 YName={YName};
    4501 %             end
    45024493            set(handles.Coord_y,'String',YName)
    45034494            set(handles.Coord_z,'String',ZName)
     
    45064497            set(handles.ColorScalar,'Value',1)
    45074498            set(handles.ColorScalar,'String',VecColorList);
    4508             UvData.FileInfo{1}.FileType='netcdf';
     4499           % UvData.FileInfo{1}.FileType='netcdf';
    45094500            set(handles.uvmat,'UserData',UvData)
    45104501            REFRESH_Callback(hObject, eventdata, handles)
     
    46724663            set(handles.FieldName_1,'String',[FieldList; {'get_field...'}]);
    46734664           
    4674             UvData.FileType{2}='netcdf';
     4665            UvData.FileInfo{2}.FileType='netcdf';
    46754666            set(handles.uvmat,'UserData',UvData)
    46764667            REFRESH_Callback(hObject, eventdata, handles)
     
    48044795else% we introduce the same file (with a different field) for the second series
    48054796     FileName_1=FileName;% we compare two fields in the same file
    4806      UvData.FileType{2}=UvData.FileInfo{1}.FileType;
     4797     UvData.FileInfo{2}.FileType=UvData.FileInfo{1}.FileType;
    48074798     UvData.XmlData{2}= UvData.XmlData{1};
    48084799     set(handles.SubField,'Value',1)
     
    57215712%------------------------------------------------------------------------
    57225713check_view=get(handles.CheckViewObject,'Value');
    5723     hset_object=findobj(allchild(0),'tag','set_object');
    5724     if ~isempty(hset_object)
    5725         delete(hset_object)% delete existing version of set_object
    5726     end
     5714hset_object=findobj(allchild(0),'tag','set_object');
     5715if ~isempty(hset_object)
     5716    delete(hset_object)% delete existing version of set_object
     5717end
    57275718if check_view %activate set_object
    57285719    IndexObj=get(handles.ListObject,'Value');
     
    57475738        data.Type='plane';
    57485739    end
    5749 
     5740   
    57505741    %% initiate the new projection object
    57515742    hset_object=set_object(data,[],ZBounds);
     
    57585749        set(hhset_object.SAVE,'Enable','on')
    57595750    end
    5760 else
    5761 %     hset_object=findobj(allchild(0),'tag','set_object');
    5762 %     if ~isempty(hset_object)
    5763 %         delete(hset_object)% delete existing version of set_object
    5764 %     end
    57655751end
    57665752
Note: See TracChangeset for help on using the changeset viewer.