Skip to content

Commit

Permalink
added test_requirements.txt
Browse files Browse the repository at this point in the history
  • Loading branch information
sibirrer committed Mar 26, 2022
1 parent 6803aa4 commit bd3af52
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 16 deletions.
31 changes: 18 additions & 13 deletions lenstronomy/LensModel/Profiles/splcore.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,15 @@ class SPLCORE(LensProfileBase):
.. math::
\rho\left(r, \rho_0, r_c, \gamma\right) = \rho_0 \frac{{r_c}^\gamma}{\left(r^2 + r_c^2\right)^{\frac{\gamma}{2}}}
\\rho\\left(r, \\rho_0, r_c, \\gamma\\right) = \\rho_0
\\frac{{r_c}^\\gamma}{\\left(r^2 + r_c^2\\right)^{\\frac{\\gamma}{2}}}
The difference between this and EPL is that this model contains a core radius, is circular, and is also defined for gamma=3.
The difference between this and EPL is that this model contains a core radius, is circular,
and is also defined for gamma=3.
With respect to SPEMD, this model is different in that it is also defined for gamma = 3, is circular, and is defined
in terms of a physical density parameter rho0, or the central density at r=0 divided by the critical density for lensing
such that rho0 has units 1/arcsec.
in terms of a physical density parameter rho0, or the central density at r=0 divided by the critical density for
lensing such that rho0 has units 1/arcsec.
This class is defined for all gamma > 1
"""
Expand Down Expand Up @@ -102,11 +104,12 @@ def alpha(self, r, sigma0, r_core, gamma):
mass2d = self.mass_2d_lens(r, sigma0, r_core, gamma)
return mass2d / r / np.pi

def density(self, r, rho0, r_core, gamma):
@staticmethod
def density(r, rho0, r_core, gamma):
"""
Returns the 3D density at r
:param r: radius [arcsec]
:param sigma0: convergence at r=0
:param rho0: convergence at r=0
:param r_core: core radius [arcsec]
:param gamma: logarithmic slope at r -> infinity
:return: density at r
Expand All @@ -129,7 +132,7 @@ def _density_2d_r(self, r, rho0, r_core, gamma):
"""
Returns the convergence at radius r after applying _safe_r_division
:param r: position [arcsec]
:param sigma0: convergence at r=0
:param rho0: convergence at r=0
:param r_core: core radius [arcsec]
:param gamma: logarithmic slope at r -> infinity
:return: convergence at r
Expand All @@ -150,7 +153,7 @@ def density_2d(self, x, y, rho0, r_core, gamma):
Returns the convergence at radius r
:param x: x position [arcsec]
:param y: y position [arcsec]
:param sigma0: convergence at r=0
:param rho0: convergence at r=0
:param r_core: core radius [arcsec]
:param gamma: logarithmic slope at r -> infinity
:return: convergence at r
Expand Down Expand Up @@ -238,7 +241,7 @@ def _sigma2rho0(sigma0, r_core):
def _rho02sigma(rho0, r_core):
"""
Converts the convergence normalization to the 3d normalization
:param sigma0: convergence at r=0
:param rho0: convergence at r=0
:param r_core: core radius [arcsec]
:return: density normalization in units 1/arcsec, or rho_0_physical / sigma_crit
"""
Expand All @@ -251,9 +254,10 @@ def _f(x, gamma):
.. math::
m_{\rm{2D}}\left(R\right) = 4 \pi r_{\rm{core}}^3 \rho_0 F\left(\frac{R}{r_{\rm{core}}}, \gamma\right)
m_{\\rm{2D}}\\left(R\\right) = 4 \\pi r_{\\rm{core}}^3
\\rho_0 F\\left(\\frac{R}{r_{\\rm{core}}}, \\gamma\\right)
:param x: dimensionaless radius r/r_core
:param x: dimensionless radius r/r_core
:param gamma: logarithmic slope at r -> infinity
:return: a number
"""
Expand All @@ -274,9 +278,10 @@ def _g(x, gamma):
Returns the solution of the 2D mass integral defined such that
.. math::
m_{\rm{3D}}\left(R\right) = 4 \pi r_{\rm{core}}^3 \rho_0 G\left(\frac{R}{r_{\rm{core}}}, \gamma\right)
m_{\\rm{3D}}\\left(R\\right) = 4 \\pi r_{\\rm{core}}^3
\\rho_0 G\\left(\\frac{R}{r_{\\rm{core}}}, \\gamma\\right)
:param x: dimensionaless radius r/r_core
:param x: dimensionless radius r/r_core
:param gamma: logarithmic slope at r -> infinity
:return: a number
"""
Expand Down
3 changes: 0 additions & 3 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,3 @@ multiprocess>=0.70.8
# fastell is not a direct requirement as it needs a fortran compiler and is optional
#-e git://github.com/sibirrer/fastell4py.git#egg=fastell4py
slitronomy==0.3.2

# requirements for tests
# colossus
2 changes: 2 additions & 0 deletions test_requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# requirements for tests
colossus

0 comments on commit bd3af52

Please sign in to comment.