Ignore:
Timestamp:
Jun 3, 2014, 8:10:03 PM (10 years ago)
Author:
sommeria
Message:

AX and AY changed to Coord_x and Coord_y

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/concentration.m

    r566 r782  
    4949Ref.Aref(ind_bad)=D(ind_bad);
    5050DataOut_1=[];
    51 AX=DataOut.AX;
    52 AY=DataOut.AY;
     51Coord_x=DataOut.Coord_x;
     52Coord_y=DataOut.Coord_y;
    5353
    54 dX=(AX(2)-AX(1))/(npx-1);
    55 dY=(AY(1)-AY(2))/(npy-1);%mesh of new pixels
    56 [R,Y]=meshgrid(linspace(AX(1),AX(2),npx),linspace(AY(1),AY(2),npy));
    57 r=AX(1)+[0:npx-1]*dX;%distance from laser
     54dX=(Coord_x(2)-Coord_x(1))/(npx-1);
     55dY=(Coord_y(1)-Coord_y(2))/(npy-1);%mesh of new pixels
     56[R,Y]=meshgrid(linspace(Coord_x(1),Coord_x(2),npx),linspace(Coord_y(1),Coord_y(2),npy));
     57r=Coord_x(1)+[0:npx-1]*dX;%distance from laser
    5858%A(ind_good)=(A(ind_good)>=0).*A(ind_good); %replaces negative values  by zeros
    5959A=A./Ref.Aref;% luminosity normalised by the reference (value at the edge of the box)
     
    7171Edge_ind=find((abs(R-r_edge)/dX)<=1 & DataMask.A~=0);%indies of positions close to r_edge, values greater than 1 are not expected
    7272yedge=min(min(Y(Edge_ind)));
    73 jmax=round(-(yedge-AY(1))/dY+1);
     73jmax=round(-(yedge-Coord_y(1))/dY+1);
    7474DataMask.A(jmax:end,:)=0;
    7575
     
    7777
    7878% radius along the reference line
    79 Theta=(linspace(AY(1),AY(2),npy)*pi/180)'*ones(1,npx);%theta in radians
     79Theta=(linspace(Coord_y(1),Coord_y(2),npy)*pi/180)'*ones(1,npx);%theta in radians
    8080
    8181gamma_coeff=Ref.GammaCoeff*ones(1,npx);
     
    9191
    9292DataOut=polar2phys(DataOut,RangeX,RangeY);
    93 DataOut.AX=DataOut.AX+XmlData.GeometryCalib.PolarCentre(1);
    94 DataOut.AY=DataOut.AY+XmlData.GeometryCalib.PolarCentre(2);
     93DataOut.Coord_x=DataOut.Coord_x+XmlData.GeometryCalib.PolarCentre(1);
     94DataOut.Coord_y=DataOut.Coord_y+XmlData.GeometryCalib.PolarCentre(2);
    9595DataMask=polar2phys(DataMask,RangeX,RangeY);
    96 DataMask.AX=DataMask.AX+XmlData.GeometryCalib.PolarCentre(1);
    97 DataMask.AY=DataMask.AY+XmlData.GeometryCalib.PolarCentre(2);
     96DataMask.Coord_x=DataMask.Coord_x+XmlData.GeometryCalib.PolarCentre(1);
     97DataMask.Coord_y=DataMask.Coord_y+XmlData.GeometryCalib.PolarCentre(2);
    9898
    9999
     
    102102DataOut=DataIn; %fdefault
    103103[npy,npx]=size(DataIn.A);
    104 dx=(DataIn.AX(2)-DataIn.AX(1))/(npx-1);
    105 dy=(DataIn.AY(2)-DataIn.AY(1))/(npy-1);%mesh
    106 rcorner=[DataIn.AX(1) DataIn.AX(2) DataIn.AX(1) DataIn.AX(2)];% radius of the corners
    107 ycorner=[DataIn.AY(2) DataIn.AY(2) DataIn.AY(1) DataIn.AY(1)];% azimuth of the corners
     104dx=(DataIn.Coord_x(2)-DataIn.Coord_x(1))/(npx-1);
     105dy=(DataIn.Coord_y(2)-DataIn.Coord_y(1))/(npy-1);%mesh
     106rcorner=[DataIn.Coord_x(1) DataIn.Coord_x(2) DataIn.Coord_x(1) DataIn.Coord_x(2)];% radius of the corners
     107ycorner=[DataIn.Coord_y(2) DataIn.Coord_y(2) DataIn.Coord_y(1) DataIn.Coord_y(1)];% azimuth of the corners
    108108thetacorner=pi*ycorner/180;% azimuth in radians
    109109[Xcorner,Ycorner] = pol2cart(thetacorner,rcorner);% cartesian coordinates of the corners (with respect to lser source)
     
    126126[Theta,R] = cart2pol(X,Y);%corresponding polar coordiantes
    127127Theta=Theta*180/pi;
    128 %Theta=1+round((Theta-DataIn.AY(1))/dy); %index along y (dy negative)
    129 Theta=1-round((Theta-DataIn.AY(2))/dy); %index along y (dy negative)
    130 R=1+round((R-DataIn.AX(1))/dx); %index along x
     128%Theta=1+round((Theta-DataIn.Coord_y(1))/dy); %index along y (dy negative)
     129Theta=1-round((Theta-DataIn.Coord_y(2))/dy); %index along y (dy negative)
     130R=1+round((R-DataIn.Coord_x(1))/dx); %index along x
    131131R=reshape(R,1,npx*npy);%indices reorganized in 'line'
    132132Theta=reshape(Theta,1,npx*npy);
     
    142142
    143143     %Rangx=Rangx-radius_ref;
    144 DataOut.AX=RangeX;
    145 DataOut.AY=RangeY; 
     144DataOut.Coord_x=RangeX;
     145DataOut.Coord_y=RangeY; 
    146146
Note: See TracChangeset for help on using the changeset viewer.