Index: /trunk/src/mouse_motion.m
===================================================================
--- /trunk/src/mouse_motion.m	(revision 1076)
+++ /trunk/src/mouse_motion.m	(revision 1077)
@@ -231,5 +231,5 @@
                     norm_plane(3)=OmAxis(3)*coeff+cos_om;
                     %Z0=norm_plane*Field.ProjObjectCoord'/norm_plane(3);
-                    pos(3)=-(norm_plane(1)*pos(1)-norm_plane(2)*pos(2))/norm_plane(3);                               
+                    pos(3)=-(norm_plane(1)*pos(1)+norm_plane(2)*pos(2))/norm_plane(3);                               
                 end
                 pos=pos+Field.ProjObjectCoord;
Index: /trunk/src/plot_field.m
===================================================================
--- /trunk/src/plot_field.m	(revision 1076)
+++ /trunk/src/plot_field.m	(revision 1077)
@@ -102,5 +102,5 @@
 
 %% default input and output
-if ~exist('PlotParam','var'),PlotParam=[];end;
+if ~exist('PlotParam','var'),PlotParam=[];end
 PlotType='text'; %default
 if ~isfield(PlotParam,'Axes')
@@ -114,12 +114,4 @@
 
 %% check input structure
-% check the cells of fields :
-
-% if ~isfield(PlotParam,'FieldName')
-%     index_0D=[];
-%     index_1D=1;
-%     index_2D=[];%find 2D fields
-%     index_3D=[];
-% else
     [CellInfo,NbDimArray,errormsg]=find_field_cells(Data);
     if ~isempty(errormsg)
@@ -363,5 +355,22 @@
 % --- plot 1D fields (usual x,y plots)
 %-------------------------------------------------------------------
-function PlotParamOut=plot_profile(data,CellInfo,haxes,PlotParam,CheckHold)
+%INPUT
+%    Data:   structure describing the field to plot 
+%         (optional) .ListGlobalAttribute: cell listing the names of the global attributes
+%                    .Att_1,Att_2... : values of the global attributes
+%         (requested)  .ListVarName: list of variable names to select (cell array of  char strings {'VarName1', 'VarName2',...} ) 
+%         (requested)  .VarDimName: list of dimension names for each element of .ListVarName (cell array of string cells)
+%                      .VarAttribute: cell of attributes for each element of .ListVarName (cell array of structures of the form VarAtt.key=value)
+%         (requested) .Var1, .Var2....: variables (Matlab arrays) with names listed in .ListVarName
+%  
+%            Variable attribute .Role :
+%    The only variable attribute used for plotting purpose is .Role which can take
+%    the values:
+%       Role = 'coord_x' or 'histo' to label the x coordinate
+%            ='coord_y' or 'discrete' to label the y coordinate, variables labelled as 'discrete'
+%           will be plotted as isolated points while variables labelled as 'coord_y' will be plotted as continuous lines
+%    other variables will not be taken into account for plot_profile
+
+function PlotParamOut=plot_profile(Data,CellInfo,haxes,PlotParam,CheckHold)
 
 %% initialization
@@ -376,6 +385,6 @@
 legend_str={};
 
-%% suppress existing plot if empty data
-if isempty(data)
+%% suppress existing plot if empty Data
+if isempty(Data)
     hplot=findobj(haxes,'tag','plot_line');
     if ~isempty(hplot)
@@ -407,15 +416,15 @@
 MinY_cell=[];
 MaxY_cell=[];
-testplot=ones(size(data.ListVarName));%default test for plotted variables
+testplot=ones(size(Data.ListVarName));%default test for plotted variables
 %loop on input  fields
 for icell=1:numel(CellInfo)
-    VarIndex=[CellInfo{icell}.YIndex CellInfo{icell}.YIndex_discrete];%  indices of the selected variables in the list data.ListVarName
+    VarIndex=[CellInfo{icell}.YIndex CellInfo{icell}.YIndex_discrete];%  indices of the selected variables in the list Data.ListVarName
     coord_x_index=CellInfo{icell}.XIndex;
-    coord_x_name{icell}=data.ListVarName{coord_x_index};
-    coord_x{icell}=data.(data.ListVarName{coord_x_index});%coordinate variable set as coord_x
+    coord_x_name{icell}=Data.ListVarName{coord_x_index};
+    coord_x{icell}=Data.(Data.ListVarName{coord_x_index});%coordinate variable set as coord_x
     if isempty(find(strcmp(coord_x_name{icell},coord_x_name(1:end-1)), 1)) %xtitle not already selected
         xtitle=[xtitle coord_x_name{icell}];
-        if isfield(data,'VarAttribute')&& numel(data.VarAttribute)>=coord_x_index && isfield(data.VarAttribute{coord_x_index},'units')
-            xtitle=[xtitle '(' data.VarAttribute{coord_x_index}.units '), '];
+        if isfield(Data,'VarAttribute')&& numel(Data.VarAttribute)>=coord_x_index && isfield(Data.VarAttribute{coord_x_index},'units')
+            xtitle=[xtitle '(' Data.VarAttribute{coord_x_index}.units '), '];
         else
             xtitle=[xtitle ', '];
@@ -432,11 +441,11 @@
             testplot(CellInfo{icell}.VarIndex_warnflag)=0;
         end
-        if isfield(data,'VarAttribute')
-            VarAttribute=data.VarAttribute;
+        if isfield(Data,'VarAttribute')
+            VarAttribute=Data.VarAttribute;
             for ivar=1:length(VarIndex)
                 if length(VarAttribute)>=VarIndex(ivar) && isfield(VarAttribute{VarIndex(ivar)},'long_name')
                     plotname{VarIndex(ivar)}=VarAttribute{VarIndex(ivar)}.long_name;
                 else
-                    plotname{VarIndex(ivar)}=data.ListVarName{VarIndex(ivar)};%name for display in plot A METTRE
+                    plotname{VarIndex(ivar)}=Data.ListVarName{VarIndex(ivar)};%name for display in plot A METTRE
                 end
             end
@@ -453,18 +462,18 @@
         for ivar=1:length(VarIndex)
             if testplot(VarIndex(ivar))
-                VarName=data.ListVarName{VarIndex(ivar)};
+                VarName=Data.ListVarName{VarIndex(ivar)};
                 nbplot=nbplot+1;
                 ytitle=[ytitle VarName];
-                if isfield(data,'VarAttribute')&& numel(data.VarAttribute)>=VarIndex(ivar) && isfield(data.VarAttribute{VarIndex(ivar)},'units')
-                    ytitle=[ytitle '(' data.VarAttribute{VarIndex(ivar)}.units '), '];
+                if isfield(Data,'VarAttribute')&& numel(Data.VarAttribute)>=VarIndex(ivar) && isfield(Data.VarAttribute{VarIndex(ivar)},'units')
+                    ytitle=[ytitle '(' Data.VarAttribute{VarIndex(ivar)}.units '), '];
                 else
                     ytitle=[ytitle ', '];
                 end
-                eval(['data.' VarName '=squeeze(data.' VarName ');'])
-                MinY(ivar)=min(min(data.(VarName)));
-                MaxY(ivar)=max(max(data.(VarName)));
-                plotstr=[plotstr 'coord_x{' num2str(icell) '},data.' VarName ',' charplot_0 ','];
-                eval(['nbcomponent2=size(data.' VarName ',2);']);
-                eval(['nbcomponent1=size(data.' VarName ',1);']);
+                eval(['Data.' VarName '=squeeze(Data.' VarName ');'])
+                MinY(ivar)=min(min(Data.(VarName)));
+                MaxY(ivar)=max(max(Data.(VarName)));
+                plotstr=[plotstr 'coord_x{' num2str(icell) '},Data.' VarName ',' charplot_0 ','];
+                eval(['nbcomponent2=size(Data.' VarName ',2);']);
+                eval(['nbcomponent1=size(Data.' VarName ',1);']);
                 if numel(coord_x{icell})==2
                     coord_x{icell}=linspace(coord_x{icell}(1),coord_x{icell}(2),nbcomponent1);
@@ -521,13 +530,13 @@
     end
     title_str='';
-    if isfield(data,'filename')
-       [Path, title_str, ext]=fileparts(data.filename);
+    if isfield(Data,'filename')
+       [Path, title_str, ext]=fileparts(Data.filename);
        title_str=[title_str ext];
     end
-    if isfield(data,'Action')&&isfield(data.Action,'ActionName')
+    if isfield(Data,'Action')&&isfield(Data.Action,'ActionName')
         if ~isequal(title_str,'')
             title_str=[title_str ', '];
         end
-        title_str=[title_str data.Action.ActionName];
+        title_str=[title_str Data.Action.ActionName];
     end
     htitle=title(title_str);
@@ -587,6 +596,6 @@
     if isfield(CellInfo{icell},'VarIndex_histo')% case of histogram plot
         TextDisplay=1;
-        VarName=data.ListVarName{CellInfo{icell}.CoordIndex};
-        pdf_val=data.(data.ListVarName{CellInfo{icell}.VarIndex_histo});
+        VarName=Data.ListVarName{CellInfo{icell}.CoordIndex};
+        pdf_val=Data.(Data.ListVarName{CellInfo{icell}.VarIndex_histo});
         x=coord_x{icell};
         if isrow(x)
@@ -610,5 +619,5 @@
     end
 end
-if TextDisplay;
+if TextDisplay
     disp(TableData);
     PlotParamOut.TableDisplay=TableData;
Index: /trunk/src/proj_field.m
===================================================================
--- /trunk/src/proj_field.m	(revision 1076)
+++ /trunk/src/proj_field.m	(revision 1077)
@@ -719,11 +719,11 @@
                     ProjData.VarAttribute{nbvar+ivar}=FieldData.VarAttribute{VarIndex(ivar)};%reproduce var attribute
                     if isfield(ProjData.VarAttribute{nbvar+ivar},'Role')
-                        if  strcmp(ProjData.VarAttribute{nbvar+ivar}.Role,'vector_x');
+                        if  strcmp(ProjData.VarAttribute{nbvar+ivar}.Role,'vector_x')
                             ivar_U=nbvar+ivar;
-                        elseif strcmp(ProjData.VarAttribute{nbvar+ivar}.Role,'vector_y');
+                        elseif strcmp(ProjData.VarAttribute{nbvar+ivar}.Role,'vector_y')
                             ivar_V=nbvar+ivar;
                         end
                     end
-                    ProjData.VarAttribute{ivar+nbvar}.Role='discrete';% will promote plots of the profiles with continuoval(['us lines
+                    ProjData.VarAttribute{ivar+nbvar}.Role='discrete';% will promote plots of the profiles as a  set of individual dots
                 end
             elseif isequal(ProjMode,'interp_lin')  %filtering %linear interpolation:
@@ -756,7 +756,7 @@
                     ProjData.VarDimName=[ProjData.VarDimName {XName}];
                     if isfield(VarAttribute{ivar},'Role')
-                        if  strcmp(VarAttribute{ivar}.Role,'vector_x');
+                        if  strcmp(VarAttribute{ivar}.Role,'vector_x')
                             ivar_U=ivar+nbvar;
-                        elseif strcmp(VarAttribute{ivar}.Role,'vector_y');
+                        elseif strcmp(VarAttribute{ivar}.Role,'vector_y')
                             ivar_V=ivar+nbvar;
                         end
@@ -787,7 +787,7 @@
                     ProjData.VarDimName=[ProjData.VarDimName {'X'}];
                     if isfield(VarAttribute{ivar},'Role')
-                        if  strcmp(VarAttribute{ivar}.Role,'vector_x');
+                        if  strcmp(VarAttribute{ivar}.Role,'vector_x')
                             ivar_U=ivar+nbvar;
-                        elseif strcmp(VarAttribute{ivar}.Role,'vector_y');
+                        elseif strcmp(VarAttribute{ivar}.Role,'vector_y')
                             ivar_V=ivar+nbvar;
                         end
@@ -813,5 +813,5 @@
                 AY=FieldData.(AYName);% set of y positions
                 AZ=FieldData.(AZName);% set of z positions
-                 AName=FieldData.ListVarName{VarIndex(1)};
+                AName=FieldData.ListVarName{VarIndex(1)};
                 npxy=size(FieldData.(AName));
                 npz=npxy(1);
@@ -820,23 +820,23 @@
                 AXI=linspace(AX(1),AX(end), npx);%set of  x  positions for the interpolated input data
                 AYI=linspace(AY(1),AY(end), npy);%set of  x  positions for the interpolated input data
-                 AZI=linspace(AZ(1),AZ(end), npy);%set of  x  positions for the interpolated input data
+                AZI=linspace(AZ(1),AZ(end), npy);%set of  x  positions for the interpolated input data
                 for ivar=VarIndex
                     VarName=FieldData.ListVarName{ivar};
                     FieldData.(VarName)=interp3(FieldData.(AXName),FieldData.(AYName),FieldData.(AZName),FieldData.(VarName),AXI,AYI,AZI);
-
-%                     vec_A=reshape(squeeze(FieldData.(FieldData.ListVarName{ivar})),npx*npy,nbcolor); %put the original image in colum
-%                     if nbcolor==1
-%                         vec_B(ind_in)=vec_A(ICOMB);
-%                         vec_B(ind_out)=zeros(size(ind_out));
-%                         A_out=reshape(vec_B,npY,npX);
-%                         ProjData.(FieldData.ListVarName{ivar}) =sum(A_out,1)/npY;
-%                     elseif nbcolor==3
-%                         vec_B(ind_in,1:3)=vec_A(ICOMB,:);
-%                         vec_B(ind_out,1)=zeros(size(ind_out));
-%                         vec_B(ind_out,2)=zeros(size(ind_out));
-%                         vec_B(ind_out,3)=zeros(size(ind_out));
-%                         A_out=reshape(vec_B,npY,npX,nbcolor);
-%                         ProjData.(FieldData.ListVarName{ivar})=squeeze(sum(A_out,1)/npY);
-%                     end
+                    
+                    %                     vec_A=reshape(squeeze(FieldData.(FieldData.ListVarName{ivar})),npx*npy,nbcolor); %put the original image in colum
+                    %                     if nbcolor==1
+                    %                         vec_B(ind_in)=vec_A(ICOMB);
+                    %                         vec_B(ind_out)=zeros(size(ind_out));
+                    %                         A_out=reshape(vec_B,npY,npX);
+                    %                         ProjData.(FieldData.ListVarName{ivar}) =sum(A_out,1)/npY;
+                    %                     elseif nbcolor==3
+                    %                         vec_B(ind_in,1:3)=vec_A(ICOMB,:);
+                    %                         vec_B(ind_out,1)=zeros(size(ind_out));
+                    %                         vec_B(ind_out,2)=zeros(size(ind_out));
+                    %                         vec_B(ind_out,3)=zeros(size(ind_out));
+                    %                         A_out=reshape(vec_B,npY,npX,nbcolor);
+                    %                         ProjData.(FieldData.ListVarName{ivar})=squeeze(sum(A_out,1)/npY);
+                    %                     end
                     ProjData.ListVarName=[ProjData.ListVarName FieldData.ListVarName{ivar}];
                     ProjData.VarDimName=[ProjData.VarDimName {AXName}];%to generalize with the initial name of the x coordinate
@@ -941,7 +941,19 @@
                     ProjData.ListVarName=[ProjData.ListVarName FieldData.ListVarName{ivar}];
                     ProjData.VarDimName=[ProjData.VarDimName {AXName}];%to generalize with the initial name of the x coordinate
-                    nbvar=nbvar+1;
-                    ProjData.VarAttribute{nbvar}.Role='coord_y';% for plot with continuous line
-                end
+                    nbvar_proj=numel(ProjData.ListVarName);
+                    if isfield(FieldData.VarAttribute{ivar},'Role')
+                        if  strcmp(FieldData.VarAttribute{ivar}.Role,'vector_x')
+                            ivar_U=nbvar_proj;
+                        elseif strcmp(FieldData.VarAttribute{ivar}.Role,'vector_y')
+                            ivar_V=nbvar_proj;
+                        end
+                    end
+                    if isequal(ProjMode,'projection')
+                        ProjData.VarAttribute{nbvar_proj}.Role='discrete';
+                    else
+                        ProjData.VarAttribute{nbvar_proj}.Role='coord_y';
+                    end
+                end
+                
                 if nbcolor==3
                     ProjData.VarDimName{end}={AXName,'rgb'};
@@ -950,9 +962,10 @@
             
     end
-if ~isempty(ivar_U) && ~isempty(ivar_V)
-    vector_x =ProjData.(ProjData.ListVarName{ivar_U});
-    ProjData.(ProjData.ListVarName{ivar_U}) =cos(theta)*vector_x+sin(theta)*ProjData.(ProjData.ListVarName{ivar_V});
-    ProjData.(ProjData.ListVarName{ivar_V}) =-sin(theta)*vector_x+cos(theta)*ProjData.(ProjData.ListVarName{ivar_V});
-end
+    % for vector fields, take the components longitudinal and tranverse to the projection line
+    if ~isempty(ivar_U) && ~isempty(ivar_V)
+        vector_x =ProjData.(ProjData.ListVarName{ivar_U});
+        ProjData.(ProjData.ListVarName{ivar_U}) =cos(theta)*vector_x+sin(theta)*ProjData.(ProjData.ListVarName{ivar_V});
+        ProjData.(ProjData.ListVarName{ivar_V}) =-sin(theta)*vector_x+cos(theta)*ProjData.(ProjData.ListVarName{ivar_V});
+    end
 end
 
@@ -1175,5 +1188,5 @@
         AYName='coord_y';
         AXName='coord_x';
-        if strcmp(ObjectData.ProjMode,'projection')||strcmp(ObjectData.Type,'plane')
+        if strcmp(ObjectData.ProjMode,'projection')%||strcmp(ObjectData.Type,'plane')
             ProjData.coord_y=[FieldData.YMin FieldData.YMax];%note that if projection is done on a grid, the Min and Max along each direction must have been defined
             ProjData.coord_x=[FieldData.XMin FieldData.XMax];
Index: /trunk/src/series/turb_stat.m
===================================================================
--- /trunk/src/series/turb_stat.m	(revision 1076)
+++ /trunk/src/series/turb_stat.m	(revision 1077)
@@ -194,4 +194,5 @@
 DataOut.Curl2Mean=0;
 DataOut.Div2Mean=0;
+DataOut.KEflux=0;
 U2Mean=0;
 V2Mean=0;
@@ -231,4 +232,5 @@
     DataOut.UMean=DataOut.UMean+Field.U; %increment the sum
     DataOut.VMean=DataOut.VMean+Field.V; %increment the sum
+    
     U2Mean=U2Mean+(Field.U).*(Field.U); %increment the U squared sum
     V2Mean=V2Mean+(Field.V).*(Field.V); %increment the V squared sum
Index: /trunk/src/transform_field/ima2concentration.m
===================================================================
--- /trunk/src/transform_field/ima2concentration.m	(revision 1076)
+++ /trunk/src/transform_field/ima2concentration.m	(revision 1077)
@@ -32,4 +32,12 @@
 cpath=which('uvmat');
 addpath(fullfile(fileparts(cpath),'transform_field'))% define path for phys_polar.m
+
+%% rescale the image
+[nby,nbx]=size(DataIn.A);
+x=linspace(DataIn.Coord_x(1),DataIn.Coord_x(2),nbx)-nbx/2;
+y=linspace(DataIn.Coord_y(1),DataIn.Coord_y(2),nby)-nby/2;
+[X,Y]=meshgrid(x,y);
+coeff_quad=0.15*4/(nbx*nbx);% image luminosity reduced by 10% at the edge
+DataIn.A=double(DataIn.A).*(1+coeff_quad*(X.*X+Y.*Y));
 
 %% Transform images to polar coordinates with origin at the light source position 
Index: /trunk/src/uvmat.m
===================================================================
--- /trunk/src/uvmat.m	(revision 1076)
+++ /trunk/src/uvmat.m	(revision 1077)
@@ -1415,8 +1415,9 @@
 end
 
-prompt = {'offset luminosity value in the absence of illumination';'smoothing width for the reference line (in pixels)'};
+prompt = {'offset luminosity value in the absence of illumination';'smoothing width for the reference line (in pixels)';...
+    'LIF Temperature Coeff1';'LIF Temperature Coeff2';'LIF Temperature Coeff3'};
     dlg_title = 'set the parameters for LIF';
-    num_lines= 2;
-    def     = { num2str(BlackOffset);num2str(RefLineWidth)};
+    num_lines= 5;
+    def     = { num2str(BlackOffset);num2str(RefLineWidth);'0';'0';'0'};
     answer = inputdlg(prompt,dlg_title,num_lines,def);
 if isempty(answer) 
@@ -1425,4 +1426,5 @@
     XmlData.LIFCalib.BlackOffset=str2double(answer{1}) ;% image value for black background, to be determined by taking images with a cover on the objective lens
     XmlData.LIFCalib.RefLineWidth=str2double(answer{2}) ;% smoothing width used for the reference line
+    XmlData.LIFCalib.TLIFCoeff=[str2double(answer{3}) str2double(answer{4}) str2double(answer{5})];
 end
 
@@ -1443,4 +1445,12 @@
 XmlData.LIFCalib.Ray2Coord=LineData{2}.Coord;
 XmlData.LIFCalib.RefLineCoord=LineData{3}.Coord;
+
+%% rescale the image
+[nby,nbx]=size(UvData.Field.A);
+x=linspace(UvData.Field.Coord_x(1),UvData.Field.Coord_x(2),nbx)-nbx/2;
+y=linspace(UvData.Field.Coord_y(1),UvData.Field.Coord_y(2),nby)-nby/2;
+[X,Y]=meshgrid(x,y);
+coeff_quad=0.15*4/(nbx*nbx);% image luminosity reduced by 10% at the edge
+UvData.Field.A=double(UvData.Field.A).*(1+coeff_quad*(X.*X+Y.*Y));
 
 %% display the current image in polar axes with origin at the  illumination source
