Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/glenco/SLsimLib
Browse files Browse the repository at this point in the history
  • Loading branch information
rbmetcalf committed Feb 6, 2020
2 parents 295495a + 24d27d0 commit afe533d
Show file tree
Hide file tree
Showing 103 changed files with 15,372 additions and 6,761 deletions.
166 changes: 58 additions & 108 deletions AnalyticNSIE/base_analens.cpp

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions AnalyticNSIE/elliptic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
double p2 = x[0]*x[0]/ap/ap/ap/ap + x[1]*x[1]/bp/bp/bp/bp; // actually the inverse of equation (5) in Schramm 1990

//return m*isohalo->kappa(x)/(ap*ap*ap*bp*p2);
PosType alpha[2]={0,0},tmp[2] = {m*(isohalo->get_Rsize()),0};
PosType alpha[2]={0,0},tmp[2] = {m*(isohalo->getRsize()),0};
KappaType kappa=0,gamma[2]={0,0},phi;

isohalo->force_halo(alpha,&kappa,gamma,&phi,tmp);
Expand All @@ -34,8 +34,8 @@ PosType Elliptic::DALPHAYDM::operator()(PosType m){
double ap = m*m*a2 + lambda,bp = m*m*b2 + lambda;
double p2 = x[0]*x[0]/ap/ap/ap/ap + x[1]*x[1]/bp/bp/bp/bp; // actually the inverse of equation (5) in Schramm 1990

PosType alpha[2]={0,0},tmp[2] = {m*(isohalo->get_Rsize()),0};
KappaType kappa=0,gamma[2]={0,0},phi;
PosType alpha[2]={0,0},tmp[2] = {m*(isohalo->getRsize()),0};
KappaType kappa=0,gamma[2]={0,0},phi=0;

isohalo->force_halo(alpha,&kappa,gamma,&phi,tmp); // here we need an elliptical kappa but in forcehalo the only elliptical kappas implemented are based on Ansatz I+II

Expand Down Expand Up @@ -67,12 +67,12 @@ void Elliptic::alpha(PosType x[],PosType alpha[]){
std::cout << "mo = " << mo << "a2 = " << a2 << "b2 = " << b2 << "x1 " << xtmp[0] << "x2 " << xtmp[1] << std::endl;

Elliptic::DALPHAXDM funcX(lambda,a2,b2,xtmp,isohalo);
//alpha[0] = -8*a*b*xtmp[0]*Utilities::nintegrate<Elliptic::DALPHAXDM,PosType>(funcX,0,MIN(mo,1.0),1.0e-6)/pi;
alpha[0] = -8*a*b*xtmp[0]*Utilities::nintegrate<Elliptic::DALPHAXDM,PosType>(funcX,0,MIN(mo,1.0),1.0e-6)/pi;
//alpha[0] = -8*a*b*xtmp[0]*Utilities::nintegrate<Elliptic::DALPHAXDM,PosType>(funcX,0,MIN(mo,1.0),1.0e-6)/PI;
alpha[0] = -8*a*b*xtmp[0]*Utilities::nintegrate<Elliptic::DALPHAXDM,PosType>(funcX,0,MIN(mo,1.0),1.0e-6)/PI;


Elliptic::DALPHAYDM funcY(lambda,a2,b2,xtmp,isohalo);
alpha[1] = -8*a*b*xtmp[1]*Utilities::nintegrate<Elliptic::DALPHAYDM,PosType>(funcY,0,MIN(mo,1.0),1.0e-6)/pi;
alpha[1] = -8*a*b*xtmp[1]*Utilities::nintegrate<Elliptic::DALPHAYDM,PosType>(funcY,0,MIN(mo,1.0),1.0e-6)/PI;

//std::cout << "alpha = " << alpha[0] << " " << alpha[1] << std::endl;

Expand Down
1 change: 1 addition & 0 deletions AnalyticNSIE/hernquist_lens.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
* Author: D. Leier
*/

#include "image_processing.h"
#include "lens_halos.h"


Expand Down
10 changes: 5 additions & 5 deletions AnalyticNSIE/jaffe_lens.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

PosType LensHaloJaffe::gfunction(PosType x) const{
PosType ans;
ans=pi;
ans=PI;
if(x==0) x=1e-5;
if(x==1.0) return (ans-2.)*x;
if(x<1.0){ ans -= 2.*x*acosh(1./x)/sqrt(1.-x*x) ; return ans*x;}
Expand All @@ -18,7 +18,7 @@ PosType LensHaloJaffe::gfunction(PosType x) const{
PosType LensHaloJaffe::ffunction(PosType x) const{
PosType ans;
if(x==0) x=1e-5;
ans=pi/x;
ans=PI/x;
if(x==1.0){ return ans-(2.+2./3.);}
if(x>1.0){ ans += 2./(1.-x*x)*(1.-(2.-x*x)*acos(1./x)/sqrt(x*x-1.)); return ans;}
if(x<1.0){ ans += 2./(1.-x*x)*(1.-(2.-x*x)*acosh(1./x)/sqrt(1.-x*x)); return ans;}
Expand All @@ -29,7 +29,7 @@ PosType LensHaloJaffe::ffunction(PosType x) const{
PosType LensHaloJaffe::g2function(PosType x) const{
PosType ans;
if(x==0) x=1e-5;
ans=pi/x;
ans=PI/x;
if(x==1.0){ ans -=4./3. ; return ans*x/3.;}
if(x>1.0){ ans += 2./x/x*(-1.0*(2.*x*x*acos(1./x))/sqrt(x*x-1.)+(sqrt(1.-1./x)*sqrt(1.+1./x)*x*(log(x-1.0)+log(1.+x)))/sqrt(x*x-1.)-log(x*x-1.))-(2./(1.-x*x)*(1.-(2.-x*x)*acos(1./x)/sqrt(x*x-1.))); return ans*x/3.;}
if(x<1.0){ ans += 2./x/x*(-(2.*x*x*acosh(1./x))/sqrt(1.-x*x)+(sqrt(-1.+1./x)*sqrt(1.+1./x)*x*(log(1.-x)+log(1.+x)))/sqrt(1.-x*x)-log(1.-x*x))-(2./(1.-x*x)*(1.-(2.-x*x)*acosh(1./x)/sqrt(1.-x*x))); return ans*x/3.;}
Expand All @@ -50,8 +50,8 @@ PosType LensHaloJaffe::bfunction(PosType fx){
if(x==0) x=1e-5;
if(x==1){return -2.1231*fac;} // (x/ffunction(x))*(2.+2./15.)
PosType aux=sqrt(1.-x*x);
if(x<1){ans=x*((-(pi/x/x)+(2.*(((2.-x*x))/(sqrt(-1+1./x)*sqrt(1+1./x) *x*x* aux)+(2*x*acosh(1./x))/aux-(x*(2.-x*x)*acosh(1./x))/pow(aux,3)))/(1.-x*x)+(4.*x*(1.-((2.-x*x)*acosh(1./x))/aux))/(1.-x*x)/(1.-x*x))/(pi/x+(2.*(1.-((2.-x*x)*acosh(1./x))/aux))/(1.-x*x))); return fac*ans;}
if(x>1){ans=(x*(-1.0*(pi/x/x)+(2.*(-(((2.-x*x))/(sqrt(1-1./x/x)*x*x*sqrt(-1.+x*x)))+(x*(2.-x*x)*acos(1./x))/(pow(-1.+x*x,3./2.))+(2.*x*acos(1./x))/sqrt(-1.+x*x)))/(1.-x*x)+(4.*x*(1.-((2.-x*x)*acos(1./x))/sqrt(-1.+x*x)))/(1.-x*x)/(1.-x*x)))/(pi/x+(2.*(1.-((2.-x*x)*acos(1./x))/sqrt(-1.+x*x)))/(1.-x*x)); return fac*ans;}
if(x<1){ans=x*((-(PI/x/x)+(2.*(((2.-x*x))/(sqrt(-1+1./x)*sqrt(1+1./x) *x*x* aux)+(2*x*acosh(1./x))/aux-(x*(2.-x*x)*acosh(1./x))/pow(aux,3)))/(1.-x*x)+(4.*x*(1.-((2.-x*x)*acosh(1./x))/aux))/(1.-x*x)/(1.-x*x))/(PI/x+(2.*(1.-((2.-x*x)*acosh(1./x))/aux))/(1.-x*x))); return fac*ans;}
if(x>1){ans=(x*(-1.0*(PI/x/x)+(2.*(-(((2.-x*x))/(sqrt(1-1./x/x)*x*x*sqrt(-1.+x*x)))+(x*(2.-x*x)*acos(1./x))/(pow(-1.+x*x,3./2.))+(2.*x*acos(1./x))/sqrt(-1.+x*x)))/(1.-x*x)+(4.*x*(1.-((2.-x*x)*acos(1./x))/sqrt(-1.+x*x)))/(1.-x*x)/(1.-x*x)))/(PI/x+(2.*(1.-((2.-x*x)*acos(1./x))/sqrt(-1.+x*x)))/(1.-x*x)); return fac*ans;}
//if(x>1.0){ ans =(x/ffunction(x))*((4.-6.*x*x+2.*pow(x,4)+2.*aux/x*pow(x,5)*acos(1./x))/(aux*x*(1.-x*x)*pow(aux,3))+(4.*x*(1.+((-2.+x*x)*acos(1/x))/aux))/(1.-x*x)/(1.-x*x)) ; return fac*ans;}
// if(x<1.0){ ans = (x/ffunction(x))*(((4.-6.*x*x+2.*pow(x,4)-2.*sqrt(-1+1./x)*pow(x,5)*sqrt((1.+x)/x)*acosh(1./x))/(sqrt(-1+1./x)*x*x*sqrt((1.+x)/x)*sqrt(1.-x*x))+4.*x*(1.+((-2.+x*x)*acosh(1./x))/sqrt(1. -x*x)))/(1. -x*x)/(1. -x*x))
// ; return fac*ans;}
Expand Down
2 changes: 1 addition & 1 deletion AnalyticNSIE/lens_expand.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/** \ingroup FitLensL2
/**
* lens_expand.c
*
* Created on: Feb 22, 2010
Expand Down
6 changes: 3 additions & 3 deletions AnalyticNSIE/nfw_lens.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ void LensHaloNFW::alphaNFW(PosType *alpha,PosType *x,PosType Rtrunc,PosType mass
alpha[0]=alpha[1]=0.0;
return ;
}
b=mass/pow(r,2)/pi/Sigma_crit;
b=mass/pow(r,2)/PI/Sigma_crit;

if(r < Rtrunc){
PosType y;
Expand Down Expand Up @@ -50,7 +50,7 @@ KappaType LensHaloNFW::kappaNFW(PosType *x,PosType Rtrunc,PosType mass,PosType r
y = r/r_scale;
b*= ffunction(y);

return b*mass/(2*pi*pow(r_scale,2)*Sigma_crit);
return b*mass/(2*PI*pow(r_scale,2)*Sigma_crit);
}

/// Shear for and NFW halo. this might have a flaw in it
Expand All @@ -64,7 +64,7 @@ void LensHaloNFW::gammaNFW(KappaType *gamma,PosType *x,PosType Rtrunc,PosType ma
return ;
}

gt=mass/pi/Sigma_crit/pow(r,2);
gt=mass/PI/Sigma_crit/pow(r,2);
if(r<Rtrunc){
PosType y;

Expand Down
20 changes: 10 additions & 10 deletions AnalyticNSIE/nsie.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#include "base_analens.h"
#include <complex>

/** \ingroup DeflectionL2 \ingroup function
/**
* \brief Deflection angle for non-singular isothermal ellipsoid in units of Einstein radii
*/
void alphaNSIE(
Expand Down Expand Up @@ -81,7 +81,7 @@ void alphaNSIE(
return;
}

/**\ingroup DeflectionL2 \ingroup function
/**
* \brief Convergence for non-singular isothermal ellipsoid, units \f$ \frac{r_{einstein}}{units(x)} \f$
* or \f$ \frac{\sigma^2}{\Sigma_{crit}G\, units(xt) } \f$
*/
Expand All @@ -104,7 +104,7 @@ KappaType kappaNSIE(
return 0.5*sqrt(f/(b2+bc*bc));
}

/**\ingroup DeflectionL2 \ingroup function
/**
* \brief Shear for non-singular isothermal ellipsoid, units \f$ \frac{r_{einstein}}{units(x)} \f$
* or \f$ \frac{\sigma^2}{\Sigma_{crit}G\, units(xt) } \f$
* */
Expand Down Expand Up @@ -143,7 +143,7 @@ void gammaNSIE(

return;
}
/** \ingroup function
/**
* \brief Elliptical radius \f$ R^2 = x^2 + f^2 y^2 \f$ of a NonSingular Isothermal Ellipsoid
*/

Expand All @@ -155,10 +155,10 @@ PosType rmaxNSIE(
,PosType rc /// core radius Mpc
){

return sqrt( pow(mass*Grav*lightspeed*lightspeed*f/pi/sigma/sigma + rc,2) - rc*rc );
return sqrt( pow(mass*Grav*lightspeed*lightspeed*f/PI/sigma/sigma + rc,2) - rc*rc );
}

/** \ingroup function
/**
* \brief Elliptical radius \f$ R^2 = x^2 + f^2 y^2 \f$ given f and position angle of model
*/
PosType ellipticRadiusNSIE(
Expand Down Expand Up @@ -206,7 +206,7 @@ namespace Utilities{



/**\ingroup function
/**
*
* Structure that does allow the integration of alphaNSIE in phiNSIE.
*
Expand Down Expand Up @@ -249,7 +249,7 @@ struct alphaForInt {



/**\ingroup function
/**
*
* Compute the potential for the NSIE (in physical Mpc) by integration of alphaNSIE.
*
Expand Down Expand Up @@ -340,12 +340,12 @@ KappaType LensHaloBaseNSIE::phiNSIE(PosType const *xt /// position on the ima
// in order to validate the elliptization of phi.

}

return 0;
}



/**\ingroup function
/**
*
* Quadropole moment of an elliptically truncated NSIE
* Units are unit[mass]*unit[Rsize]^2
Expand Down
8 changes: 4 additions & 4 deletions AnalyticNSIE/powerlaw.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ void alphaPowLaw(PosType *alpha,PosType *x,PosType R,PosType mass,PosType beta,P
alpha[0]=alpha[1]=0.0;
return ;
}
b=mass/pow(r,2)/pi/Sigma_crit;
b=mass/pow(r,2)/PI/Sigma_crit;
if(r<R) b *= pow(r/R,beta+2);

alpha[0]=b*(x[0]-center[0]);
Expand All @@ -36,7 +36,7 @@ KappaType kappaPowLaw(PosType *x,PosType R,PosType mass,PosType beta,PosType *ce
r=sqrt(pow(x[0]-center[0],2) + pow(x[1]-center[1],2));
if(r>R) return 0.0;
if(r < 1.0-20) r=1.0e-20;
return (beta+2)*mass*pow(r/R,beta)/(2*pi*pow(R,2)*Sigma_crit);
return (beta+2)*mass*pow(r/R,beta)/(2*PI*pow(R,2)*Sigma_crit);
}
///
void gammaPowLaw(KappaType *gamma,PosType *x,PosType R,PosType mass,PosType beta
Expand All @@ -48,7 +48,7 @@ void gammaPowLaw(KappaType *gamma,PosType *x,PosType R,PosType mass,PosType beta
gamma[0]=gamma[1]=0.0;
return ;
}
gt=mass/pi/Sigma_crit/pow(r,2);
gt=mass/PI/Sigma_crit/pow(r,2);
if(r<R) gt *= -beta*pow(r/R,beta+2)/2;

gamma[0]=-gt*(pow(x[0]-center[0],2)-pow(x[1]-center[1],2))/r/r;
Expand All @@ -63,7 +63,7 @@ KappaType phiPowLaw(PosType *x,PosType R,PosType mass,PosType beta

r=sqrt(pow(x[0]-center[0],2) + pow(x[1]-center[1],2));

b=mass/pi/Sigma_crit;
b=mass/PI/Sigma_crit;
if(r<=R) return b*pow(r/R,beta+2);
return b*(log(r/R) + 1);
}
Expand Down
44 changes: 22 additions & 22 deletions AnalyticNSIE/randomize_lens.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ void LensHaloAnaNSIE::RandomizeHost(long *seed,bool tables){
// aligned hexopole and octopole
if(perturb_Nmodes > 0){
for(n=3;n<6;++n) AlignedRandomlyDistortLens(seed
,pa+3*pi*gasdev(seed)/180,n);
,pa+3*PI*gasdev(seed)/180,n);
}

delete[] axisTable;
Expand Down Expand Up @@ -110,7 +110,7 @@ void LensHaloAnaNSIE::RandomlyDistortLens(long *seed, int Nmodes){
// lognormal shear and kappa distribution
perturb_modes[0]=0.015*pow(10,gasdev(seed)*perturb_rms[0]);
tmp=0.015*pow(10,gasdev(seed)*perturb_rms[1]);
theta=2*pi*ran2(seed);
theta=2*PI*ran2(seed);
perturb_modes[1] = tmp*cos(theta);
perturb_modes[2] = tmp*sin(theta);

Expand Down Expand Up @@ -202,12 +202,12 @@ void LensHaloAnaNSIE::RandomizeSubstructure2(PosType rangeInRei,long *seed){

if(Einstein_ro > 0.0){
Rm = Einstein_ro*rangeInRei + sub_Rsize*pow(scale,1./3.)
+ pow(2*sub_Mmax*scale*Einstein_ro/pi/Sigma_crit/sheartol,1./3.);
+ pow(2*sub_Mmax*scale*Einstein_ro/PI/Sigma_crit/sheartol,1./3.);
Einstein_ro_save = Einstein_ro;
}

if(!(substruct_implanted) && ndensity > 0){
NsubMax=(unsigned long)(ndensity*pi*Rm*Rm + 5*sqrt(ndensity*pi*Rm*Rm) );
NsubMax=(unsigned long)(ndensity*PI*Rm*Rm + 5*sqrt(ndensity*PI*Rm*Rm) );
if(NsubMax > 0){
sub_x=Utilities::PosTypeMatrix(NsubMax,2);
switch(main_sub_type){
Expand All @@ -229,9 +229,9 @@ void LensHaloAnaNSIE::RandomizeSubstructure2(PosType rangeInRei,long *seed){
substruct_implanted=true;
}
//std::cout << "Rm/re = %e\n",Rm/Einstein_ro);
//for(i=0;i<12;++i) std::cout << "%f %f\n",poidev(ndensity*pi*Rm*Rm,seed),ndensity*pi*Rm*Rm);
//for(i=0;i<12;++i) std::cout << "%f %f\n",poidev(ndensity*PI*Rm*Rm,seed),ndensity*PI*Rm*Rm);

unsigned int Nsub=(int)(poidev(ndensity*pi*Rm*Rm,seed));
unsigned int Nsub=(int)(poidev(ndensity*PI*Rm*Rm,seed));
Nsub = (NsubMax > Nsub) ? Nsub : NsubMax ;

//std::cout << "scale = %e\n",scale);
Expand All @@ -253,29 +253,29 @@ void LensHaloAnaNSIE::RandomizeSubstructure2(PosType rangeInRei,long *seed){
}while(subs[k].get_mass() < sub_Mmin); // not sure why this is necessary

// average density of a substructure does not scale with host
subs[k].set_Rsize(sub_Rsize*pow(scale,1./3.)
subs[k].set_RsizeRmax(sub_Rsize*pow(scale,1./3.)
*pow(subs[k].get_mass()/sub_Mmax/scale,1/3.));

subs[k].set_slope(sub_beta);

subs[k].set_rscale(0.1*subs[k].get_Rsize());
subs[k].set_rscale(0.1*subs[k].getRsize());

// maximum radius for a substructure of this mass
rmax = (Einstein_ro_save*rangeInRei + subs[k].get_Rsize()
+ pow(2*subs[k].get_mass()*Einstein_ro_save/pi/Sigma_crit/sheartol,1./3.) );
rmax = (Einstein_ro_save*rangeInRei + subs[k].getRsize()
+ pow(2*subs[k].get_mass()*Einstein_ro_save/PI/Sigma_crit/sheartol,1./3.) );

//std::cout << "RcutSubstruct[%i] = %e\n",k,RcutSubstruct[k]);
//std::cout << "%e %e %e Rm=%e\n",r/rmax,r,rmax,Rm);
if( r < rmax){
theta=2*pi*ran2(seed);
theta=2*PI*ran2(seed);
sub_x[k][0]=r*cos(theta);
sub_x[k][1]=r*sin(theta);
assert(k<NsubMax);

rav[0] += sub_x[k][0];
rav[1] += sub_x[k][1];
r2av += r*r;
area_av += pow(subs[k].get_Rsize(),2);
area_av += pow(subs[k].getRsize(),2);
++k;
}
}
Expand Down Expand Up @@ -334,12 +334,12 @@ void LensHaloAnaNSIE::RandomizeSubstructure3(PosType rangeInRei,long *seed){

Rm = Einstein_ro_save*rangeInRei;
Rm += sub_Rsize
+ pow(2*sub_Mmax*Einstein_ro_save/pi/Sigma_crit/sheartol,1./3.);
+ pow(2*sub_Mmax*Einstein_ro_save/PI/Sigma_crit/sheartol,1./3.);

assert(Rm > 0.0);

if(!substruct_implanted){
NsubMax=(unsigned long)(sub_Ndensity*pi*Rm*Rm*(1+5/sqrt(sub_Ndensity*pi*Rm*Rm)) );
NsubMax=(unsigned long)(sub_Ndensity*PI*Rm*Rm*(1+5/sqrt(sub_Ndensity*PI*Rm*Rm)) );
sub_x=Utilities::PosTypeMatrix(NsubMax,2);
switch(main_sub_type){
case pointmass:
Expand All @@ -359,9 +359,9 @@ void LensHaloAnaNSIE::RandomizeSubstructure3(PosType rangeInRei,long *seed){
sub_substructures = new IndexType[NsubMax];
}
//std::cout << "Rm/re = %e\n",Rm/Einstein_ro);
//for(i=0;i<12;++i) std::cout << "%f %f\n",poidev(ndensity*pi*Rm*Rm,seed),ndensity*pi*Rm*Rm);
//for(i=0;i<12;++i) std::cout << "%f %f\n",poidev(ndensity*PI*Rm*Rm,seed),ndensity*PI*Rm*Rm);

unsigned int Nsub=(int)(poidev(sub_Ndensity*pi*Rm*Rm,seed));
unsigned int Nsub=(int)(poidev(sub_Ndensity*PI*Rm*Rm,seed));

assert(Nsub < NsubMax);

Expand All @@ -384,24 +384,24 @@ void LensHaloAnaNSIE::RandomizeSubstructure3(PosType rangeInRei,long *seed){
}while(subs[k].get_mass() < sub_Mmin); // not sure why this is necessary

// average density of a substructure does not scale with host
subs[k].set_Rsize(sub_Rsize*pow(subs[k].get_mass()/sub_Mmax,1/3.));
subs[k].set_RsizeRmax(sub_Rsize*pow(subs[k].get_mass()/sub_Mmax,1/3.));

// maximum radius for a substructure of this mass
rmax = (Einstein_ro_save*rangeInRei + subs[k].get_Rsize()
+ pow(2*subs[k].get_mass()*Einstein_ro_save/pi/Sigma_crit/sheartol,1./3.) );
rmax = (Einstein_ro_save*rangeInRei + subs[k].getRsize()
+ pow(2*subs[k].get_mass()*Einstein_ro_save/PI/Sigma_crit/sheartol,1./3.) );

//std::cout << "RcutSubstruct[%i] = %e\n",k,RcutSubstruct[k]);
//std::cout << "%e %e %e Rm=%e\n",r/rmax,r,rmax,Rm);
if( r < rmax){
theta=2*pi*ran2(seed);
theta=2*PI*ran2(seed);
sub_x[k][0]=r*cos(theta);
sub_x[k][1]=r*sin(theta);
assert(k<NsubMax);

rav[0] += sub_x[k][0];
rav[1] += sub_x[k][1];
r2av += r*r;
area_av += pow(subs[k].get_Rsize(),2);
area_av += pow(subs[k].getRsize(),2);
++k;
}
}
Expand Down Expand Up @@ -456,7 +456,7 @@ PosType LensHaloAnaNSIE::FractionWithinRe(PosType rangeInRei){
PosType B;

B = (sub_Rsize/pow(sub_Mmax,1./3.)
+ pow(2*Einstein_ro/pi/Sigma_crit/1.e-3,1./3.) );
+ pow(2*Einstein_ro/PI/Sigma_crit/1.e-3,1./3.) );

return 1+(1+sub_alpha)*(
2*rangeInRei*Einstein_ro*B*(
Expand Down
Loading

0 comments on commit afe533d

Please sign in to comment.