- Timestamp:
- Jun 4, 2018, 8:00:50 PM (7 years ago)
- Location:
- trunk/src
- Files:
-
- 1 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/find_field_cells.m
r1045 r1048 328 328 end 329 329 for ivar=ind_coord_y 330 330 if check_coord_names(ivar) 331 331 DimRank=find(strcmp(Data.VarDimName{ivar},DimCell_var)); 332 332 check_coord=~isempty(DimRank); … … 396 396 CellInfo{icell}.CoordSize=numel(Data.(CellInfo{icell}.XName)); 397 397 case 'grid' 398 VarName=Data.ListVarName{CellInfo{icell}.VarIndex(1)}; 398 399 if NbDim(icell)==3 399 CellInfo{icell}.CoordSize=[ numel(Data.(CellInfo{icell}.XName)) numel(Data.(CellInfo{icell}.YName)) numel(Data.(CellInfo{icell}.YName))];400 CellInfo{icell}.CoordSize=[size(Data.(VarName),3) size(Data.(VarName),2) size(Data.(VarName),1)]; 400 401 else 401 CellInfo{icell}.CoordSize=[ numel(Data.(CellInfo{icell}.XName)) numel(Data.(CellInfo{icell}.YName))];402 CellInfo{icell}.CoordSize=[size(Data.(VarName),2) size(Data.(VarName),1)]; 402 403 end 403 404 case 'tps' … … 469 470 Cell1DPlot{icell}.XIndex=ind_coord_x(icell); 470 471 Cell1DPlot{icell}.XName=Data.ListVarName{ind_coord_x(icell)}; 472 Cell1DPlot{icell}.YIndex=[]; 473 Cell1DPlot{icell}.YIndex_discrete=[]; 471 474 DimCell_x=Data.VarDimName{ind_coord_x(icell)}; 472 for ivar= [ind_coord_y ind_discrete]475 for ivar=ind_coord_y 473 476 DimCell=Data.VarDimName{ivar}; 474 477 if numel(DimCell)==1 && strcmp(DimCell_x{1},DimCell{1}) 475 478 y_nbre(icell)=y_nbre(icell)+1; 476 479 Cell1DPlot{icell}.YIndex(y_nbre(icell))=ivar; 477 break 478 end 479 end 480 end 481 Cell1DPlot(find(y_nbre==0))=[]; 480 end 481 end 482 for ivar=ind_discrete 483 DimCell=Data.VarDimName{ivar}; 484 if numel(DimCell)==1 && strcmp(DimCell_x{1},DimCell{1}) 485 y_nbre(icell)=y_nbre(icell)+1; 486 Cell1DPlot{icell}.YIndex_discrete(y_nbre(icell))=ivar; 487 end 488 end 489 end 490 Cell1DPlot(y_nbre==0)=[]; 482 491 CellInfo=[CellInfo Cell1DPlot]; 483 492 NbDim=[NbDim ones(1,numel(Cell1DPlot))]; -
trunk/src/plot_field.m
r1045 r1048 410 410 %loop on input fields 411 411 for icell=1:numel(CellInfo) 412 VarIndex= CellInfo{icell}.YIndex;% indices of the selected variables in the list data.ListVarName412 VarIndex=[CellInfo{icell}.YIndex CellInfo{icell}.YIndex_discrete];% indices of the selected variables in the list data.ListVarName 413 413 coord_x_index=CellInfo{icell}.XIndex; 414 414 coord_x_name{icell}=data.ListVarName{coord_x_index}; … … 442 442 end 443 443 end 444 if isfield(CellInfo{icell},' VarIndex_discrete')444 if isfield(CellInfo{icell},'YIndex_discrete')&& ~isempty(CellInfo{icell}.YIndex_discrete) 445 445 charplot_0='''+'''; 446 446 else -
trunk/src/proj_field.m
r1045 r1048 539 539 end 540 540 % default output 541 errormsg='';%default542 541 Xline=[]; 543 542 flux=0; … … 545 544 liny=ObjectData.Coord(:,2); 546 545 NbPoints=size(ObjectData.Coord,1); 547 testfalse=0;548 ListIndex={};549 546 550 547 %% group the variables (fields of 'FieldData') in cells of variables with the same dimensions … … 556 553 CellInfo=CellInfo(NbDim>=2); %keep only the 2D or 3D cells 557 554 cell_select=true(size(CellInfo)); 558 559 555 for icell=1:length(CellInfo) 560 556 if isfield(CellInfo{icell},'ProjModeRequest') 561 % if ~strcmp(CellInfo{icell}.ProjModeRequest, ProjMode)562 % cell_select(icell)=0;563 % end564 557 if strcmp(ProjMode,'interp_tps')&& ~strcmp(CellInfo{icell}.CoordType,'tps') 565 558 cell_select(icell)=0; … … 567 560 end 568 561 end 569 if isempty(find(cell_select ))562 if isempty(find(cell_select,1)) 570 563 errormsg=[' invalid projection mode ''' ProjMode ''': use ''interp_tps'' to interpolate spatial derivatives']; 571 564 return … … 598 591 end 599 592 CheckClosedLine=~isempty(find(strcmp(ObjectData.Type,{'rectangle','ellipse','polygon'}))); 600 601 % x = a \ \cosh \mu \ \cos \nu602 %603 % y = a \ \sinh \mu \ \sin \nu604 593 605 594 %% angles of the polyline and boundaries of action for mode 'projection' … … 694 683 %case of unstructured coordinates 695 684 case 'scattered' 696 % XName= FieldData.ListVarName{CellInfo{icell}.CoordIndex(end)};697 % YName= FieldData.ListVarName{CellInfo{icell}.CoordIndex(end-1)};698 685 coord_x=FieldData.(FieldData.ListVarName{CellInfo{icell}.CoordIndex(end)}); 699 686 coord_y=FieldData.(FieldData.ListVarName{CellInfo{icell}.CoordIndex(end-1)}); 700 687 701 if isequal(ProjMode,'projection')688 if strcmp(ProjMode,'projection') 702 689 if width==0 703 690 errormsg='range of the projection object is missing'; … … 707 694 ProjData.VarDimName=[ProjData.VarDimName FieldData.ListVarName(CellInfo{icell}.CoordIndex(end))]; 708 695 nbvar=numel(ProjData.ListVarName); 696 ProjData.VarAttribute{nbvar}.Role='coord_x'; 709 697 ProjData.VarAttribute{nbvar}.long_name='abscissa along line'; 710 698 % select the (non false) input data located in the band of projection … … 742 730 ProjData.VarDimName=[ProjData.VarDimName {XName}]; 743 731 nbvar=numel(ProjData.ListVarName); 732 ProjData.VarAttribute{nbvar}.Role='coord_x'; 744 733 ProjData.VarAttribute{nbvar}.long_name='abscissa along line'; 745 734 check_abscissa=1; % define abcissa only once … … 769 758 end 770 759 end 771 ProjData.VarAttribute{ivar+nbvar}.Role='co ntinuous';% will promote plots of the profiles with continuous lines760 ProjData.VarAttribute{ivar+nbvar}.Role='coord_y';% will promote plots of the profiles with continuous lines 772 761 ProjData.(ListFieldProj{ivar})=ProjVar{ivar}; 773 762 end … … 778 767 NbCentres=FieldData.(FieldData.ListVarName{CellInfo{icell}.NbCentres_tps}); 779 768 SubRange=FieldData.(FieldData.ListVarName{CellInfo{icell}.SubRange_tps}); 780 if isfield(CellInfo{icell},'VarIndex_vector_x _tps')&&isfield(CellInfo{icell},'VarIndex_vector_y_tps')781 FieldVar=cat(3,FieldData.(FieldData.ListVarName{CellInfo{icell}.VarIndex_vector_x _tps}),FieldData.(FieldData.ListVarName{CellInfo{icell}.VarIndex_vector_y_tps}));769 if isfield(CellInfo{icell},'VarIndex_vector_x')&&isfield(CellInfo{icell},'VarIndex_vector_y') 770 FieldVar=cat(3,FieldData.(FieldData.ListVarName{CellInfo{icell}.VarIndex_vector_x}),FieldData.(FieldData.ListVarName{CellInfo{icell}.VarIndex_vector_y})); 782 771 end 783 772 [DataOut,VarAttribute,errormsg]=calc_field_tps(Coord,NbCentres,SubRange,FieldVar,CellInfo{icell}.FieldName,cat(3,XI,YI)); … … 786 775 ProjData.X=Xproj; 787 776 nbvar=numel(ProjData.ListVarName); 777 ProjData.VarAttribute{nbvar}.Role='coord_x'; 788 778 ProjData.VarAttribute{nbvar}.long_name='abscissa along line'; 789 779 ProjVarName=(fieldnames(DataOut))'; … … 799 789 end 800 790 end 801 ProjData.VarAttribute{ivar+nbvar}.Role='co ntinuous';% will promote plots of the profiles with continuous lines791 ProjData.VarAttribute{ivar+nbvar}.Role='coord_y';% will promote plots of the profiles with continuous lines 802 792 ProjData.(ProjVarName{ivar})=DataOut.(ProjVarName{ivar}); 803 793 end … … 1107 1097 %error=0;%default 1108 1098 %flux=0; 1109 %testfalse=0;1110 %ListIndex={};1111 1099 1112 1100 %% group the variables (fields of 'FieldData') in cells of variables with the same dimensions -
trunk/src/series/civ_input.m
r1033 r1048 337 337 338 338 %% set default choice of pair mode 339 PairIndex= [];339 PairIndex=1; 340 340 if isfield(Param,'ActionInput') && isfield(Param.ActionInput,'PairIndices') 341 341 PairIndex=find(strcmp(Param.ActionInput.PairIndices.ListPairMode,PairMenu)); -
trunk/src/uvmat.m
r1046 r1048 4164 4164 test_v=0; 4165 4165 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% A REMETTRE 4166 %if ~isempty(menu_histo)4167 %set(handles.HistoMenu,'Value',1)4168 %set(handles.HistoMenu,'String',menu_histo)4169 %set(handles.Histogram,'Visible','on')4170 %set(handles.HistoMenu,'Visible','on')4171 %set(handles.HistoAxes,'Visible','on')4172 %HistoMenu_Callback(handles.HistoMenu, [], handles)% plot first histogram4173 %end4166 if ~isempty(menu_histo) 4167 set(handles.HistoMenu,'Value',1) 4168 set(handles.HistoMenu,'String',menu_histo) 4169 set(handles.Histogram,'Visible','on') 4170 set(handles.HistoMenu,'Visible','on') 4171 set(handles.HistoAxes,'Visible','on') 4172 HistoMenu_Callback(handles.HistoMenu, [], handles)% plot first histogram 4173 end 4174 4174 end 4175 4175 % open the set_object for interactive plane projection in 3D case … … 4262 4262 end 4263 4263 end 4264 Histo.VarAttribute{1}.Role='coord_x'; 4265 Histo.VarAttribute{2}.Role='coord_y'; 4264 4266 if ~isempty(units) 4265 4267 Histo.VarAttribute{1}.units=units;
Note: See TracChangeset
for help on using the changeset viewer.