Changeset 581 for trunk/src/plot_field.m


Ignore:
Timestamp:
Mar 12, 2013, 12:52:13 PM (11 years ago)
Author:
sommeria
Message:

clean the transform field functions

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/plot_field.m

    r569 r581  
    249249function errormsg=plot_text(FieldData,CellInfo,htext)
    250250%-------------------------------------------------------------------
    251 errormsg=[];
     251errormsg='';
    252252txt_cell={};
    253253Data={};
     
    10451045   
    10461046    %decimate by a factor 2 in vector mesh(4 in nbre of vectors)
     1047    check_decimate=0;
    10471048    if isfield(PlotParam.Vectors,'CheckDecimate4') && PlotParam.Vectors.CheckDecimate4
     1049        check_decimate=1;
    10481050        diffy=diff(vec_Y); %difference dy=vec_Y(i+1)-vec_Y(i)
    10491051        dy_thresh=max(abs(diffy))/2;
     
    10551057        nb_sel=length(ind_sel);
    10561058        ind_sel=ind_sel(1:2:nb_sel);% take half the points on a line
     1059    elseif isfield(PlotParam.Vectors,'CheckDecimate16') && PlotParam.Vectors.CheckDecimate16
     1060        check_decimate=1;
     1061        diffy=diff(vec_Y); %difference dy=vec_Y(i+1)-vec_Y(i)
     1062        dy_thresh=max(abs(diffy))/2;
     1063        ind_jump=find(abs(diffy) > dy_thresh); %indices with diff(vec_Y)> max/2, detect change of line
     1064        ind_sel=1:ind_jump(1);%select the first line
     1065        for i=2:4:length(ind_jump)-1
     1066            ind_sel=[ind_sel (ind_jump(i)+1:ind_jump(i+1))];% select the odd lines
     1067        end
     1068        nb_sel=length(ind_sel);
     1069        ind_sel=ind_sel(1:4:nb_sel);% take half the points on a line
     1070    end
     1071    if check_decimate
    10571072        vec_X=vec_X(ind_sel);
    10581073        vec_Y=vec_Y(ind_sel);
Note: See TracChangeset for help on using the changeset viewer.