Skip to content

Commit afe533d

Browse files
committed
Merge branch 'master' of https://github.com/glenco/SLsimLib
2 parents 295495a + 24d27d0 commit afe533d

File tree

103 files changed

+15372
-6761
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

103 files changed

+15372
-6761
lines changed

AnalyticNSIE/base_analens.cpp

Lines changed: 58 additions & 108 deletions
Large diffs are not rendered by default.

AnalyticNSIE/elliptic.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
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
1818

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

2323
isohalo->force_halo(alpha,&kappa,gamma,&phi,tmp);
@@ -34,8 +34,8 @@ PosType Elliptic::DALPHAYDM::operator()(PosType m){
3434
double ap = m*m*a2 + lambda,bp = m*m*b2 + lambda;
3535
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
3636

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

4040
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
4141

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

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

7373

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

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

AnalyticNSIE/hernquist_lens.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
* Author: D. Leier
44
*/
55

6+
#include "image_processing.h"
67
#include "lens_halos.h"
78

89

AnalyticNSIE/jaffe_lens.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
PosType LensHaloJaffe::gfunction(PosType x) const{
99
PosType ans;
10-
ans=pi;
10+
ans=PI;
1111
if(x==0) x=1e-5;
1212
if(x==1.0) return (ans-2.)*x;
1313
if(x<1.0){ ans -= 2.*x*acosh(1./x)/sqrt(1.-x*x) ; return ans*x;}
@@ -18,7 +18,7 @@ PosType LensHaloJaffe::gfunction(PosType x) const{
1818
PosType LensHaloJaffe::ffunction(PosType x) const{
1919
PosType ans;
2020
if(x==0) x=1e-5;
21-
ans=pi/x;
21+
ans=PI/x;
2222
if(x==1.0){ return ans-(2.+2./3.);}
2323
if(x>1.0){ ans += 2./(1.-x*x)*(1.-(2.-x*x)*acos(1./x)/sqrt(x*x-1.)); return ans;}
2424
if(x<1.0){ ans += 2./(1.-x*x)*(1.-(2.-x*x)*acosh(1./x)/sqrt(1.-x*x)); return ans;}
@@ -29,7 +29,7 @@ PosType LensHaloJaffe::ffunction(PosType x) const{
2929
PosType LensHaloJaffe::g2function(PosType x) const{
3030
PosType ans;
3131
if(x==0) x=1e-5;
32-
ans=pi/x;
32+
ans=PI/x;
3333
if(x==1.0){ ans -=4./3. ; return ans*x/3.;}
3434
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.;}
3535
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.;}
@@ -50,8 +50,8 @@ PosType LensHaloJaffe::bfunction(PosType fx){
5050
if(x==0) x=1e-5;
5151
if(x==1){return -2.1231*fac;} // (x/ffunction(x))*(2.+2./15.)
5252
PosType aux=sqrt(1.-x*x);
53-
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;}
54-
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;}
53+
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;}
54+
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;}
5555
//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;}
5656
// 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))
5757
// ; return fac*ans;}

AnalyticNSIE/lens_expand.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/** \ingroup FitLensL2
1+
/**
22
* lens_expand.c
33
*
44
* Created on: Feb 22, 2010

AnalyticNSIE/nfw_lens.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ void LensHaloNFW::alphaNFW(PosType *alpha,PosType *x,PosType Rtrunc,PosType mass
1515
alpha[0]=alpha[1]=0.0;
1616
return ;
1717
}
18-
b=mass/pow(r,2)/pi/Sigma_crit;
18+
b=mass/pow(r,2)/PI/Sigma_crit;
1919

2020
if(r < Rtrunc){
2121
PosType y;
@@ -50,7 +50,7 @@ KappaType LensHaloNFW::kappaNFW(PosType *x,PosType Rtrunc,PosType mass,PosType r
5050
y = r/r_scale;
5151
b*= ffunction(y);
5252

53-
return b*mass/(2*pi*pow(r_scale,2)*Sigma_crit);
53+
return b*mass/(2*PI*pow(r_scale,2)*Sigma_crit);
5454
}
5555

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

67-
gt=mass/pi/Sigma_crit/pow(r,2);
67+
gt=mass/PI/Sigma_crit/pow(r,2);
6868
if(r<Rtrunc){
6969
PosType y;
7070

AnalyticNSIE/nsie.cpp

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
#include "base_analens.h"
99
#include <complex>
1010

11-
/** \ingroup DeflectionL2 \ingroup function
11+
/**
1212
* \brief Deflection angle for non-singular isothermal ellipsoid in units of Einstein radii
1313
*/
1414
void alphaNSIE(
@@ -81,7 +81,7 @@ void alphaNSIE(
8181
return;
8282
}
8383

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

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

144144
return;
145145
}
146-
/** \ingroup function
146+
/**
147147
* \brief Elliptical radius \f$ R^2 = x^2 + f^2 y^2 \f$ of a NonSingular Isothermal Ellipsoid
148148
*/
149149

@@ -155,10 +155,10 @@ PosType rmaxNSIE(
155155
,PosType rc /// core radius Mpc
156156
){
157157

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

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

207207

208208

209-
/**\ingroup function
209+
/**
210210
*
211211
* Structure that does allow the integration of alphaNSIE in phiNSIE.
212212
*
@@ -249,7 +249,7 @@ struct alphaForInt {
249249

250250

251251

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

342342
}
343-
343+
return 0;
344344
}
345345

346346

347347

348-
/**\ingroup function
348+
/**
349349
*
350350
* Quadropole moment of an elliptically truncated NSIE
351351
* Units are unit[mass]*unit[Rsize]^2

AnalyticNSIE/powerlaw.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ void alphaPowLaw(PosType *alpha,PosType *x,PosType R,PosType mass,PosType beta,P
2121
alpha[0]=alpha[1]=0.0;
2222
return ;
2323
}
24-
b=mass/pow(r,2)/pi/Sigma_crit;
24+
b=mass/pow(r,2)/PI/Sigma_crit;
2525
if(r<R) b *= pow(r/R,beta+2);
2626

2727
alpha[0]=b*(x[0]-center[0]);
@@ -36,7 +36,7 @@ KappaType kappaPowLaw(PosType *x,PosType R,PosType mass,PosType beta,PosType *ce
3636
r=sqrt(pow(x[0]-center[0],2) + pow(x[1]-center[1],2));
3737
if(r>R) return 0.0;
3838
if(r < 1.0-20) r=1.0e-20;
39-
return (beta+2)*mass*pow(r/R,beta)/(2*pi*pow(R,2)*Sigma_crit);
39+
return (beta+2)*mass*pow(r/R,beta)/(2*PI*pow(R,2)*Sigma_crit);
4040
}
4141
///
4242
void gammaPowLaw(KappaType *gamma,PosType *x,PosType R,PosType mass,PosType beta
@@ -48,7 +48,7 @@ void gammaPowLaw(KappaType *gamma,PosType *x,PosType R,PosType mass,PosType beta
4848
gamma[0]=gamma[1]=0.0;
4949
return ;
5050
}
51-
gt=mass/pi/Sigma_crit/pow(r,2);
51+
gt=mass/PI/Sigma_crit/pow(r,2);
5252
if(r<R) gt *= -beta*pow(r/R,beta+2)/2;
5353

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

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

66-
b=mass/pi/Sigma_crit;
66+
b=mass/PI/Sigma_crit;
6767
if(r<=R) return b*pow(r/R,beta+2);
6868
return b*(log(r/R) + 1);
6969
}

AnalyticNSIE/randomize_lens.cpp

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ void LensHaloAnaNSIE::RandomizeHost(long *seed,bool tables){
8282
// aligned hexopole and octopole
8383
if(perturb_Nmodes > 0){
8484
for(n=3;n<6;++n) AlignedRandomlyDistortLens(seed
85-
,pa+3*pi*gasdev(seed)/180,n);
85+
,pa+3*PI*gasdev(seed)/180,n);
8686
}
8787

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

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

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

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

234-
unsigned int Nsub=(int)(poidev(ndensity*pi*Rm*Rm,seed));
234+
unsigned int Nsub=(int)(poidev(ndensity*PI*Rm*Rm,seed));
235235
Nsub = (NsubMax > Nsub) ? Nsub : NsubMax ;
236236

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

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

259259
subs[k].set_slope(sub_beta);
260260

261-
subs[k].set_rscale(0.1*subs[k].get_Rsize());
261+
subs[k].set_rscale(0.1*subs[k].getRsize());
262262

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

267267
//std::cout << "RcutSubstruct[%i] = %e\n",k,RcutSubstruct[k]);
268268
//std::cout << "%e %e %e Rm=%e\n",r/rmax,r,rmax,Rm);
269269
if( r < rmax){
270-
theta=2*pi*ran2(seed);
270+
theta=2*PI*ran2(seed);
271271
sub_x[k][0]=r*cos(theta);
272272
sub_x[k][1]=r*sin(theta);
273273
assert(k<NsubMax);
274274

275275
rav[0] += sub_x[k][0];
276276
rav[1] += sub_x[k][1];
277277
r2av += r*r;
278-
area_av += pow(subs[k].get_Rsize(),2);
278+
area_av += pow(subs[k].getRsize(),2);
279279
++k;
280280
}
281281
}
@@ -334,12 +334,12 @@ void LensHaloAnaNSIE::RandomizeSubstructure3(PosType rangeInRei,long *seed){
334334

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

339339
assert(Rm > 0.0);
340340

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

364-
unsigned int Nsub=(int)(poidev(sub_Ndensity*pi*Rm*Rm,seed));
364+
unsigned int Nsub=(int)(poidev(sub_Ndensity*PI*Rm*Rm,seed));
365365

366366
assert(Nsub < NsubMax);
367367

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

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

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

393393
//std::cout << "RcutSubstruct[%i] = %e\n",k,RcutSubstruct[k]);
394394
//std::cout << "%e %e %e Rm=%e\n",r/rmax,r,rmax,Rm);
395395
if( r < rmax){
396-
theta=2*pi*ran2(seed);
396+
theta=2*PI*ran2(seed);
397397
sub_x[k][0]=r*cos(theta);
398398
sub_x[k][1]=r*sin(theta);
399399
assert(k<NsubMax);
400400

401401
rav[0] += sub_x[k][0];
402402
rav[1] += sub_x[k][1];
403403
r2av += r*r;
404-
area_av += pow(subs[k].get_Rsize(),2);
404+
area_av += pow(subs[k].getRsize(),2);
405405
++k;
406406
}
407407
}
@@ -456,7 +456,7 @@ PosType LensHaloAnaNSIE::FractionWithinRe(PosType rangeInRei){
456456
PosType B;
457457

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

461461
return 1+(1+sub_alpha)*(
462462
2*rangeInRei*Einstein_ro*B*(

0 commit comments

Comments
 (0)