legendre2f_yp

PURPOSE ^

LUKE: Restore the distribution function with its projection on the Legendre polynomial basis ( for data compression)

SYNOPSIS ^

function [XXf0] = legendre2f_yp(dkeparam,momentumDKE,XXf0_interp)

DESCRIPTION ^

 LUKE: Restore the distribution function with its projection on the Legendre polynomial basis ( for data compression)

 Restore the distribution function with its projection on the Legendre polynomial basis ( for data compression)

   INPUTS:
   
       - dkeparam: LUKE parameter structure
       - momentumDKE: LUKE grid structure 
       - XXf0_interp: distribution unction projected on the Legendre polynomials basis. May be an array cell 
       
   OUTPUTS:
   
       - XXf0: initial distribution function.

 by Yves Peysson(CEA/IRFM, yves.peysson@cea.fr) and Joan Decker (EPFL/CRPP, joan.decker@epfl.ch)

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SUBFUNCTIONS ^

SOURCE CODE ^

0001 function [XXf0] = legendre2f_yp(dkeparam,momentumDKE,XXf0_interp)
0002 % LUKE: Restore the distribution function with its projection on the Legendre polynomial basis ( for data compression)
0003 %
0004 % Restore the distribution function with its projection on the Legendre polynomial basis ( for data compression)
0005 %
0006 %   INPUTS:
0007 %
0008 %       - dkeparam: LUKE parameter structure
0009 %       - momentumDKE: LUKE grid structure
0010 %       - XXf0_interp: distribution unction projected on the Legendre polynomials basis. May be an array cell
0011 %
0012 %   OUTPUTS:
0013 %
0014 %       - XXf0: initial distribution function.
0015 %
0016 % by Yves Peysson(CEA/IRFM, yves.peysson@cea.fr) and Joan Decker (EPFL/CRPP, joan.decker@epfl.ch)
0017 %
0018 n_pol = dkeparam.n_gauleg;%Necessary for accurate reconstruction at ksi = -1
0019 [x_leg] = gauleg_dke_yp(dkeparam.n_gauleg,dkeparam.epsi_gauleg);%Gauss-Legendre abscissa and weigth calculations between -1 and + 1
0020 [Pm,cL] = leg_dke_yp(x_leg(:)',n_pol);%Legendre polynomial calculation
0021 %
0022 if iscell(XXf0_interp)
0023     for it = 1:length(XXf0_interp),
0024         XXf0{it} = restoref_legendre_yp(Pm,x_leg,cL,dkeparam.method,momentumDKE.mhu,XXf0_interp{it});
0025     end
0026 else
0027     XXf0 = restoref_legendre_yp(Pm,x_leg,cL,dkeparam.method,momentumDKE.mhu,XXf0_interp);
0028 end
0029 %
0030 end
0031 
0032 function XXf0 = restoref_legendre_yp(Pm,x_leg,cL,method,mhu,XXf0_leg)
0033     %
0034     XXf0 = zeros(size(XXf0_leg,1),length(mhu),size(XXf0_leg,3));
0035     %
0036     for ir = 1:size(XXf0_leg,3),
0037         Xf0_i1 = (Pm.'*(XXf0_leg(:,:,ir).*(ones(size(XXf0_leg(:,:,ir),1),1)*cL.')).').';%Distribution function on the Legendre polynomials pitch-angle grid back calculated
0038         XXf0(:,:,ir) = interp1(x_leg(:),Xf0_i1.',mhu(:),method).';%Distribution function on initial pitch-angle grid back calculated from Legendre polynomial fit
0039     end
0040     %
0041 end
0042

Community support and wiki are available on Redmine. Last update: 18-Apr-2019.