Changeset 890 for trunk/src/proj_field.m


Ignore:
Timestamp:
Apr 18, 2015, 11:03:01 PM (9 years ago)
Author:
sommeria
Message:

bugs solved for reading general netcdf files

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/proj_field.m

    r888 r890  
    123123end
    124124
    125 % %% take the difference of projected input fields if relevant
    126 % [CellInfo,NbDim,errormsg]=find_field_cells(ProjData);
    127 % ind_remove=zeros(size(ProjData.ListVarName));
    128 % ivar=[];
    129 % ivar_1=[];
    130 % for icell=1:numel(CellInfo)
    131 %     if ~isempty(CellInfo{icell})
    132 %         % if two scalar are in the same cell
    133 %         if isfield(CellInfo{icell},'VarIndex_scalar') && numel(CellInfo{icell}.VarIndex_scalar)==2 && ProjData.VarAttribute{CellInfo{icell}.VarIndex_scalar(2)}.CheckSub;
    134 %             ivar=[ivar CellInfo{icell}.VarIndex_scalar(1)];
    135 %             ivar_1=[ivar_1 CellInfo{icell}.VarIndex_scalar(2)];
    136 %         end
    137 %         % if two vector u components are in the same cell
    138 %         if isfield(CellInfo{icell},'VarIndex_vector_x') && numel(CellInfo{icell}.VarIndex_vector_x)==2 && ProjData.VarAttribute{CellInfo{icell}.VarIndex_vector_x(2)}.CheckSub;
    139 %             ivar=[ivar CellInfo{icell}.VarIndex_vector_x(1)];
    140 %             ivar_1=[ivar_1 CellInfo{icell}.VarIndex_vector_x(2)];
    141 %         end
    142 %          % if two vector v components are in the same cell
    143 %         if isfield(CellInfo{icell},'VarIndex_vector_y') && numel(CellInfo{icell}.VarIndex_vector_y)==2 && ProjData.VarAttribute{CellInfo{icell}.VarIndex_vector_y(2)}.CheckSub;
    144 %             ivar=[ivar CellInfo{icell}.VarIndex_vector_y(1)];
    145 %             ivar_1=[ivar_1 CellInfo{icell}.VarIndex_vector_y(2)];
    146 %         end
    147 %     end
    148 % end
    149 % % subtract fields if relevant
    150 % for imod=1:numel(ivar)
    151 %         VarName=ProjData.ListVarName{ivar(imod)};
    152 %         VarName_1=ProjData.ListVarName{ivar_1(imod)};
    153 %         ProjData.(VarName)=double(ProjData.(VarName))-double(ProjData.(VarName_1));
    154 %         ind_remove(ivar_1(imod))=1;
    155 % end
    156 % ProjData.ListVarName(find(ind_remove))=[];
    157 % ProjData.VarDimName(find(ind_remove))=[];
    158 % ProjData.VarAttribute(find(ind_remove))=[];
    159 
    160125%-----------------------------------------------------------------
    161126%project on a set of points
     
    11431108        end
    11441109        [XI,YI]=meshgrid(coord_x_proj,coord_y_proj);%grid in the new coordinates
     1110        ProjData.VarDimName={AYName,AXName};
    11451111%         XI=ObjectData.Coord(1,1)+(X)*cos(PlaneAngle(3))-YI*sin(PlaneAngle(3));%corresponding coordinates in the original system
    11461112%         YI=ObjectData.Coord(1,2)+(X)*sin(PlaneAngle(3))+YI*cos(PlaneAngle(3));
     
    11491115        AYName=FieldData.ListVarName{CellInfo{icell_grid}.CoordIndex(NbDim-1)};%name of input x coordinate (name preserved on projection)
    11501116        AXName=FieldData.ListVarName{CellInfo{icell_grid}.CoordIndex(NbDim)};%name of input y coordinate (name preserved on projection)
     1117        AYDimName=FieldData.VarDimName{CellInfo{icell_grid}.CoordIndex(NbDim-1)};%
     1118        AXDimName=FieldData.VarDimName{CellInfo{icell_grid}.CoordIndex(NbDim)};%
     1119         ProjData.VarDimName={AYDimName,AXDimName};
    11511120        ProjData.(AYName)=FieldData.(AYName); % new (projected ) y coordinates
    11521121        ProjData.(AXName)=FieldData.(AXName); % new (projected ) y coordinates
    11531122    end
    11541123    ProjData.ListVarName={AYName,AXName};
    1155     ProjData.VarDimName={AYName,AXName};
     1124   
    11561125    ProjData.VarAttribute={[],[]};
    11571126end
Note: See TracChangeset for help on using the changeset viewer.