Ignore:
Timestamp:
Mar 25, 2021, 9:37:04 AM (3 years ago)
Author:
sommeria
Message:

phys_polar debugged

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/plot_field.m

    r1093 r1094  
    768768            test_interp_X=0; %default, regularly meshed X coordinate
    769769            test_interp_Y=0; %default, regularly meshed Y coordinate
    770             if isfield(Data,'VarAttribute')
    771                 if numel(Data.VarAttribute)>=CellInfo{icell}.CoordIndex(end) && isfield(Data.VarAttribute{CellInfo{icell}.CoordIndex(end)},'units')
    772                     x_units=Data.VarAttribute{CellInfo{icell}.CoordIndex(end)}.units;
    773                 end
    774                 if numel(Data.VarAttribute)>=CellInfo{icell}.CoordIndex(end-1) && isfield(Data.VarAttribute{CellInfo{icell}.CoordIndex(end-1)},'units')
    775                     y_units=Data.VarAttribute{CellInfo{icell}.CoordIndex(end-1)}.units;
    776                 end
    777             end
     770%             if isfield(Data,'VarAttribute')
     771%                 if numel(Data.VarAttribute)>=CellInfo{icell}.CoordIndex(end) && isfield(Data.VarAttribute{CellInfo{icell}.CoordIndex(end)},'units')
     772%                     x_units=Data.VarAttribute{CellInfo{icell}.CoordIndex(end)}.units;
     773%                 end
     774%                 if numel(Data.VarAttribute)>=CellInfo{icell}.CoordIndex(end-1) && isfield(Data.VarAttribute{CellInfo{icell}.CoordIndex(end-1)},'units')
     775%                     y_units=Data.VarAttribute{CellInfo{icell}.CoordIndex(end-1)}.units;
     776%                 end
     777%             end
    778778            if numel(Coord_y)>2
    779779                DCoord_y=diff(Coord_y);
     
    790790                DCoord_x_min=min(DCoord_x);
    791791                DCoord_x_max=max(DCoord_x);
    792                 if sign(DCoord_x_min)~=sign(DCoord_x_max);% =1 for increasing values, 0 otherwise
     792                if sign(DCoord_x_min)~=sign(DCoord_x_max)% =1 for increasing values, 0 otherwise
    793793                    errormsg=['errror in plot_field.m: non monotonic dimension variable ' Data.ListVarName{VarRole.coord(2)} ];
    794794                    return
     
    821821    end
    822822    %define coordinates as CoordUnits, if not defined as attribute for each variable
     823%     if isfield(Data,'VarAttribute')&& numel(Data.VarAttribute)>=1 && isfield(Data.VarAttribute{1},'unit')
     824%         y_units=Data.VarAttribute{1}.unit;
     825%     end
    823826    if isfield(Data,'CoordUnit')
    824827        if isempty(x_units)
     
    827830        if isempty(y_units)
    828831            y_units=Data.CoordUnit;
     832        end
     833    elseif isfield(Data,'VarAttribute')
     834        if numel(Data.VarAttribute)>=CellInfo{icell}.CoordIndex(end) && isfield(Data.VarAttribute{CellInfo{icell}.CoordIndex(end)},'units')
     835            x_units=Data.VarAttribute{CellInfo{icell}.CoordIndex(end)}.units;
     836        end
     837        if numel(Data.VarAttribute)>=CellInfo{icell}.CoordIndex(end-1) && isfield(Data.VarAttribute{CellInfo{icell}.CoordIndex(end-1)},'units')
     838            y_units=Data.VarAttribute{CellInfo{icell}.CoordIndex(end-1)}.units;
    829839        end
    830840    end
Note: See TracChangeset for help on using the changeset viewer.