Changeset 912 for trunk/src/proj_field.m


Ignore:
Timestamp:
Jun 16, 2015, 8:15:10 PM (9 years ago)
Author:
sommeria
Message:

interp range introduced in set_object

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/proj_field.m

    r908 r912  
    10101010end
    10111011
     1012%% interpolation range
     1013thresh2=[];
     1014if isfield(ObjectData,'RangeInterp')
     1015    thresh2=ObjectData.RangeInterp*ObjectData.RangeInterp;%square of interpolation range (do not interpolate beyond this range)
     1016end
     1017
    10121018%% initiate Matlab  structure for physical field
    10131019[ProjData,errormsg]=proj_heading(FieldData,ObjectData);
     
    13031309                    Disty=G(XI,YI)-YI;% diff of y coordinates with the nearest measurement point
    13041310                    Dist=Distx.*Distx+Disty.*Disty;
    1305                     for ivar=1:numel(VarVal)
    1306                         VarVal{ivar}(Dist>16*ProjData.CoordMesh)=NaN;% % put to NaN interpolated positions further than 4 meshes from initial data
    1307                     end 
    1308                    
     1311                    if ~isempty(thresh2)
     1312                        for ivar=1:numel(VarVal)
     1313                            VarVal{ivar}(Dist>thresh2)=NaN;% % put to NaN interpolated positions further than 4 meshes from initial data
     1314                        end
     1315                    end
    13091316                    if isfield(CellInfo{icell},'CheckSub') && CellInfo{icell}.CheckSub && ~isempty(vector_x_proj)
    13101317                        ProjData.(FieldData.ListVarName{vector_x_proj})=ProjData.(FieldData.ListVarName{vector_x_proj})-VarVal{1};
     
    13581365                for ilist=1:numel(ListVarName)% reshape data, excluding coordinates (ilist=1-2), TODO: rationalise
    13591366                    VarName=ListVarName{ilist};
     1367                    VarDimName{ilist}={'coord_y','coord_x'};
    13601368                    ProjData.(VarName)=DataOut.(VarName);
    1361                     ProjData.(VarName)(Dist>16*ProjData.CoordMesh)=NaN;% put to NaN interpolated positions further than 4 meshes from initial data
    1362                     VarDimName{ilist}={'coord_y','coord_x'};
     1369                    if ~isempty(thresh2)
     1370                        ProjData.(VarName)(Dist>thresh2)=NaN;% put to NaN interpolated positions further than RangeInterp from initial data
     1371                    end
    13631372                end
    13641373            end
Note: See TracChangeset for help on using the changeset viewer.