Changeset 1050 for trunk/src/get_field.m
- Timestamp:
- Jun 11, 2018, 9:17:44 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/get_field.m
r1045 r1050 640 640 else % no input variable, the variable ScalarName is selected from the menu 641 641 scalar_index=get(handles.scalar,'Value'); 642 642 ScalarName=scalar_menu{scalar_index}; 643 643 end 644 644 … … 647 647 test_coord=zeros(size(Field.Display.VarDimName)); %=1 when variable #ilist is eligible as structured coordiante 648 648 dim_var=Field.Display.VarDimName{scalar_index};%list of dimensions of the selected variable 649 %if ~get(handles.CheckDimensionX,'Value') 650 651 652 653 654 655 656 657 658 649 %if ~get(handles.CheckDimensionX,'Value') 650 %look for coordinate variables among the other variables 651 for ilist=1:numel(Field.Display.VarDimName) 652 dimnames=Field.Display.VarDimName{ilist}; %list of dimensions for variable #ilist 653 if isequal(dimnames,dim_var) 654 test_component(ilist)=1;% the listed variable has the same dimension as the selected scalar-> possibly chosen as unstructured coordinate 655 elseif numel(dimnames)==1 && ~isempty(find(strcmp(dimnames{1},dim_var), 1))%variable ilist is a 1D array which can be coordinate variable 656 test_coord(ilist)=1; 657 end 658 end 659 659 %end 660 660 var_component=find(test_component);% list of variable indices elligible as unstructured coordinates … … 687 687 elseif strcmp(Role,'coord_z') 688 688 coord_val(3)=ilist; 689 Check3D=1; 690 end 691 end 692 end 693 if numel(find(coord_val))<2 689 end 690 end 691 end 692 if numel(find(coord_val))<2 % no predefiend components 694 693 if numel(var_coord)>=3 695 coord_val=[3 2 1]; 696 elseif numel(var_coord)>=2 697 % coord_val=[numel(var_component)+2 numel(var_component)+1]; 698 coord_val=[2 1]; 699 else 700 coord_val=[1 2]; 701 end 702 end 703 % if get(handles.CheckDimensionX,'Value') 704 % set(handles.Coord_x,'Value',2) 705 % set(handles.Coord_x,'String',dim_var') 706 % else 707 set(handles.Coord_x,'Value',coord_val(1)) 708 set(handles.Coord_x,'String',ListCoord) 709 % end 710 % if get(handles.CheckDimensionX,'Value') 711 % set(handles.Coord_y,'Value',1) 712 % set(handles.Coord_y,'String',dim_var') 713 % else 714 set(handles.Coord_y,'Value',coord_val(2)) 715 set(handles.Coord_y,'String',ListCoord) 716 % end 717 % if get(handles.CheckDimensionX,'Value') 718 % set(handles.Coord_z,'Value',1) 719 % set(handles.Coord_z,'String',dim_var') 720 % else 721 if numel(test_coord)>=3 722 set(handles.Coord_z,'Value',coord_val(2)) 694 coord_val(3)=3; 695 end 696 coord_val([1 2])=[1 2]; 697 end 698 set(handles.Coord_x,'Value',coord_val(1)) 699 set(handles.Coord_x,'String',ListCoord) 700 701 set(handles.Coord_y,'Value',coord_val(2)) 702 set(handles.Coord_y,'String',ListCoord) 703 704 if numel(coord_val)>=3 705 set(handles.Coord_z,'Value',coord_val(3)) 723 706 set(handles.Coord_z,'String',ListCoord) 724 707 set(handles.Coord_z,'Visible','on') … … 746 729 set(handles.TimeName,'Value',1) 747 730 set(handles.TimeName,'String',ListTime) 748 end 731 end 749 732 if ~ischar(VarName) 750 update_field(handles,ScalarName)733 update_field(handles,ScalarName) 751 734 end 752 735
Note: See TracChangeset
for help on using the changeset viewer.