repository_name stringlengths 5 67 | func_path_in_repository stringlengths 4 234 | func_name stringlengths 0 314 | whole_func_string stringlengths 52 3.87M | language stringclasses 6
values | func_code_string stringlengths 52 3.87M | func_documentation_string stringlengths 1 47.2k | func_code_url stringlengths 85 339 |
|---|---|---|---|---|---|---|---|
sibirrer/lenstronomy | lenstronomy/LensModel/Profiles/coreBurkert.py | coreBurkert.derivatives | def derivatives(self, x, y, Rs, theta_Rs, r_core, center_x=0, center_y=0):
"""
deflection angles
:param x: x coordinate
:param y: y coordinate
:param Rs: scale radius
:param rho0: central core density
:param r_core: core radius
:param center_x:
:pa... | python | def derivatives(self, x, y, Rs, theta_Rs, r_core, center_x=0, center_y=0):
"""
deflection angles
:param x: x coordinate
:param y: y coordinate
:param Rs: scale radius
:param rho0: central core density
:param r_core: core radius
:param center_x:
:pa... | deflection angles
:param x: x coordinate
:param y: y coordinate
:param Rs: scale radius
:param rho0: central core density
:param r_core: core radius
:param center_x:
:param center_y:
:return: | https://github.com/sibirrer/lenstronomy/blob/4edb100a4f3f4fdc4fac9b0032d2b0283d0aa1d6/lenstronomy/LensModel/Profiles/coreBurkert.py#L39-L62 |
sibirrer/lenstronomy | lenstronomy/LensModel/Profiles/coreBurkert.py | coreBurkert.hessian | def hessian(self, x, y, Rs, theta_Rs, r_core, center_x=0, center_y=0):
"""
:param x: x coordinate
:param y: y coordinate
:param Rs: scale radius
:param rho0: central core density
:param r_core: core radius
:param center_x:
:param center_y:
:return... | python | def hessian(self, x, y, Rs, theta_Rs, r_core, center_x=0, center_y=0):
"""
:param x: x coordinate
:param y: y coordinate
:param Rs: scale radius
:param rho0: central core density
:param r_core: core radius
:param center_x:
:param center_y:
:return... | :param x: x coordinate
:param y: y coordinate
:param Rs: scale radius
:param rho0: central core density
:param r_core: core radius
:param center_x:
:param center_y:
:return: | https://github.com/sibirrer/lenstronomy/blob/4edb100a4f3f4fdc4fac9b0032d2b0283d0aa1d6/lenstronomy/LensModel/Profiles/coreBurkert.py#L64-L91 |
sibirrer/lenstronomy | lenstronomy/LensModel/Profiles/coreBurkert.py | coreBurkert.mass_2d | def mass_2d(self, R, Rs, rho0, r_core):
"""
analytic solution of the projection integral
(convergence)
:param R: projected distance
:param Rs: scale radius
:param rho0: central core density
:param r_core: core radius
"""
x = R * Rs ** -1
... | python | def mass_2d(self, R, Rs, rho0, r_core):
"""
analytic solution of the projection integral
(convergence)
:param R: projected distance
:param Rs: scale radius
:param rho0: central core density
:param r_core: core radius
"""
x = R * Rs ** -1
... | analytic solution of the projection integral
(convergence)
:param R: projected distance
:param Rs: scale radius
:param rho0: central core density
:param r_core: core radius | https://github.com/sibirrer/lenstronomy/blob/4edb100a4f3f4fdc4fac9b0032d2b0283d0aa1d6/lenstronomy/LensModel/Profiles/coreBurkert.py#L93-L111 |
sibirrer/lenstronomy | lenstronomy/LensModel/Profiles/coreBurkert.py | coreBurkert.coreBurkAlpha | def coreBurkAlpha(self, R, Rs, rho0, r_core, ax_x, ax_y):
"""
deflection angle
:param R:
:param Rs:
:param rho0:
:param r_core:
:param ax_x:
:param ax_y:
:return:
"""
x = R * Rs ** -1
p = Rs * r_core ** -1
gx = sel... | python | def coreBurkAlpha(self, R, Rs, rho0, r_core, ax_x, ax_y):
"""
deflection angle
:param R:
:param Rs:
:param rho0:
:param r_core:
:param ax_x:
:param ax_y:
:return:
"""
x = R * Rs ** -1
p = Rs * r_core ** -1
gx = sel... | deflection angle
:param R:
:param Rs:
:param rho0:
:param r_core:
:param ax_x:
:param ax_y:
:return: | https://github.com/sibirrer/lenstronomy/blob/4edb100a4f3f4fdc4fac9b0032d2b0283d0aa1d6/lenstronomy/LensModel/Profiles/coreBurkert.py#L113-L132 |
sibirrer/lenstronomy | lenstronomy/LensModel/Profiles/coreBurkert.py | coreBurkert.mass_3d | def mass_3d(self, R, Rs, rho0, r_core):
"""
:param R: projected distance
:param Rs: scale radius
:param rho0: central core density
:param r_core: core radius
"""
Rs = float(Rs)
b = r_core * Rs ** -1
c = R * Rs ** -1
M0 = 4*np.pi*Rs**3 * r... | python | def mass_3d(self, R, Rs, rho0, r_core):
"""
:param R: projected distance
:param Rs: scale radius
:param rho0: central core density
:param r_core: core radius
"""
Rs = float(Rs)
b = r_core * Rs ** -1
c = R * Rs ** -1
M0 = 4*np.pi*Rs**3 * r... | :param R: projected distance
:param Rs: scale radius
:param rho0: central core density
:param r_core: core radius | https://github.com/sibirrer/lenstronomy/blob/4edb100a4f3f4fdc4fac9b0032d2b0283d0aa1d6/lenstronomy/LensModel/Profiles/coreBurkert.py#L170-L184 |
sibirrer/lenstronomy | lenstronomy/LensModel/Profiles/coreBurkert.py | coreBurkert.cBurkPot | def cBurkPot(self, R, Rs, rho0, r_core):
"""
:param R: projected distance
:param Rs: scale radius
:param rho0: central core density
:param r_core: core radius
"""
x = R * Rs ** -1
p = Rs * r_core ** -1
hx = self._H(x, p)
return 2 * rho0 *... | python | def cBurkPot(self, R, Rs, rho0, r_core):
"""
:param R: projected distance
:param Rs: scale radius
:param rho0: central core density
:param r_core: core radius
"""
x = R * Rs ** -1
p = Rs * r_core ** -1
hx = self._H(x, p)
return 2 * rho0 *... | :param R: projected distance
:param Rs: scale radius
:param rho0: central core density
:param r_core: core radius | https://github.com/sibirrer/lenstronomy/blob/4edb100a4f3f4fdc4fac9b0032d2b0283d0aa1d6/lenstronomy/LensModel/Profiles/coreBurkert.py#L186-L198 |
sibirrer/lenstronomy | lenstronomy/LensModel/Profiles/coreBurkert.py | coreBurkert._F | def _F(self, x, p):
"""
solution of the projection integal (kappa)
arctanh / arctan function
:param x: r/Rs
:param p: r_core / Rs
:return:
"""
prefactor = 0.5 * (1 + p ** 2) ** -1 * p
if isinstance(x, np.ndarray):
inds0 = np.where(x ... | python | def _F(self, x, p):
"""
solution of the projection integal (kappa)
arctanh / arctan function
:param x: r/Rs
:param p: r_core / Rs
:return:
"""
prefactor = 0.5 * (1 + p ** 2) ** -1 * p
if isinstance(x, np.ndarray):
inds0 = np.where(x ... | solution of the projection integal (kappa)
arctanh / arctan function
:param x: r/Rs
:param p: r_core / Rs
:return: | https://github.com/sibirrer/lenstronomy/blob/4edb100a4f3f4fdc4fac9b0032d2b0283d0aa1d6/lenstronomy/LensModel/Profiles/coreBurkert.py#L312-L352 |
sibirrer/lenstronomy | lenstronomy/LensModel/Profiles/coreBurkert.py | coreBurkert._G | def _G(self, x, p):
"""
analytic solution of the 2d projected mass integral
integral: 2 * pi * x * kappa * dx
:param x:
:param p:
:return:
"""
prefactor = (p + p ** 3) ** -1 * p
if isinstance(x, np.ndarray):
inds0 = np.where(x * p ==... | python | def _G(self, x, p):
"""
analytic solution of the 2d projected mass integral
integral: 2 * pi * x * kappa * dx
:param x:
:param p:
:return:
"""
prefactor = (p + p ** 3) ** -1 * p
if isinstance(x, np.ndarray):
inds0 = np.where(x * p ==... | analytic solution of the 2d projected mass integral
integral: 2 * pi * x * kappa * dx
:param x:
:param p:
:return: | https://github.com/sibirrer/lenstronomy/blob/4edb100a4f3f4fdc4fac9b0032d2b0283d0aa1d6/lenstronomy/LensModel/Profiles/coreBurkert.py#L354-L408 |
sibirrer/lenstronomy | lenstronomy/ImSim/MultiBand/multi_exposures.py | MultiExposures.linear_response_matrix | def linear_response_matrix(self, kwargs_lens=None, kwargs_source=None, kwargs_lens_light=None, kwargs_ps=None):
"""
computes the linear response matrix (m x n), with n beeing the data size and m being the coefficients
:param kwargs_lens:
:param kwargs_source:
:param kwargs_lens_... | python | def linear_response_matrix(self, kwargs_lens=None, kwargs_source=None, kwargs_lens_light=None, kwargs_ps=None):
"""
computes the linear response matrix (m x n), with n beeing the data size and m being the coefficients
:param kwargs_lens:
:param kwargs_source:
:param kwargs_lens_... | computes the linear response matrix (m x n), with n beeing the data size and m being the coefficients
:param kwargs_lens:
:param kwargs_source:
:param kwargs_lens_light:
:param kwargs_ps:
:return: | https://github.com/sibirrer/lenstronomy/blob/4edb100a4f3f4fdc4fac9b0032d2b0283d0aa1d6/lenstronomy/ImSim/MultiBand/multi_exposures.py#L38-L56 |
sibirrer/lenstronomy | lenstronomy/ImSim/MultiBand/multi_exposures.py | MultiExposures.data_response | def data_response(self):
"""
returns the 1d array of the data element that is fitted for (including masking)
:return: 1d numpy array
"""
d = []
for i in range(self._num_bands):
if self._compute_bool[i] is True:
d_i = self._imageModel_list[i].d... | python | def data_response(self):
"""
returns the 1d array of the data element that is fitted for (including masking)
:return: 1d numpy array
"""
d = []
for i in range(self._num_bands):
if self._compute_bool[i] is True:
d_i = self._imageModel_list[i].d... | returns the 1d array of the data element that is fitted for (including masking)
:return: 1d numpy array | https://github.com/sibirrer/lenstronomy/blob/4edb100a4f3f4fdc4fac9b0032d2b0283d0aa1d6/lenstronomy/ImSim/MultiBand/multi_exposures.py#L59-L73 |
sibirrer/lenstronomy | lenstronomy/ImSim/MultiBand/multi_exposures.py | MultiExposures._array2image_list | def _array2image_list(self, array):
"""
maps 1d vector of joint exposures in list of 2d images of single exposures
:param array: 1d numpy array
:return: list of 2d numpy arrays of size of exposures
"""
image_list = []
k = 0
for i in range(self._num_bands... | python | def _array2image_list(self, array):
"""
maps 1d vector of joint exposures in list of 2d images of single exposures
:param array: 1d numpy array
:return: list of 2d numpy arrays of size of exposures
"""
image_list = []
k = 0
for i in range(self._num_bands... | maps 1d vector of joint exposures in list of 2d images of single exposures
:param array: 1d numpy array
:return: list of 2d numpy arrays of size of exposures | https://github.com/sibirrer/lenstronomy/blob/4edb100a4f3f4fdc4fac9b0032d2b0283d0aa1d6/lenstronomy/ImSim/MultiBand/multi_exposures.py#L75-L91 |
sibirrer/lenstronomy | lenstronomy/ImSim/MultiBand/multi_exposures.py | MultiExposures.likelihood_data_given_model | def likelihood_data_given_model(self, kwargs_lens, kwargs_source, kwargs_lens_light, kwargs_ps, source_marg=False):
"""
computes the likelihood of the data given a model
This is specified with the non-linear parameters and a linear inversion and prior marginalisation.
:param kwargs_lens:... | python | def likelihood_data_given_model(self, kwargs_lens, kwargs_source, kwargs_lens_light, kwargs_ps, source_marg=False):
"""
computes the likelihood of the data given a model
This is specified with the non-linear parameters and a linear inversion and prior marginalisation.
:param kwargs_lens:... | computes the likelihood of the data given a model
This is specified with the non-linear parameters and a linear inversion and prior marginalisation.
:param kwargs_lens:
:param kwargs_source:
:param kwargs_lens_light:
:param kwargs_ps:
:return: log likelihood (natural loga... | https://github.com/sibirrer/lenstronomy/blob/4edb100a4f3f4fdc4fac9b0032d2b0283d0aa1d6/lenstronomy/ImSim/MultiBand/multi_exposures.py#L110-L134 |
sibirrer/lenstronomy | lenstronomy/ImSim/MultiBand/multiband_multimodel.py | MultiBandMultiModel.image_linear_solve | def image_linear_solve(self, kwargs_lens, kwargs_source, kwargs_lens_light, kwargs_ps, inv_bool=False):
"""
computes the image (lens and source surface brightness with a given lens model).
The linear parameters are computed with a weighted linear least square optimization (i.e. flux normalizatio... | python | def image_linear_solve(self, kwargs_lens, kwargs_source, kwargs_lens_light, kwargs_ps, inv_bool=False):
"""
computes the image (lens and source surface brightness with a given lens model).
The linear parameters are computed with a weighted linear least square optimization (i.e. flux normalizatio... | computes the image (lens and source surface brightness with a given lens model).
The linear parameters are computed with a weighted linear least square optimization (i.e. flux normalization of the brightness profiles)
:param kwargs_lens: list of keyword arguments corresponding to the superposition of di... | https://github.com/sibirrer/lenstronomy/blob/4edb100a4f3f4fdc4fac9b0032d2b0283d0aa1d6/lenstronomy/ImSim/MultiBand/multiband_multimodel.py#L49-L74 |
sibirrer/lenstronomy | lenstronomy/ImSim/MultiBand/multiband_multimodel.py | MultiBandMultiModel.likelihood_data_given_model | def likelihood_data_given_model(self, kwargs_lens, kwargs_source, kwargs_lens_light, kwargs_ps, source_marg=False):
"""
computes the likelihood of the data given a model
This is specified with the non-linear parameters and a linear inversion and prior marginalisation.
:param kwargs_lens:... | python | def likelihood_data_given_model(self, kwargs_lens, kwargs_source, kwargs_lens_light, kwargs_ps, source_marg=False):
"""
computes the likelihood of the data given a model
This is specified with the non-linear parameters and a linear inversion and prior marginalisation.
:param kwargs_lens:... | computes the likelihood of the data given a model
This is specified with the non-linear parameters and a linear inversion and prior marginalisation.
:param kwargs_lens:
:param kwargs_source:
:param kwargs_lens_light:
:param kwargs_ps:
:return: log likelihood (natural loga... | https://github.com/sibirrer/lenstronomy/blob/4edb100a4f3f4fdc4fac9b0032d2b0283d0aa1d6/lenstronomy/ImSim/MultiBand/multiband_multimodel.py#L76-L95 |
sibirrer/lenstronomy | lenstronomy/LensModel/Solver/solver.py | Solver.check_solver | def check_solver(self, image_x, image_y, kwargs_lens):
"""
returns the precision of the solver to match the image position
:param kwargs_lens: full lens model (including solved parameters)
:param image_x: point source in image
:param image_y: point source in image
:retur... | python | def check_solver(self, image_x, image_y, kwargs_lens):
"""
returns the precision of the solver to match the image position
:param kwargs_lens: full lens model (including solved parameters)
:param image_x: point source in image
:param image_y: point source in image
:retur... | returns the precision of the solver to match the image position
:param kwargs_lens: full lens model (including solved parameters)
:param image_x: point source in image
:param image_y: point source in image
:return: precision of Euclidean distances between the different rays arriving at ... | https://github.com/sibirrer/lenstronomy/blob/4edb100a4f3f4fdc4fac9b0032d2b0283d0aa1d6/lenstronomy/LensModel/Solver/solver.py#L47-L58 |
sibirrer/lenstronomy | lenstronomy/LensModel/Solver/solver.py | Solver.add_fixed_lens | def add_fixed_lens(self, kwargs_fixed_lens, kwargs_lens_init):
"""
returns kwargs that are kept fixed during run, depending on options
:param kwargs_options:
:param kwargs_lens:
:return:
"""
kwargs_fixed_lens = self._solver.add_fixed_lens(kwargs_fixed_lens, kwargs... | python | def add_fixed_lens(self, kwargs_fixed_lens, kwargs_lens_init):
"""
returns kwargs that are kept fixed during run, depending on options
:param kwargs_options:
:param kwargs_lens:
:return:
"""
kwargs_fixed_lens = self._solver.add_fixed_lens(kwargs_fixed_lens, kwargs... | returns kwargs that are kept fixed during run, depending on options
:param kwargs_options:
:param kwargs_lens:
:return: | https://github.com/sibirrer/lenstronomy/blob/4edb100a4f3f4fdc4fac9b0032d2b0283d0aa1d6/lenstronomy/LensModel/Solver/solver.py#L60-L68 |
sibirrer/lenstronomy | lenstronomy/Cosmo/lens_cosmo.py | LensCosmo.epsilon_crit | def epsilon_crit(self):
"""
returns the critical projected mass density in units of M_sun/Mpc^2 (physical units)
:return: critical projected mass density
"""
if not hasattr(self, '_Epsilon_Crit'):
const_SI = const.c ** 2 / (4 * np.pi * const.G) #c^2/(4*pi*G) in units... | python | def epsilon_crit(self):
"""
returns the critical projected mass density in units of M_sun/Mpc^2 (physical units)
:return: critical projected mass density
"""
if not hasattr(self, '_Epsilon_Crit'):
const_SI = const.c ** 2 / (4 * np.pi * const.G) #c^2/(4*pi*G) in units... | returns the critical projected mass density in units of M_sun/Mpc^2 (physical units)
:return: critical projected mass density | https://github.com/sibirrer/lenstronomy/blob/4edb100a4f3f4fdc4fac9b0032d2b0283d0aa1d6/lenstronomy/Cosmo/lens_cosmo.py#L74-L84 |
sibirrer/lenstronomy | lenstronomy/Cosmo/lens_cosmo.py | LensCosmo.mass_in_theta_E | def mass_in_theta_E(self, theta_E):
"""
mass within Einstein radius (area * epsilon crit) [M_sun]
:param theta_E: Einstein radius [arcsec]
:return: mass within Einstein radius [M_sun]
"""
mass = self.arcsec2phys_lens(theta_E) ** 2 * np.pi * self.epsilon_crit
retur... | python | def mass_in_theta_E(self, theta_E):
"""
mass within Einstein radius (area * epsilon crit) [M_sun]
:param theta_E: Einstein radius [arcsec]
:return: mass within Einstein radius [M_sun]
"""
mass = self.arcsec2phys_lens(theta_E) ** 2 * np.pi * self.epsilon_crit
retur... | mass within Einstein radius (area * epsilon crit) [M_sun]
:param theta_E: Einstein radius [arcsec]
:return: mass within Einstein radius [M_sun] | https://github.com/sibirrer/lenstronomy/blob/4edb100a4f3f4fdc4fac9b0032d2b0283d0aa1d6/lenstronomy/Cosmo/lens_cosmo.py#L118-L125 |
sibirrer/lenstronomy | lenstronomy/Cosmo/lens_cosmo.py | LensCosmo.nfw_angle2physical | def nfw_angle2physical(self, Rs_angle, theta_Rs):
"""
converts the angular parameters into the physical ones for an NFW profile
:param theta_Rs: observed bending angle at the scale radius in units of arcsec
:param Rs: scale radius in units of arcsec
:return: M200, r200, Rs_physi... | python | def nfw_angle2physical(self, Rs_angle, theta_Rs):
"""
converts the angular parameters into the physical ones for an NFW profile
:param theta_Rs: observed bending angle at the scale radius in units of arcsec
:param Rs: scale radius in units of arcsec
:return: M200, r200, Rs_physi... | converts the angular parameters into the physical ones for an NFW profile
:param theta_Rs: observed bending angle at the scale radius in units of arcsec
:param Rs: scale radius in units of arcsec
:return: M200, r200, Rs_physical, c | https://github.com/sibirrer/lenstronomy/blob/4edb100a4f3f4fdc4fac9b0032d2b0283d0aa1d6/lenstronomy/Cosmo/lens_cosmo.py#L156-L171 |
sibirrer/lenstronomy | lenstronomy/Cosmo/lens_cosmo.py | LensCosmo.nfw_physical2angle | def nfw_physical2angle(self, M, c):
"""
converts the physical mass and concentration parameter of an NFW profile into the lensing quantities
:param M: mass enclosed 200 rho_crit in units of M_sun
:param c: NFW concentration parameter (r200/r_s)
:return: theta_Rs (observed bendin... | python | def nfw_physical2angle(self, M, c):
"""
converts the physical mass and concentration parameter of an NFW profile into the lensing quantities
:param M: mass enclosed 200 rho_crit in units of M_sun
:param c: NFW concentration parameter (r200/r_s)
:return: theta_Rs (observed bendin... | converts the physical mass and concentration parameter of an NFW profile into the lensing quantities
:param M: mass enclosed 200 rho_crit in units of M_sun
:param c: NFW concentration parameter (r200/r_s)
:return: theta_Rs (observed bending angle at the scale radius, Rs_angle (angle at scale ra... | https://github.com/sibirrer/lenstronomy/blob/4edb100a4f3f4fdc4fac9b0032d2b0283d0aa1d6/lenstronomy/Cosmo/lens_cosmo.py#L173-L184 |
sibirrer/lenstronomy | lenstronomy/Cosmo/lens_cosmo.py | LensCosmo.nfwParam_physical | def nfwParam_physical(self, M, c):
"""
returns the NFW parameters in physical units
:param M: physical mass in M_sun
:param c: concentration
:return:
"""
r200 = self.nfw_param.r200_M(M * self.h) / self.h * self.a_z(self.z_lens) # physical radius r200
rho0... | python | def nfwParam_physical(self, M, c):
"""
returns the NFW parameters in physical units
:param M: physical mass in M_sun
:param c: concentration
:return:
"""
r200 = self.nfw_param.r200_M(M * self.h) / self.h * self.a_z(self.z_lens) # physical radius r200
rho0... | returns the NFW parameters in physical units
:param M: physical mass in M_sun
:param c: concentration
:return: | https://github.com/sibirrer/lenstronomy/blob/4edb100a4f3f4fdc4fac9b0032d2b0283d0aa1d6/lenstronomy/Cosmo/lens_cosmo.py#L186-L196 |
sibirrer/lenstronomy | lenstronomy/Cosmo/lens_cosmo.py | LensCosmo.sis_theta_E2sigma_v | def sis_theta_E2sigma_v(self, theta_E):
"""
converts the lensing Einstein radius into a physical velocity dispersion
:param theta_E: Einstein radius (in arcsec)
:return: velocity dispersion in units (km/s)
"""
v_sigma_c2 = theta_E * const.arcsec / (4*np.pi) * self.D_s / s... | python | def sis_theta_E2sigma_v(self, theta_E):
"""
converts the lensing Einstein radius into a physical velocity dispersion
:param theta_E: Einstein radius (in arcsec)
:return: velocity dispersion in units (km/s)
"""
v_sigma_c2 = theta_E * const.arcsec / (4*np.pi) * self.D_s / s... | converts the lensing Einstein radius into a physical velocity dispersion
:param theta_E: Einstein radius (in arcsec)
:return: velocity dispersion in units (km/s) | https://github.com/sibirrer/lenstronomy/blob/4edb100a4f3f4fdc4fac9b0032d2b0283d0aa1d6/lenstronomy/Cosmo/lens_cosmo.py#L198-L205 |
sibirrer/lenstronomy | lenstronomy/Cosmo/lens_cosmo.py | LensCosmo.sis_sigma_v2theta_E | def sis_sigma_v2theta_E(self, v_sigma):
"""
converts the velocity dispersion into an Einstein radius for a SIS profile
:param v_sigma: velocity dispersion (km/s)
:return: theta_E (arcsec)
"""
theta_E = 4 * np.pi * (v_sigma * 1000./const.c)**2 * self.D_ds / self.D_s / cons... | python | def sis_sigma_v2theta_E(self, v_sigma):
"""
converts the velocity dispersion into an Einstein radius for a SIS profile
:param v_sigma: velocity dispersion (km/s)
:return: theta_E (arcsec)
"""
theta_E = 4 * np.pi * (v_sigma * 1000./const.c)**2 * self.D_ds / self.D_s / cons... | converts the velocity dispersion into an Einstein radius for a SIS profile
:param v_sigma: velocity dispersion (km/s)
:return: theta_E (arcsec) | https://github.com/sibirrer/lenstronomy/blob/4edb100a4f3f4fdc4fac9b0032d2b0283d0aa1d6/lenstronomy/Cosmo/lens_cosmo.py#L207-L214 |
sibirrer/lenstronomy | lenstronomy/Cosmo/lens_cosmo.py | LCDM.D_d | def D_d(self, H_0, Om0, Ode0=None):
"""
angular diameter to deflector
:param H_0: Hubble parameter [km/s/Mpc]
:param Om0: normalized matter density at present time
:return: float [Mpc]
"""
lensCosmo = self._get_cosom(H_0, Om0, Ode0)
return lensCosmo.D_d | python | def D_d(self, H_0, Om0, Ode0=None):
"""
angular diameter to deflector
:param H_0: Hubble parameter [km/s/Mpc]
:param Om0: normalized matter density at present time
:return: float [Mpc]
"""
lensCosmo = self._get_cosom(H_0, Om0, Ode0)
return lensCosmo.D_d | angular diameter to deflector
:param H_0: Hubble parameter [km/s/Mpc]
:param Om0: normalized matter density at present time
:return: float [Mpc] | https://github.com/sibirrer/lenstronomy/blob/4edb100a4f3f4fdc4fac9b0032d2b0283d0aa1d6/lenstronomy/Cosmo/lens_cosmo.py#L247-L255 |
sibirrer/lenstronomy | lenstronomy/Cosmo/lens_cosmo.py | LCDM.D_s | def D_s(self, H_0, Om0, Ode0=None):
"""
angular diameter to source
:param H_0: Hubble parameter [km/s/Mpc]
:param Om0: normalized matter density at present time
:return: float [Mpc]
"""
lensCosmo = self._get_cosom(H_0, Om0, Ode0)
return lensCosmo.D_s | python | def D_s(self, H_0, Om0, Ode0=None):
"""
angular diameter to source
:param H_0: Hubble parameter [km/s/Mpc]
:param Om0: normalized matter density at present time
:return: float [Mpc]
"""
lensCosmo = self._get_cosom(H_0, Om0, Ode0)
return lensCosmo.D_s | angular diameter to source
:param H_0: Hubble parameter [km/s/Mpc]
:param Om0: normalized matter density at present time
:return: float [Mpc] | https://github.com/sibirrer/lenstronomy/blob/4edb100a4f3f4fdc4fac9b0032d2b0283d0aa1d6/lenstronomy/Cosmo/lens_cosmo.py#L257-L265 |
sibirrer/lenstronomy | lenstronomy/Cosmo/lens_cosmo.py | LCDM.D_ds | def D_ds(self, H_0, Om0, Ode0=None):
"""
angular diameter from deflector to source
:param H_0: Hubble parameter [km/s/Mpc]
:param Om0: normalized matter density at present time
:return: float [Mpc]
"""
lensCosmo = self._get_cosom(H_0, Om0, Ode0)
return len... | python | def D_ds(self, H_0, Om0, Ode0=None):
"""
angular diameter from deflector to source
:param H_0: Hubble parameter [km/s/Mpc]
:param Om0: normalized matter density at present time
:return: float [Mpc]
"""
lensCosmo = self._get_cosom(H_0, Om0, Ode0)
return len... | angular diameter from deflector to source
:param H_0: Hubble parameter [km/s/Mpc]
:param Om0: normalized matter density at present time
:return: float [Mpc] | https://github.com/sibirrer/lenstronomy/blob/4edb100a4f3f4fdc4fac9b0032d2b0283d0aa1d6/lenstronomy/Cosmo/lens_cosmo.py#L267-L275 |
sibirrer/lenstronomy | lenstronomy/Cosmo/lens_cosmo.py | LCDM.D_dt | def D_dt(self, H_0, Om0, Ode0=None):
"""
time delay distance
:param H_0: Hubble parameter [km/s/Mpc]
:param Om0: normalized matter density at present time
:return: float [Mpc]
"""
lensCosmo = self._get_cosom(H_0, Om0, Ode0)
return lensCosmo.D_dt | python | def D_dt(self, H_0, Om0, Ode0=None):
"""
time delay distance
:param H_0: Hubble parameter [km/s/Mpc]
:param Om0: normalized matter density at present time
:return: float [Mpc]
"""
lensCosmo = self._get_cosom(H_0, Om0, Ode0)
return lensCosmo.D_dt | time delay distance
:param H_0: Hubble parameter [km/s/Mpc]
:param Om0: normalized matter density at present time
:return: float [Mpc] | https://github.com/sibirrer/lenstronomy/blob/4edb100a4f3f4fdc4fac9b0032d2b0283d0aa1d6/lenstronomy/Cosmo/lens_cosmo.py#L277-L285 |
sibirrer/lenstronomy | lenstronomy/LensModel/Profiles/shapelet_pot_cartesian.py | CartShapelets.derivatives | def derivatives(self, x, y, coeffs, beta, center_x=0, center_y=0):
"""
returns df/dx and df/dy of the function
"""
shapelets = self._createShapelet(coeffs)
n_order = self._get_num_n(len(coeffs))
dx_shapelets = self._dx_shapelets(shapelets, beta)
dy_shapelets = sel... | python | def derivatives(self, x, y, coeffs, beta, center_x=0, center_y=0):
"""
returns df/dx and df/dy of the function
"""
shapelets = self._createShapelet(coeffs)
n_order = self._get_num_n(len(coeffs))
dx_shapelets = self._dx_shapelets(shapelets, beta)
dy_shapelets = sel... | returns df/dx and df/dy of the function | https://github.com/sibirrer/lenstronomy/blob/4edb100a4f3f4fdc4fac9b0032d2b0283d0aa1d6/lenstronomy/LensModel/Profiles/shapelet_pot_cartesian.py#L29-L45 |
sibirrer/lenstronomy | lenstronomy/LensModel/Profiles/shapelet_pot_cartesian.py | CartShapelets.hessian | def hessian(self, x, y, coeffs, beta, center_x=0, center_y=0):
"""
returns Hessian matrix of function d^2f/dx^2, d^f/dy^2, d^2/dxdy
"""
shapelets = self._createShapelet(coeffs)
n_order = self._get_num_n(len(coeffs))
dxx_shapelets = self._dxx_shapelets(shapelets, beta)
... | python | def hessian(self, x, y, coeffs, beta, center_x=0, center_y=0):
"""
returns Hessian matrix of function d^2f/dx^2, d^f/dy^2, d^2/dxdy
"""
shapelets = self._createShapelet(coeffs)
n_order = self._get_num_n(len(coeffs))
dxx_shapelets = self._dxx_shapelets(shapelets, beta)
... | returns Hessian matrix of function d^2f/dx^2, d^f/dy^2, d^2/dxdy | https://github.com/sibirrer/lenstronomy/blob/4edb100a4f3f4fdc4fac9b0032d2b0283d0aa1d6/lenstronomy/LensModel/Profiles/shapelet_pot_cartesian.py#L47-L66 |
sibirrer/lenstronomy | lenstronomy/LensModel/Profiles/shapelet_pot_cartesian.py | CartShapelets._createShapelet | def _createShapelet(self, coeffs):
"""
returns a shapelet array out of the coefficients *a, up to order l
:param num_l: order of shapelets
:type num_l: int.
:param coeff: shapelet coefficients
:type coeff: floats
:returns: complex array
:raises: Attribut... | python | def _createShapelet(self, coeffs):
"""
returns a shapelet array out of the coefficients *a, up to order l
:param num_l: order of shapelets
:type num_l: int.
:param coeff: shapelet coefficients
:type coeff: floats
:returns: complex array
:raises: Attribut... | returns a shapelet array out of the coefficients *a, up to order l
:param num_l: order of shapelets
:type num_l: int.
:param coeff: shapelet coefficients
:type coeff: floats
:returns: complex array
:raises: AttributeError, KeyError | https://github.com/sibirrer/lenstronomy/blob/4edb100a4f3f4fdc4fac9b0032d2b0283d0aa1d6/lenstronomy/LensModel/Profiles/shapelet_pot_cartesian.py#L68-L90 |
sibirrer/lenstronomy | lenstronomy/LensModel/Profiles/shapelet_pot_cartesian.py | CartShapelets._shapeletOutput | def _shapeletOutput(self, x, y, beta, shapelets, precalc=True):
"""
returns the the numerical values of a set of shapelets at polar coordinates
:param shapelets: set of shapelets [l=,r=,a_lr=]
:type shapelets: array of size (n,3)
:param coordPolar: set of coordinates in polar uni... | python | def _shapeletOutput(self, x, y, beta, shapelets, precalc=True):
"""
returns the the numerical values of a set of shapelets at polar coordinates
:param shapelets: set of shapelets [l=,r=,a_lr=]
:type shapelets: array of size (n,3)
:param coordPolar: set of coordinates in polar uni... | returns the the numerical values of a set of shapelets at polar coordinates
:param shapelets: set of shapelets [l=,r=,a_lr=]
:type shapelets: array of size (n,3)
:param coordPolar: set of coordinates in polar units
:type coordPolar: array of size (n,2)
:returns: array of same si... | https://github.com/sibirrer/lenstronomy/blob/4edb100a4f3f4fdc4fac9b0032d2b0283d0aa1d6/lenstronomy/LensModel/Profiles/shapelet_pot_cartesian.py#L92-L118 |
sibirrer/lenstronomy | lenstronomy/LensModel/Profiles/shapelet_pot_cartesian.py | CartShapelets._dx_shapelets | def _dx_shapelets(self, shapelets, beta):
"""
computes the derivative d/dx of the shapelet coeffs
:param shapelets:
:param beta:
:return:
"""
num_n = len(shapelets)
dx = np.zeros((num_n+1, num_n+1))
for n1 in range(num_n):
for n2 in ran... | python | def _dx_shapelets(self, shapelets, beta):
"""
computes the derivative d/dx of the shapelet coeffs
:param shapelets:
:param beta:
:return:
"""
num_n = len(shapelets)
dx = np.zeros((num_n+1, num_n+1))
for n1 in range(num_n):
for n2 in ran... | computes the derivative d/dx of the shapelet coeffs
:param shapelets:
:param beta:
:return: | https://github.com/sibirrer/lenstronomy/blob/4edb100a4f3f4fdc4fac9b0032d2b0283d0aa1d6/lenstronomy/LensModel/Profiles/shapelet_pot_cartesian.py#L137-L152 |
sibirrer/lenstronomy | lenstronomy/LensModel/Profiles/shapelet_pot_cartesian.py | CartShapelets._dy_shapelets | def _dy_shapelets(self, shapelets, beta):
"""
computes the derivative d/dx of the shapelet coeffs
:param shapelets:
:param beta:
:return:
"""
num_n = len(shapelets)
dy = np.zeros((num_n+1, num_n+1))
for n1 in range(num_n):
for n2 in ran... | python | def _dy_shapelets(self, shapelets, beta):
"""
computes the derivative d/dx of the shapelet coeffs
:param shapelets:
:param beta:
:return:
"""
num_n = len(shapelets)
dy = np.zeros((num_n+1, num_n+1))
for n1 in range(num_n):
for n2 in ran... | computes the derivative d/dx of the shapelet coeffs
:param shapelets:
:param beta:
:return: | https://github.com/sibirrer/lenstronomy/blob/4edb100a4f3f4fdc4fac9b0032d2b0283d0aa1d6/lenstronomy/LensModel/Profiles/shapelet_pot_cartesian.py#L154-L169 |
sibirrer/lenstronomy | lenstronomy/LensModel/Profiles/shapelet_pot_cartesian.py | CartShapelets.H_n | def H_n(self, n, x):
"""
constructs the Hermite polynomial of order n at position x (dimensionless)
:param n: The n'the basis function.
:type name: int.
:param x: 1-dim position (dimensionless)
:type state: float or numpy array.
:returns: array-- H_n(x).
... | python | def H_n(self, n, x):
"""
constructs the Hermite polynomial of order n at position x (dimensionless)
:param n: The n'the basis function.
:type name: int.
:param x: 1-dim position (dimensionless)
:type state: float or numpy array.
:returns: array-- H_n(x).
... | constructs the Hermite polynomial of order n at position x (dimensionless)
:param n: The n'the basis function.
:type name: int.
:param x: 1-dim position (dimensionless)
:type state: float or numpy array.
:returns: array-- H_n(x).
:raises: AttributeError, KeyError | https://github.com/sibirrer/lenstronomy/blob/4edb100a4f3f4fdc4fac9b0032d2b0283d0aa1d6/lenstronomy/LensModel/Profiles/shapelet_pot_cartesian.py#L183-L196 |
sibirrer/lenstronomy | lenstronomy/LensModel/Profiles/shapelet_pot_cartesian.py | CartShapelets.phi_n | def phi_n(self,n,x):
"""
constructs the 1-dim basis function (formula (1) in Refregier et al. 2001)
:param n: The n'the basis function.
:type name: int.
:param x: 1-dim position (dimensionless)
:type state: float or numpy array.
:returns: array-- phi_n(x).
... | python | def phi_n(self,n,x):
"""
constructs the 1-dim basis function (formula (1) in Refregier et al. 2001)
:param n: The n'the basis function.
:type name: int.
:param x: 1-dim position (dimensionless)
:type state: float or numpy array.
:returns: array-- phi_n(x).
... | constructs the 1-dim basis function (formula (1) in Refregier et al. 2001)
:param n: The n'the basis function.
:type name: int.
:param x: 1-dim position (dimensionless)
:type state: float or numpy array.
:returns: array-- phi_n(x).
:raises: AttributeError, KeyError | https://github.com/sibirrer/lenstronomy/blob/4edb100a4f3f4fdc4fac9b0032d2b0283d0aa1d6/lenstronomy/LensModel/Profiles/shapelet_pot_cartesian.py#L198-L210 |
sibirrer/lenstronomy | lenstronomy/LensModel/Solver/solver2point.py | Solver2Point._extract_array | def _extract_array(self, kwargs_list):
"""
inverse of _update_kwargs
:param kwargs_list:
:return:
"""
lens_model = self._lens_mode_list[0]
if self._solver_type == 'CENTER':
center_x = kwargs_list[0]['center_x']
center_y = kwargs_list[0]['ce... | python | def _extract_array(self, kwargs_list):
"""
inverse of _update_kwargs
:param kwargs_list:
:return:
"""
lens_model = self._lens_mode_list[0]
if self._solver_type == 'CENTER':
center_x = kwargs_list[0]['center_x']
center_y = kwargs_list[0]['ce... | inverse of _update_kwargs
:param kwargs_list:
:return: | https://github.com/sibirrer/lenstronomy/blob/4edb100a4f3f4fdc4fac9b0032d2b0283d0aa1d6/lenstronomy/LensModel/Solver/solver2point.py#L130-L157 |
sibirrer/lenstronomy | lenstronomy/SimulationAPI/observation_api.py | SingleBand.background_noise | def background_noise(self):
"""
Gaussian sigma of noise level per pixel (in counts per second)
:return: sqrt(variance) of background noise level
"""
if self._background_noise is None:
return data_util.bkg_noise(self.read_noise, self._exposure_time, self.sky_brightnes... | python | def background_noise(self):
"""
Gaussian sigma of noise level per pixel (in counts per second)
:return: sqrt(variance) of background noise level
"""
if self._background_noise is None:
return data_util.bkg_noise(self.read_noise, self._exposure_time, self.sky_brightnes... | Gaussian sigma of noise level per pixel (in counts per second)
:return: sqrt(variance) of background noise level | https://github.com/sibirrer/lenstronomy/blob/4edb100a4f3f4fdc4fac9b0032d2b0283d0aa1d6/lenstronomy/SimulationAPI/observation_api.py#L111-L121 |
sibirrer/lenstronomy | lenstronomy/SimulationAPI/observation_api.py | SingleBand.scaled_exposure_time | def scaled_exposure_time(self):
"""
scaled "effective" exposure time of IID counts. This can be used by lenstronomy to estimate the Poisson errors
keeping the assumption that the counts are IIDs (even if they are not).
:return: scaled exposure time
"""
if self._data_coun... | python | def scaled_exposure_time(self):
"""
scaled "effective" exposure time of IID counts. This can be used by lenstronomy to estimate the Poisson errors
keeping the assumption that the counts are IIDs (even if they are not).
:return: scaled exposure time
"""
if self._data_coun... | scaled "effective" exposure time of IID counts. This can be used by lenstronomy to estimate the Poisson errors
keeping the assumption that the counts are IIDs (even if they are not).
:return: scaled exposure time | https://github.com/sibirrer/lenstronomy/blob/4edb100a4f3f4fdc4fac9b0032d2b0283d0aa1d6/lenstronomy/SimulationAPI/observation_api.py#L140-L151 |
sibirrer/lenstronomy | lenstronomy/SimulationAPI/observation_api.py | SingleBand.magnitude2cps | def magnitude2cps(self, magnitude):
"""
converts an apparent magnitude to counts per second (in units of the data)
The zero point of an instrument, by definition, is the magnitude of an object that produces one count
(or data number, DN) per second. The magnitude of an arbitrary object ... | python | def magnitude2cps(self, magnitude):
"""
converts an apparent magnitude to counts per second (in units of the data)
The zero point of an instrument, by definition, is the magnitude of an object that produces one count
(or data number, DN) per second. The magnitude of an arbitrary object ... | converts an apparent magnitude to counts per second (in units of the data)
The zero point of an instrument, by definition, is the magnitude of an object that produces one count
(or data number, DN) per second. The magnitude of an arbitrary object producing DN counts in an observation of
length ... | https://github.com/sibirrer/lenstronomy/blob/4edb100a4f3f4fdc4fac9b0032d2b0283d0aa1d6/lenstronomy/SimulationAPI/observation_api.py#L179-L195 |
sibirrer/lenstronomy | lenstronomy/LensModel/Profiles/p_jaffe.py | PJaffe.density | def density(self, r, rho0, Ra, Rs):
"""
computes the density
:param x:
:param y:
:param rho0:
:param Ra:
:param Rs:
:return:
"""
Ra, Rs = self._sort_ra_rs(Ra, Rs)
rho = rho0 / ((1 + (r / Ra) ** 2) * (1 + (r / Rs) ** 2))
retu... | python | def density(self, r, rho0, Ra, Rs):
"""
computes the density
:param x:
:param y:
:param rho0:
:param Ra:
:param Rs:
:return:
"""
Ra, Rs = self._sort_ra_rs(Ra, Rs)
rho = rho0 / ((1 + (r / Ra) ** 2) * (1 + (r / Rs) ** 2))
retu... | computes the density
:param x:
:param y:
:param rho0:
:param Ra:
:param Rs:
:return: | https://github.com/sibirrer/lenstronomy/blob/4edb100a4f3f4fdc4fac9b0032d2b0283d0aa1d6/lenstronomy/LensModel/Profiles/p_jaffe.py#L14-L26 |
sibirrer/lenstronomy | lenstronomy/LensModel/Profiles/p_jaffe.py | PJaffe.density_2d | def density_2d(self, x, y, rho0, Ra, Rs, center_x=0, center_y=0):
"""
projected density
:param x:
:param y:
:param rho0:
:param Ra:
:param Rs:
:param center_x:
:param center_y:
:return:
"""
Ra, Rs = self._sort_ra_rs(Ra, Rs)
... | python | def density_2d(self, x, y, rho0, Ra, Rs, center_x=0, center_y=0):
"""
projected density
:param x:
:param y:
:param rho0:
:param Ra:
:param Rs:
:param center_x:
:param center_y:
:return:
"""
Ra, Rs = self._sort_ra_rs(Ra, Rs)
... | projected density
:param x:
:param y:
:param rho0:
:param Ra:
:param Rs:
:param center_x:
:param center_y:
:return: | https://github.com/sibirrer/lenstronomy/blob/4edb100a4f3f4fdc4fac9b0032d2b0283d0aa1d6/lenstronomy/LensModel/Profiles/p_jaffe.py#L28-L46 |
sibirrer/lenstronomy | lenstronomy/LensModel/Profiles/p_jaffe.py | PJaffe.mass_3d | def mass_3d(self, r, rho0, Ra, Rs):
"""
mass enclosed a 3d sphere or radius r
:param r:
:param Ra:
:param Rs:
:return:
"""
m_3d = 4 * np.pi * rho0 * Ra ** 2 * Rs ** 2 / (Rs ** 2 - Ra ** 2) * (Rs * np.arctan(r / Rs) - Ra * np.arctan(r / Ra))
return ... | python | def mass_3d(self, r, rho0, Ra, Rs):
"""
mass enclosed a 3d sphere or radius r
:param r:
:param Ra:
:param Rs:
:return:
"""
m_3d = 4 * np.pi * rho0 * Ra ** 2 * Rs ** 2 / (Rs ** 2 - Ra ** 2) * (Rs * np.arctan(r / Rs) - Ra * np.arctan(r / Ra))
return ... | mass enclosed a 3d sphere or radius r
:param r:
:param Ra:
:param Rs:
:return: | https://github.com/sibirrer/lenstronomy/blob/4edb100a4f3f4fdc4fac9b0032d2b0283d0aa1d6/lenstronomy/LensModel/Profiles/p_jaffe.py#L48-L57 |
sibirrer/lenstronomy | lenstronomy/LensModel/Profiles/p_jaffe.py | PJaffe.mass_2d | def mass_2d(self, r, rho0, Ra, Rs):
"""
mass enclosed projected 2d sphere of radius r
:param r:
:param rho0:
:param Ra:
:param Rs:
:return:
"""
Ra, Rs = self._sort_ra_rs(Ra, Rs)
sigma0 = self.rho2sigma(rho0, Ra, Rs)
m_2d = 2 * np.pi... | python | def mass_2d(self, r, rho0, Ra, Rs):
"""
mass enclosed projected 2d sphere of radius r
:param r:
:param rho0:
:param Ra:
:param Rs:
:return:
"""
Ra, Rs = self._sort_ra_rs(Ra, Rs)
sigma0 = self.rho2sigma(rho0, Ra, Rs)
m_2d = 2 * np.pi... | mass enclosed projected 2d sphere of radius r
:param r:
:param rho0:
:param Ra:
:param Rs:
:return: | https://github.com/sibirrer/lenstronomy/blob/4edb100a4f3f4fdc4fac9b0032d2b0283d0aa1d6/lenstronomy/LensModel/Profiles/p_jaffe.py#L71-L83 |
sibirrer/lenstronomy | lenstronomy/LensModel/Profiles/p_jaffe.py | PJaffe.mass_tot | def mass_tot(self, rho0, Ra, Rs):
"""
total mass within the profile
:param rho0:
:param Ra:
:param Rs:
:return:
"""
Ra, Rs = self._sort_ra_rs(Ra, Rs)
sigma0 = self.rho2sigma(rho0, Ra, Rs)
m_tot = 2 * np.pi * sigma0 * Ra * Rs
return ... | python | def mass_tot(self, rho0, Ra, Rs):
"""
total mass within the profile
:param rho0:
:param Ra:
:param Rs:
:return:
"""
Ra, Rs = self._sort_ra_rs(Ra, Rs)
sigma0 = self.rho2sigma(rho0, Ra, Rs)
m_tot = 2 * np.pi * sigma0 * Ra * Rs
return ... | total mass within the profile
:param rho0:
:param Ra:
:param Rs:
:return: | https://github.com/sibirrer/lenstronomy/blob/4edb100a4f3f4fdc4fac9b0032d2b0283d0aa1d6/lenstronomy/LensModel/Profiles/p_jaffe.py#L85-L96 |
sibirrer/lenstronomy | lenstronomy/LensModel/Profiles/p_jaffe.py | PJaffe.grav_pot | def grav_pot(self, x, y, rho0, Ra, Rs, center_x=0, center_y=0):
"""
gravitational potential (modulo 4 pi G and rho0 in appropriate units)
:param x:
:param y:
:param rho0:
:param Ra:
:param Rs:
:param center_x:
:param center_y:
:return:
... | python | def grav_pot(self, x, y, rho0, Ra, Rs, center_x=0, center_y=0):
"""
gravitational potential (modulo 4 pi G and rho0 in appropriate units)
:param x:
:param y:
:param rho0:
:param Ra:
:param Rs:
:param center_x:
:param center_y:
:return:
... | gravitational potential (modulo 4 pi G and rho0 in appropriate units)
:param x:
:param y:
:param rho0:
:param Ra:
:param Rs:
:param center_x:
:param center_y:
:return: | https://github.com/sibirrer/lenstronomy/blob/4edb100a4f3f4fdc4fac9b0032d2b0283d0aa1d6/lenstronomy/LensModel/Profiles/p_jaffe.py#L98-L116 |
sibirrer/lenstronomy | lenstronomy/LensModel/Profiles/p_jaffe.py | PJaffe._f_A20 | def _f_A20(self, r_a, r_s):
"""
equation A20 in Eliasdottir (2013)
:param r_a: r/Ra
:param r_s: r/Rs
:return:
"""
return r_a/(1+np.sqrt(1 + r_a**2)) - r_s/(1+np.sqrt(1 + r_s**2)) | python | def _f_A20(self, r_a, r_s):
"""
equation A20 in Eliasdottir (2013)
:param r_a: r/Ra
:param r_s: r/Rs
:return:
"""
return r_a/(1+np.sqrt(1 + r_a**2)) - r_s/(1+np.sqrt(1 + r_s**2)) | equation A20 in Eliasdottir (2013)
:param r_a: r/Ra
:param r_s: r/Rs
:return: | https://github.com/sibirrer/lenstronomy/blob/4edb100a4f3f4fdc4fac9b0032d2b0283d0aa1d6/lenstronomy/LensModel/Profiles/p_jaffe.py#L195-L202 |
sibirrer/lenstronomy | lenstronomy/LensModel/Profiles/p_jaffe.py | PJaffe.rho2sigma | def rho2sigma(self, rho0, Ra, Rs):
"""
converts 3d density into 2d projected density parameter
:param rho0:
:param Ra:
:param Rs:
:return:
"""
return np.pi * rho0 * Ra * Rs / (Rs + Ra) | python | def rho2sigma(self, rho0, Ra, Rs):
"""
converts 3d density into 2d projected density parameter
:param rho0:
:param Ra:
:param Rs:
:return:
"""
return np.pi * rho0 * Ra * Rs / (Rs + Ra) | converts 3d density into 2d projected density parameter
:param rho0:
:param Ra:
:param Rs:
:return: | https://github.com/sibirrer/lenstronomy/blob/4edb100a4f3f4fdc4fac9b0032d2b0283d0aa1d6/lenstronomy/LensModel/Profiles/p_jaffe.py#L204-L212 |
sibirrer/lenstronomy | lenstronomy/Plots/plot_util.py | sqrt | def sqrt(inputArray, scale_min=None, scale_max=None):
"""Performs sqrt scaling of the input numpy array.
@type inputArray: numpy array
@param inputArray: image data array
@type scale_min: float
@param scale_min: minimum data value
@type scale_max: float
@param scale_max: maximum data value
... | python | def sqrt(inputArray, scale_min=None, scale_max=None):
"""Performs sqrt scaling of the input numpy array.
@type inputArray: numpy array
@param inputArray: image data array
@type scale_min: float
@param scale_min: minimum data value
@type scale_max: float
@param scale_max: maximum data value
... | Performs sqrt scaling of the input numpy array.
@type inputArray: numpy array
@param inputArray: image data array
@type scale_min: float
@param scale_min: minimum data value
@type scale_max: float
@param scale_max: maximum data value
@rtype: numpy array
@return: image data array | https://github.com/sibirrer/lenstronomy/blob/4edb100a4f3f4fdc4fac9b0032d2b0283d0aa1d6/lenstronomy/Plots/plot_util.py#L5-L33 |
sibirrer/lenstronomy | lenstronomy/Sampling/likelihood.py | LikelihoodModule.logL | def logL(self, args):
"""
routine to compute X2 given variable parameters for a MCMC/PSO chain
"""
#extract parameters
kwargs_lens, kwargs_source, kwargs_lens_light, kwargs_ps, kwargs_cosmo = self.param.args2kwargs(args)
#generate image and computes likelihood
sel... | python | def logL(self, args):
"""
routine to compute X2 given variable parameters for a MCMC/PSO chain
"""
#extract parameters
kwargs_lens, kwargs_source, kwargs_lens_light, kwargs_ps, kwargs_cosmo = self.param.args2kwargs(args)
#generate image and computes likelihood
sel... | routine to compute X2 given variable parameters for a MCMC/PSO chain | https://github.com/sibirrer/lenstronomy/blob/4edb100a4f3f4fdc4fac9b0032d2b0283d0aa1d6/lenstronomy/Sampling/likelihood.py#L96-L123 |
sibirrer/lenstronomy | lenstronomy/Sampling/likelihood.py | LikelihoodModule.check_bounds | def check_bounds(args, lowerLimit, upperLimit):
"""
checks whether the parameter vector has left its bound, if so, adds a big number
"""
penalty = 0
bound_hit = False
for i in range(0, len(args)):
if args[i] < lowerLimit[i] or args[i] > upperLimit[i]:
... | python | def check_bounds(args, lowerLimit, upperLimit):
"""
checks whether the parameter vector has left its bound, if so, adds a big number
"""
penalty = 0
bound_hit = False
for i in range(0, len(args)):
if args[i] < lowerLimit[i] or args[i] > upperLimit[i]:
... | checks whether the parameter vector has left its bound, if so, adds a big number | https://github.com/sibirrer/lenstronomy/blob/4edb100a4f3f4fdc4fac9b0032d2b0283d0aa1d6/lenstronomy/Sampling/likelihood.py#L126-L136 |
sibirrer/lenstronomy | lenstronomy/Sampling/likelihood.py | LikelihoodModule.effectiv_num_data_points | def effectiv_num_data_points(self, kwargs_lens, kwargs_source, kwargs_lens_light, kwargs_ps):
"""
returns the effective number of data points considered in the X2 estimation to compute the reduced X2 value
"""
num_linear = 0
if self._image_likelihood is True:
num_line... | python | def effectiv_num_data_points(self, kwargs_lens, kwargs_source, kwargs_lens_light, kwargs_ps):
"""
returns the effective number of data points considered in the X2 estimation to compute the reduced X2 value
"""
num_linear = 0
if self._image_likelihood is True:
num_line... | returns the effective number of data points considered in the X2 estimation to compute the reduced X2 value | https://github.com/sibirrer/lenstronomy/blob/4edb100a4f3f4fdc4fac9b0032d2b0283d0aa1d6/lenstronomy/Sampling/likelihood.py#L155-L163 |
sibirrer/lenstronomy | lenstronomy/ImSim/image2source_mapping.py | Image2SourceMapping.image2source | def image2source(self, x, y, kwargs_lens, idex_source):
"""
mapping of image plane to source plane coordinates
WARNING: for multi lens plane computations and multi source planes, this computation can be slow and should be
used as rarely as possible.
:param x: image plane coordin... | python | def image2source(self, x, y, kwargs_lens, idex_source):
"""
mapping of image plane to source plane coordinates
WARNING: for multi lens plane computations and multi source planes, this computation can be slow and should be
used as rarely as possible.
:param x: image plane coordin... | mapping of image plane to source plane coordinates
WARNING: for multi lens plane computations and multi source planes, this computation can be slow and should be
used as rarely as possible.
:param x: image plane coordinate
:param y: image plane coordinate
:param kwargs_lens: len... | https://github.com/sibirrer/lenstronomy/blob/4edb100a4f3f4fdc4fac9b0032d2b0283d0aa1d6/lenstronomy/ImSim/image2source_mapping.py#L55-L86 |
sibirrer/lenstronomy | lenstronomy/LensModel/Profiles/gaussian_kappa_ellipse.py | GaussianKappaEllipse.hessian | def hessian(self, x, y, amp, sigma, e1, e2, center_x=0, center_y=0):
"""
returns Hessian matrix of function d^2f/dx^2, d^f/dy^2, d^2/dxdy
"""
alpha_ra, alpha_dec = self.derivatives(x, y, amp, sigma, e1, e2, center_x, center_y)
diff = self._diff
alpha_ra_dx, alpha_dec_dx =... | python | def hessian(self, x, y, amp, sigma, e1, e2, center_x=0, center_y=0):
"""
returns Hessian matrix of function d^2f/dx^2, d^f/dy^2, d^2/dxdy
"""
alpha_ra, alpha_dec = self.derivatives(x, y, amp, sigma, e1, e2, center_x, center_y)
diff = self._diff
alpha_ra_dx, alpha_dec_dx =... | returns Hessian matrix of function d^2f/dx^2, d^f/dy^2, d^2/dxdy | https://github.com/sibirrer/lenstronomy/blob/4edb100a4f3f4fdc4fac9b0032d2b0283d0aa1d6/lenstronomy/LensModel/Profiles/gaussian_kappa_ellipse.py#L61-L74 |
sibirrer/lenstronomy | lenstronomy/GalKin/galkin_old.py | GalKinAnalytic.vel_disp | def vel_disp(self, kwargs_profile, kwargs_aperture, kwargs_light, kwargs_anisotropy, num=1000):
"""
computes the averaged LOS velocity dispersion in the slit (convolved)
:param gamma:
:param phi_E:
:param r_eff:
:param r_ani:
:param R_slit:
:param FWHM:
... | python | def vel_disp(self, kwargs_profile, kwargs_aperture, kwargs_light, kwargs_anisotropy, num=1000):
"""
computes the averaged LOS velocity dispersion in the slit (convolved)
:param gamma:
:param phi_E:
:param r_eff:
:param r_ani:
:param R_slit:
:param FWHM:
... | computes the averaged LOS velocity dispersion in the slit (convolved)
:param gamma:
:param phi_E:
:param r_eff:
:param r_ani:
:param R_slit:
:param FWHM:
:return: | https://github.com/sibirrer/lenstronomy/blob/4edb100a4f3f4fdc4fac9b0032d2b0283d0aa1d6/lenstronomy/GalKin/galkin_old.py#L30-L46 |
sibirrer/lenstronomy | lenstronomy/GalKin/galkin_old.py | GalKinAnalytic._vel_disp_one | def _vel_disp_one(self, kwargs_profile, kwargs_aperture, kwargs_light, kwargs_anisotropy):
"""
computes one realisation of the velocity dispersion realized in the slit
:param gamma:
:param rho0_r0_gamma:
:param r_eff:
:param r_ani:
:param R_slit:
:param dR... | python | def _vel_disp_one(self, kwargs_profile, kwargs_aperture, kwargs_light, kwargs_anisotropy):
"""
computes one realisation of the velocity dispersion realized in the slit
:param gamma:
:param rho0_r0_gamma:
:param r_eff:
:param r_ani:
:param R_slit:
:param dR... | computes one realisation of the velocity dispersion realized in the slit
:param gamma:
:param rho0_r0_gamma:
:param r_eff:
:param r_ani:
:param R_slit:
:param dR_slit:
:param FWHM:
:return: | https://github.com/sibirrer/lenstronomy/blob/4edb100a4f3f4fdc4fac9b0032d2b0283d0aa1d6/lenstronomy/GalKin/galkin_old.py#L48-L69 |
sibirrer/lenstronomy | lenstronomy/GalKin/galkin_old.py | GalKinAnalytic.sigma_s2 | def sigma_s2(self, r, R, kwargs_profile, kwargs_anisotropy, kwargs_light):
"""
projected velocity dispersion
:param r:
:param R:
:param r_ani:
:param a:
:param gamma:
:param phi_E:
:return:
"""
beta = self.anisotropy.beta_r(r, kwarg... | python | def sigma_s2(self, r, R, kwargs_profile, kwargs_anisotropy, kwargs_light):
"""
projected velocity dispersion
:param r:
:param R:
:param r_ani:
:param a:
:param gamma:
:param phi_E:
:return:
"""
beta = self.anisotropy.beta_r(r, kwarg... | projected velocity dispersion
:param r:
:param R:
:param r_ani:
:param a:
:param gamma:
:param phi_E:
:return: | https://github.com/sibirrer/lenstronomy/blob/4edb100a4f3f4fdc4fac9b0032d2b0283d0aa1d6/lenstronomy/GalKin/galkin_old.py#L71-L83 |
sibirrer/lenstronomy | lenstronomy/GalKin/galkin_old.py | GalKinAnalytic.sigma_r2 | def sigma_r2(self, r, kwargs_profile, kwargs_anisotropy, kwargs_light):
"""
computes radial velocity dispersion at radius r (solving the Jeans equation
:param r:
:return:
"""
return self.jeans_solver.sigma_r2(r, kwargs_profile, kwargs_anisotropy, kwargs_light) | python | def sigma_r2(self, r, kwargs_profile, kwargs_anisotropy, kwargs_light):
"""
computes radial velocity dispersion at radius r (solving the Jeans equation
:param r:
:return:
"""
return self.jeans_solver.sigma_r2(r, kwargs_profile, kwargs_anisotropy, kwargs_light) | computes radial velocity dispersion at radius r (solving the Jeans equation
:param r:
:return: | https://github.com/sibirrer/lenstronomy/blob/4edb100a4f3f4fdc4fac9b0032d2b0283d0aa1d6/lenstronomy/GalKin/galkin_old.py#L85-L91 |
sibirrer/lenstronomy | lenstronomy/GalKin/jeans_equation.py | JeansSolver.power_law_anisotropy | def power_law_anisotropy(self, r, kwargs_profile, kwargs_anisotropy, kwargs_light):
"""
equation (19) in Suyu+ 2010
:param r:
:return:
"""
# first term
theta_E = kwargs_profile['theta_E']
gamma = kwargs_profile['gamma']
r_ani = kwargs_anisotropy['r... | python | def power_law_anisotropy(self, r, kwargs_profile, kwargs_anisotropy, kwargs_light):
"""
equation (19) in Suyu+ 2010
:param r:
:return:
"""
# first term
theta_E = kwargs_profile['theta_E']
gamma = kwargs_profile['gamma']
r_ani = kwargs_anisotropy['r... | equation (19) in Suyu+ 2010
:param r:
:return: | https://github.com/sibirrer/lenstronomy/blob/4edb100a4f3f4fdc4fac9b0032d2b0283d0aa1d6/lenstronomy/GalKin/jeans_equation.py#L18-L36 |
sibirrer/lenstronomy | lenstronomy/GalKin/jeans_equation.py | JeansSolver.sigma_r2 | def sigma_r2(self, r, kwargs_profile, kwargs_anisotropy, kwargs_light):
"""
solves radial Jeans equation
"""
if self._mass_profile == 'power_law':
if self._anisotropy_type == 'r_ani':
if self._light_profile == 'Hernquist':
sigma_r = self.po... | python | def sigma_r2(self, r, kwargs_profile, kwargs_anisotropy, kwargs_light):
"""
solves radial Jeans equation
"""
if self._mass_profile == 'power_law':
if self._anisotropy_type == 'r_ani':
if self._light_profile == 'Hernquist':
sigma_r = self.po... | solves radial Jeans equation | https://github.com/sibirrer/lenstronomy/blob/4edb100a4f3f4fdc4fac9b0032d2b0283d0aa1d6/lenstronomy/GalKin/jeans_equation.py#L42-L56 |
sibirrer/lenstronomy | lenstronomy/GalKin/aperture.py | Aperture.aperture_select | def aperture_select(self, ra, dec, kwargs_aperture):
"""
returns a bool list if the coordinate is within the aperture (list)
:param ra:
:param dec:
:return:
"""
if self._aperture_type == 'shell':
bool_list = self.shell_select(ra, dec, **kwargs_aperture... | python | def aperture_select(self, ra, dec, kwargs_aperture):
"""
returns a bool list if the coordinate is within the aperture (list)
:param ra:
:param dec:
:return:
"""
if self._aperture_type == 'shell':
bool_list = self.shell_select(ra, dec, **kwargs_aperture... | returns a bool list if the coordinate is within the aperture (list)
:param ra:
:param dec:
:return: | https://github.com/sibirrer/lenstronomy/blob/4edb100a4f3f4fdc4fac9b0032d2b0283d0aa1d6/lenstronomy/GalKin/aperture.py#L24-L37 |
sibirrer/lenstronomy | lenstronomy/ImSim/MultiBand/multiband.py | MultiBand.image_linear_solve | def image_linear_solve(self, kwargs_lens, kwargs_source, kwargs_lens_light, kwargs_else, inv_bool=False):
"""
computes the image (lens and source surface brightness with a given lens model).
The linear parameters are computed with a weighted linear least square optimization (i.e. flux normalizat... | python | def image_linear_solve(self, kwargs_lens, kwargs_source, kwargs_lens_light, kwargs_else, inv_bool=False):
"""
computes the image (lens and source surface brightness with a given lens model).
The linear parameters are computed with a weighted linear least square optimization (i.e. flux normalizat... | computes the image (lens and source surface brightness with a given lens model).
The linear parameters are computed with a weighted linear least square optimization (i.e. flux normalization of the brightness profiles)
:param kwargs_lens: list of keyword arguments corresponding to the superposition of di... | https://github.com/sibirrer/lenstronomy/blob/4edb100a4f3f4fdc4fac9b0032d2b0283d0aa1d6/lenstronomy/ImSim/MultiBand/multiband.py#L30-L52 |
sibirrer/lenstronomy | lenstronomy/ImSim/MultiBand/multiband.py | MultiBand.likelihood_data_given_model | def likelihood_data_given_model(self, kwargs_lens, kwargs_source, kwargs_lens_light, kwargs_ps, source_marg=False):
"""
computes the likelihood of the data given a model
This is specified with the non-linear parameters and a linear inversion and prior marginalisation.
:param kwargs_lens:... | python | def likelihood_data_given_model(self, kwargs_lens, kwargs_source, kwargs_lens_light, kwargs_ps, source_marg=False):
"""
computes the likelihood of the data given a model
This is specified with the non-linear parameters and a linear inversion and prior marginalisation.
:param kwargs_lens:... | computes the likelihood of the data given a model
This is specified with the non-linear parameters and a linear inversion and prior marginalisation.
:param kwargs_lens:
:param kwargs_source:
:param kwargs_lens_light:
:param kwargs_ps:
:return: log likelihood (natural loga... | https://github.com/sibirrer/lenstronomy/blob/4edb100a4f3f4fdc4fac9b0032d2b0283d0aa1d6/lenstronomy/ImSim/MultiBand/multiband.py#L54-L71 |
sibirrer/lenstronomy | lenstronomy/ImSim/MultiBand/multi_frame.py | MultiFrame.image_linear_solve | def image_linear_solve(self, kwargs_lens, kwargs_source, kwargs_lens_light, kwargs_ps, inv_bool=False):
"""
computes the image (lens and source surface brightness with a given lens model).
The linear parameters are computed with a weighted linear least square optimization (i.e. flux normalizatio... | python | def image_linear_solve(self, kwargs_lens, kwargs_source, kwargs_lens_light, kwargs_ps, inv_bool=False):
"""
computes the image (lens and source surface brightness with a given lens model).
The linear parameters are computed with a weighted linear least square optimization (i.e. flux normalizatio... | computes the image (lens and source surface brightness with a given lens model).
The linear parameters are computed with a weighted linear least square optimization (i.e. flux normalization of the brightness profiles)
:param kwargs_lens: list of keyword arguments corresponding to the superposition of di... | https://github.com/sibirrer/lenstronomy/blob/4edb100a4f3f4fdc4fac9b0032d2b0283d0aa1d6/lenstronomy/ImSim/MultiBand/multi_frame.py#L50-L68 |
sibirrer/lenstronomy | lenstronomy/ImSim/MultiBand/multi_frame.py | MultiFrame.error_response | def error_response(self, kwargs_lens, kwargs_ps):
"""
returns the 1d array of the error estimate corresponding to the data response
:return: 1d numpy array of response, 2d array of additonal errors (e.g. point source uncertainties)
"""
C_D_response, model_error = [], []
... | python | def error_response(self, kwargs_lens, kwargs_ps):
"""
returns the 1d array of the error estimate corresponding to the data response
:return: 1d numpy array of response, 2d array of additonal errors (e.g. point source uncertainties)
"""
C_D_response, model_error = [], []
... | returns the 1d array of the error estimate corresponding to the data response
:return: 1d numpy array of response, 2d array of additonal errors (e.g. point source uncertainties) | https://github.com/sibirrer/lenstronomy/blob/4edb100a4f3f4fdc4fac9b0032d2b0283d0aa1d6/lenstronomy/ImSim/MultiBand/multi_frame.py#L126-L142 |
sibirrer/lenstronomy | lenstronomy/LensModel/Profiles/gaussian_potential.py | Gaussian.function | def function(self, x, y, amp, sigma_x, sigma_y, center_x=0, center_y=0):
"""
returns Gaussian
"""
c = amp/(2*np.pi*sigma_x*sigma_y)
delta_x = x - center_x
delta_y = y - center_y
exponent = -((delta_x/sigma_x)**2+(delta_y/sigma_y)**2)/2.
return c * np.exp(e... | python | def function(self, x, y, amp, sigma_x, sigma_y, center_x=0, center_y=0):
"""
returns Gaussian
"""
c = amp/(2*np.pi*sigma_x*sigma_y)
delta_x = x - center_x
delta_y = y - center_y
exponent = -((delta_x/sigma_x)**2+(delta_y/sigma_y)**2)/2.
return c * np.exp(e... | returns Gaussian | https://github.com/sibirrer/lenstronomy/blob/4edb100a4f3f4fdc4fac9b0032d2b0283d0aa1d6/lenstronomy/LensModel/Profiles/gaussian_potential.py#L15-L23 |
sibirrer/lenstronomy | lenstronomy/LensModel/Profiles/gaussian_potential.py | Gaussian.derivatives | def derivatives(self, x, y, amp, sigma_x, sigma_y, center_x=0, center_y=0):
"""
returns df/dx and df/dy of the function
"""
f_ = self.function(x, y, amp, sigma_x, sigma_y, center_x, center_y)
return f_ * (center_x-x)/sigma_x**2, f_ * (center_y-y)/sigma_y**2 | python | def derivatives(self, x, y, amp, sigma_x, sigma_y, center_x=0, center_y=0):
"""
returns df/dx and df/dy of the function
"""
f_ = self.function(x, y, amp, sigma_x, sigma_y, center_x, center_y)
return f_ * (center_x-x)/sigma_x**2, f_ * (center_y-y)/sigma_y**2 | returns df/dx and df/dy of the function | https://github.com/sibirrer/lenstronomy/blob/4edb100a4f3f4fdc4fac9b0032d2b0283d0aa1d6/lenstronomy/LensModel/Profiles/gaussian_potential.py#L25-L30 |
sibirrer/lenstronomy | lenstronomy/LensModel/Profiles/gaussian_potential.py | Gaussian.hessian | def hessian(self, x, y, amp, sigma_x, sigma_y, center_x = 0, center_y = 0):
"""
returns Hessian matrix of function d^2f/dx^2, d^f/dy^2, d^2/dxdy
"""
f_ = self.function(x, y, amp, sigma_x, sigma_y, center_x, center_y)
f_xx = f_ * ( (-1./sigma_x**2) + (center_x-x)**2/sigma_x**4 )
... | python | def hessian(self, x, y, amp, sigma_x, sigma_y, center_x = 0, center_y = 0):
"""
returns Hessian matrix of function d^2f/dx^2, d^f/dy^2, d^2/dxdy
"""
f_ = self.function(x, y, amp, sigma_x, sigma_y, center_x, center_y)
f_xx = f_ * ( (-1./sigma_x**2) + (center_x-x)**2/sigma_x**4 )
... | returns Hessian matrix of function d^2f/dx^2, d^f/dy^2, d^2/dxdy | https://github.com/sibirrer/lenstronomy/blob/4edb100a4f3f4fdc4fac9b0032d2b0283d0aa1d6/lenstronomy/LensModel/Profiles/gaussian_potential.py#L32-L40 |
sibirrer/lenstronomy | lenstronomy/Cosmo/nfw_param.py | NFWParam.M200 | def M200(self, Rs, rho0, c):
"""
M(R_200) calculation for NFW profile
:param Rs: scale radius
:type Rs: float
:param rho0: density normalization (characteristic density)
:type rho0: float
:param c: concentration
:type c: float [4,40]
:return: M(R_... | python | def M200(self, Rs, rho0, c):
"""
M(R_200) calculation for NFW profile
:param Rs: scale radius
:type Rs: float
:param rho0: density normalization (characteristic density)
:type rho0: float
:param c: concentration
:type c: float [4,40]
:return: M(R_... | M(R_200) calculation for NFW profile
:param Rs: scale radius
:type Rs: float
:param rho0: density normalization (characteristic density)
:type rho0: float
:param c: concentration
:type c: float [4,40]
:return: M(R_200) density | https://github.com/sibirrer/lenstronomy/blob/4edb100a4f3f4fdc4fac9b0032d2b0283d0aa1d6/lenstronomy/Cosmo/nfw_param.py#L20-L32 |
sibirrer/lenstronomy | lenstronomy/Cosmo/nfw_param.py | NFWParam.rho0_c | def rho0_c(self, c):
"""
computes density normalization as a function of concentration parameter
:return: density normalization in h^2/Mpc^3 (comoving)
"""
return 200./3*self.rhoc*c**3/(np.log(1.+c)-c/(1.+c)) | python | def rho0_c(self, c):
"""
computes density normalization as a function of concentration parameter
:return: density normalization in h^2/Mpc^3 (comoving)
"""
return 200./3*self.rhoc*c**3/(np.log(1.+c)-c/(1.+c)) | computes density normalization as a function of concentration parameter
:return: density normalization in h^2/Mpc^3 (comoving) | https://github.com/sibirrer/lenstronomy/blob/4edb100a4f3f4fdc4fac9b0032d2b0283d0aa1d6/lenstronomy/Cosmo/nfw_param.py#L52-L57 |
sibirrer/lenstronomy | lenstronomy/Cosmo/nfw_param.py | NFWParam.c_rho0 | def c_rho0(self, rho0):
"""
computes the concentration given a comoving overdensity rho0 (inverse of function rho0_c)
:param rho0: density normalization in h^2/Mpc^3 (comoving)
:return: concentration parameter c
"""
if not hasattr(self, '_c_rho0_interp'):
c_ar... | python | def c_rho0(self, rho0):
"""
computes the concentration given a comoving overdensity rho0 (inverse of function rho0_c)
:param rho0: density normalization in h^2/Mpc^3 (comoving)
:return: concentration parameter c
"""
if not hasattr(self, '_c_rho0_interp'):
c_ar... | computes the concentration given a comoving overdensity rho0 (inverse of function rho0_c)
:param rho0: density normalization in h^2/Mpc^3 (comoving)
:return: concentration parameter c | https://github.com/sibirrer/lenstronomy/blob/4edb100a4f3f4fdc4fac9b0032d2b0283d0aa1d6/lenstronomy/Cosmo/nfw_param.py#L59-L70 |
sibirrer/lenstronomy | lenstronomy/Cosmo/nfw_param.py | NFWParam.c_M_z | def c_M_z(self, M, z):
"""
fitting function of http://moriond.in2p3.fr/J08/proceedings/duffy.pdf for the mass and redshift dependence of the concentration parameter
:param M: halo mass in M_sun/h
:type M: float or numpy array
:param z: redshift
:type z: float >0
... | python | def c_M_z(self, M, z):
"""
fitting function of http://moriond.in2p3.fr/J08/proceedings/duffy.pdf for the mass and redshift dependence of the concentration parameter
:param M: halo mass in M_sun/h
:type M: float or numpy array
:param z: redshift
:type z: float >0
... | fitting function of http://moriond.in2p3.fr/J08/proceedings/duffy.pdf for the mass and redshift dependence of the concentration parameter
:param M: halo mass in M_sun/h
:type M: float or numpy array
:param z: redshift
:type z: float >0
:return: concentration parameter as float | https://github.com/sibirrer/lenstronomy/blob/4edb100a4f3f4fdc4fac9b0032d2b0283d0aa1d6/lenstronomy/Cosmo/nfw_param.py#L72-L87 |
sibirrer/lenstronomy | lenstronomy/Cosmo/nfw_param.py | NFWParam.profileMain | def profileMain(self, M, z):
"""
returns all needed parameter (in comoving units modulo h) to draw the profile of the main halo
r200 in co-moving Mpc/h
rho_s in h^2/Mpc^3 (co-moving)
Rs in Mpc/h co-moving
c unit less
"""
c = self.c_M_z(M, z)
r200 ... | python | def profileMain(self, M, z):
"""
returns all needed parameter (in comoving units modulo h) to draw the profile of the main halo
r200 in co-moving Mpc/h
rho_s in h^2/Mpc^3 (co-moving)
Rs in Mpc/h co-moving
c unit less
"""
c = self.c_M_z(M, z)
r200 ... | returns all needed parameter (in comoving units modulo h) to draw the profile of the main halo
r200 in co-moving Mpc/h
rho_s in h^2/Mpc^3 (co-moving)
Rs in Mpc/h co-moving
c unit less | https://github.com/sibirrer/lenstronomy/blob/4edb100a4f3f4fdc4fac9b0032d2b0283d0aa1d6/lenstronomy/Cosmo/nfw_param.py#L89-L101 |
sibirrer/lenstronomy | lenstronomy/Workflow/psf_fitting.py | PsfFitting.image_single_point_source | def image_single_point_source(self, image_model_class, kwargs_lens, kwargs_source, kwargs_lens_light,
kwargs_ps):
"""
return model without including the point source contributions as a list (for each point source individually)
:param image_model_class: ImageMode... | python | def image_single_point_source(self, image_model_class, kwargs_lens, kwargs_source, kwargs_lens_light,
kwargs_ps):
"""
return model without including the point source contributions as a list (for each point source individually)
:param image_model_class: ImageMode... | return model without including the point source contributions as a list (for each point source individually)
:param image_model_class: ImageModel class instance
:param kwargs_lens: lens model kwargs list
:param kwargs_source: source model kwargs list
:param kwargs_lens_light: lens light ... | https://github.com/sibirrer/lenstronomy/blob/4edb100a4f3f4fdc4fac9b0032d2b0283d0aa1d6/lenstronomy/Workflow/psf_fitting.py#L146-L169 |
sibirrer/lenstronomy | lenstronomy/Workflow/psf_fitting.py | PsfFitting.combine_psf | def combine_psf(kernel_list_new, kernel_old, sigma_bkg, factor=1, stacking_option='median', symmetry=1):
"""
updates psf estimate based on old kernel and several new estimates
:param kernel_list_new: list of new PSF kernels estimated from the point sources in the image
:param kernel_old:... | python | def combine_psf(kernel_list_new, kernel_old, sigma_bkg, factor=1, stacking_option='median', symmetry=1):
"""
updates psf estimate based on old kernel and several new estimates
:param kernel_list_new: list of new PSF kernels estimated from the point sources in the image
:param kernel_old:... | updates psf estimate based on old kernel and several new estimates
:param kernel_list_new: list of new PSF kernels estimated from the point sources in the image
:param kernel_old: old PSF kernel
:param sigma_bkg: estimated background noise in the image
:param factor: weight of updated es... | https://github.com/sibirrer/lenstronomy/blob/4edb100a4f3f4fdc4fac9b0032d2b0283d0aa1d6/lenstronomy/Workflow/psf_fitting.py#L235-L278 |
sibirrer/lenstronomy | lenstronomy/Cosmo/kde_likelihood.py | KDELikelihood.logLikelihood | def logLikelihood(self, D_d, D_delta_t):
"""
likelihood of the data (represented in the distribution of this class) given a model with predicted angular
diameter distances.
:param D_d: model predicted angular diameter distance
:param D_delta_t: model predicted time-delay distanc... | python | def logLikelihood(self, D_d, D_delta_t):
"""
likelihood of the data (represented in the distribution of this class) given a model with predicted angular
diameter distances.
:param D_d: model predicted angular diameter distance
:param D_delta_t: model predicted time-delay distanc... | likelihood of the data (represented in the distribution of this class) given a model with predicted angular
diameter distances.
:param D_d: model predicted angular diameter distance
:param D_delta_t: model predicted time-delay distance
:return: loglikelihood (log of KDE value) | https://github.com/sibirrer/lenstronomy/blob/4edb100a4f3f4fdc4fac9b0032d2b0283d0aa1d6/lenstronomy/Cosmo/kde_likelihood.py#L32-L47 |
sibirrer/lenstronomy | lenstronomy/LensModel/Profiles/hernquist.py | Hernquist.density | def density(self, r, rho0, Rs):
"""
computes the density
:param x:
:param y:
:param rho0:
:param a:
:param s:
:return:
"""
rho = rho0 / (r/Rs * (1 + (r/Rs))**3)
return rho | python | def density(self, r, rho0, Rs):
"""
computes the density
:param x:
:param y:
:param rho0:
:param a:
:param s:
:return:
"""
rho = rho0 / (r/Rs * (1 + (r/Rs))**3)
return rho | computes the density
:param x:
:param y:
:param rho0:
:param a:
:param s:
:return: | https://github.com/sibirrer/lenstronomy/blob/4edb100a4f3f4fdc4fac9b0032d2b0283d0aa1d6/lenstronomy/LensModel/Profiles/hernquist.py#L14-L25 |
sibirrer/lenstronomy | lenstronomy/LensModel/Profiles/hernquist.py | Hernquist.density_2d | def density_2d(self, x, y, rho0, Rs, center_x=0, center_y=0):
"""
projected density
:param x:
:param y:
:param rho0:
:param a:
:param s:
:param center_x:
:param center_y:
:return:
"""
x_ = x - center_x
y_ = y - cente... | python | def density_2d(self, x, y, rho0, Rs, center_x=0, center_y=0):
"""
projected density
:param x:
:param y:
:param rho0:
:param a:
:param s:
:param center_x:
:param center_y:
:return:
"""
x_ = x - center_x
y_ = y - cente... | projected density
:param x:
:param y:
:param rho0:
:param a:
:param s:
:param center_x:
:param center_y:
:return: | https://github.com/sibirrer/lenstronomy/blob/4edb100a4f3f4fdc4fac9b0032d2b0283d0aa1d6/lenstronomy/LensModel/Profiles/hernquist.py#L27-L50 |
sibirrer/lenstronomy | lenstronomy/LensModel/Profiles/hernquist.py | Hernquist.mass_3d | def mass_3d(self, r, rho0, Rs):
"""
mass enclosed a 3d sphere or radius r
:param r:
:param a:
:param s:
:return:
"""
mass_3d = 2*np.pi*Rs**3*rho0 * r**2/(r + Rs)**2
return mass_3d | python | def mass_3d(self, r, rho0, Rs):
"""
mass enclosed a 3d sphere or radius r
:param r:
:param a:
:param s:
:return:
"""
mass_3d = 2*np.pi*Rs**3*rho0 * r**2/(r + Rs)**2
return mass_3d | mass enclosed a 3d sphere or radius r
:param r:
:param a:
:param s:
:return: | https://github.com/sibirrer/lenstronomy/blob/4edb100a4f3f4fdc4fac9b0032d2b0283d0aa1d6/lenstronomy/LensModel/Profiles/hernquist.py#L84-L93 |
sibirrer/lenstronomy | lenstronomy/LensModel/Profiles/hernquist.py | Hernquist.mass_3d_lens | def mass_3d_lens(self, r, sigma0, Rs):
"""
mass enclosed a 3d sphere or radius r for lens parameterisation
:param sigma0:
:param Rs:
:return:
"""
rho0 = self.sigma2rho(sigma0, Rs)
return self.mass_3d(r, rho0, Rs) | python | def mass_3d_lens(self, r, sigma0, Rs):
"""
mass enclosed a 3d sphere or radius r for lens parameterisation
:param sigma0:
:param Rs:
:return:
"""
rho0 = self.sigma2rho(sigma0, Rs)
return self.mass_3d(r, rho0, Rs) | mass enclosed a 3d sphere or radius r for lens parameterisation
:param sigma0:
:param Rs:
:return: | https://github.com/sibirrer/lenstronomy/blob/4edb100a4f3f4fdc4fac9b0032d2b0283d0aa1d6/lenstronomy/LensModel/Profiles/hernquist.py#L95-L103 |
sibirrer/lenstronomy | lenstronomy/LensModel/Profiles/hernquist.py | Hernquist.mass_2d | def mass_2d(self, r, rho0, Rs):
"""
mass enclosed projected 2d sphere of radius r
:param r:
:param rho0:
:param a:
:param s:
:return:
"""
sigma0 = self.rho2sigma(rho0, Rs)
return self.mass_2d_lens(r, sigma0, Rs) | python | def mass_2d(self, r, rho0, Rs):
"""
mass enclosed projected 2d sphere of radius r
:param r:
:param rho0:
:param a:
:param s:
:return:
"""
sigma0 = self.rho2sigma(rho0, Rs)
return self.mass_2d_lens(r, sigma0, Rs) | mass enclosed projected 2d sphere of radius r
:param r:
:param rho0:
:param a:
:param s:
:return: | https://github.com/sibirrer/lenstronomy/blob/4edb100a4f3f4fdc4fac9b0032d2b0283d0aa1d6/lenstronomy/LensModel/Profiles/hernquist.py#L105-L116 |
sibirrer/lenstronomy | lenstronomy/LensModel/Profiles/hernquist.py | Hernquist.mass_2d_lens | def mass_2d_lens(self, r, sigma0, Rs):
"""
mass enclosed projected 2d sphere of radius r
:param r:
:param rho0:
:param a:
:param s:
:return:
"""
X = r/Rs
alpha_r = 2*sigma0 * Rs * X * (1-self._F(X)) / (X**2-1)
mass_2d = alpha_r * r ... | python | def mass_2d_lens(self, r, sigma0, Rs):
"""
mass enclosed projected 2d sphere of radius r
:param r:
:param rho0:
:param a:
:param s:
:return:
"""
X = r/Rs
alpha_r = 2*sigma0 * Rs * X * (1-self._F(X)) / (X**2-1)
mass_2d = alpha_r * r ... | mass enclosed projected 2d sphere of radius r
:param r:
:param rho0:
:param a:
:param s:
:return: | https://github.com/sibirrer/lenstronomy/blob/4edb100a4f3f4fdc4fac9b0032d2b0283d0aa1d6/lenstronomy/LensModel/Profiles/hernquist.py#L118-L130 |
sibirrer/lenstronomy | lenstronomy/LensModel/Profiles/hernquist.py | Hernquist.mass_tot | def mass_tot(self, rho0, Rs):
"""
total mass within the profile
:param rho0:
:param a:
:param s:
:return:
"""
m_tot = 2*np.pi*rho0*Rs**3
return m_tot | python | def mass_tot(self, rho0, Rs):
"""
total mass within the profile
:param rho0:
:param a:
:param s:
:return:
"""
m_tot = 2*np.pi*rho0*Rs**3
return m_tot | total mass within the profile
:param rho0:
:param a:
:param s:
:return: | https://github.com/sibirrer/lenstronomy/blob/4edb100a4f3f4fdc4fac9b0032d2b0283d0aa1d6/lenstronomy/LensModel/Profiles/hernquist.py#L132-L141 |
sibirrer/lenstronomy | lenstronomy/LensModel/Profiles/hernquist.py | Hernquist.grav_pot | def grav_pot(self, x, y, rho0, Rs, center_x=0, center_y=0):
"""
gravitational potential (modulo 4 pi G and rho0 in appropriate units)
:param x:
:param y:
:param rho0:
:param a:
:param s:
:param center_x:
:param center_y:
:return:
""... | python | def grav_pot(self, x, y, rho0, Rs, center_x=0, center_y=0):
"""
gravitational potential (modulo 4 pi G and rho0 in appropriate units)
:param x:
:param y:
:param rho0:
:param a:
:param s:
:param center_x:
:param center_y:
:return:
""... | gravitational potential (modulo 4 pi G and rho0 in appropriate units)
:param x:
:param y:
:param rho0:
:param a:
:param s:
:param center_x:
:param center_y:
:return: | https://github.com/sibirrer/lenstronomy/blob/4edb100a4f3f4fdc4fac9b0032d2b0283d0aa1d6/lenstronomy/LensModel/Profiles/hernquist.py#L143-L160 |
sibirrer/lenstronomy | lenstronomy/LensModel/Profiles/hernquist.py | Hernquist.function | def function(self, x, y, sigma0, Rs, center_x=0, center_y=0):
"""
lensing potential
:param x:
:param y:
:param sigma0: sigma0/sigma_crit
:param a:
:param s:
:param center_x:
:param center_y:
:return:
"""
x_ = x - center_x
... | python | def function(self, x, y, sigma0, Rs, center_x=0, center_y=0):
"""
lensing potential
:param x:
:param y:
:param sigma0: sigma0/sigma_crit
:param a:
:param s:
:param center_x:
:param center_y:
:return:
"""
x_ = x - center_x
... | lensing potential
:param x:
:param y:
:param sigma0: sigma0/sigma_crit
:param a:
:param s:
:param center_x:
:param center_y:
:return: | https://github.com/sibirrer/lenstronomy/blob/4edb100a4f3f4fdc4fac9b0032d2b0283d0aa1d6/lenstronomy/LensModel/Profiles/hernquist.py#L162-L183 |
sibirrer/lenstronomy | lenstronomy/LensModel/lens_model.py | LensModel.ray_shooting | def ray_shooting(self, x, y, kwargs, k=None):
"""
maps image to source position (inverse deflection)
:param x: x-position (preferentially arcsec)
:type x: numpy array
:param y: y-position (preferentially arcsec)
:type y: numpy array
:param kwargs: list of keyword... | python | def ray_shooting(self, x, y, kwargs, k=None):
"""
maps image to source position (inverse deflection)
:param x: x-position (preferentially arcsec)
:type x: numpy array
:param y: y-position (preferentially arcsec)
:type y: numpy array
:param kwargs: list of keyword... | maps image to source position (inverse deflection)
:param x: x-position (preferentially arcsec)
:type x: numpy array
:param y: y-position (preferentially arcsec)
:type y: numpy array
:param kwargs: list of keyword arguments of lens model parameters matching the lens model classe... | https://github.com/sibirrer/lenstronomy/blob/4edb100a4f3f4fdc4fac9b0032d2b0283d0aa1d6/lenstronomy/LensModel/lens_model.py#L43-L55 |
sibirrer/lenstronomy | lenstronomy/LensModel/lens_model.py | LensModel.fermat_potential | def fermat_potential(self, x_image, y_image, x_source, y_source, kwargs_lens):
"""
fermat potential (negative sign means earlier arrival time)
:param x_image: image position
:param y_image: image position
:param x_source: source position
:param y_source: source position
... | python | def fermat_potential(self, x_image, y_image, x_source, y_source, kwargs_lens):
"""
fermat potential (negative sign means earlier arrival time)
:param x_image: image position
:param y_image: image position
:param x_source: source position
:param y_source: source position
... | fermat potential (negative sign means earlier arrival time)
:param x_image: image position
:param y_image: image position
:param x_source: source position
:param y_source: source position
:param kwargs_lens: list of keyword arguments of lens model parameters matching the lens mo... | https://github.com/sibirrer/lenstronomy/blob/4edb100a4f3f4fdc4fac9b0032d2b0283d0aa1d6/lenstronomy/LensModel/lens_model.py#L57-L71 |
sibirrer/lenstronomy | lenstronomy/LensModel/lens_model.py | LensModel.potential | def potential(self, x, y, kwargs, k=None):
"""
lensing potential
:param x: x-position (preferentially arcsec)
:type x: numpy array
:param y: y-position (preferentially arcsec)
:type y: numpy array
:param kwargs: list of keyword arguments of lens model parameters ... | python | def potential(self, x, y, kwargs, k=None):
"""
lensing potential
:param x: x-position (preferentially arcsec)
:type x: numpy array
:param y: y-position (preferentially arcsec)
:type y: numpy array
:param kwargs: list of keyword arguments of lens model parameters ... | lensing potential
:param x: x-position (preferentially arcsec)
:type x: numpy array
:param y: y-position (preferentially arcsec)
:type y: numpy array
:param kwargs: list of keyword arguments of lens model parameters matching the lens model classes
:param k: only evaluate... | https://github.com/sibirrer/lenstronomy/blob/4edb100a4f3f4fdc4fac9b0032d2b0283d0aa1d6/lenstronomy/LensModel/lens_model.py#L91-L103 |
sibirrer/lenstronomy | lenstronomy/LensModel/lens_model.py | LensModel.alpha | def alpha(self, x, y, kwargs, k=None):
"""
deflection angles
:param x: x-position (preferentially arcsec)
:type x: numpy array
:param y: y-position (preferentially arcsec)
:type y: numpy array
:param kwargs: list of keyword arguments of lens model parameters matc... | python | def alpha(self, x, y, kwargs, k=None):
"""
deflection angles
:param x: x-position (preferentially arcsec)
:type x: numpy array
:param y: y-position (preferentially arcsec)
:type y: numpy array
:param kwargs: list of keyword arguments of lens model parameters matc... | deflection angles
:param x: x-position (preferentially arcsec)
:type x: numpy array
:param y: y-position (preferentially arcsec)
:type y: numpy array
:param kwargs: list of keyword arguments of lens model parameters matching the lens model classes
:param k: only evaluate... | https://github.com/sibirrer/lenstronomy/blob/4edb100a4f3f4fdc4fac9b0032d2b0283d0aa1d6/lenstronomy/LensModel/lens_model.py#L105-L117 |
sibirrer/lenstronomy | lenstronomy/LensModel/lens_model.py | LensModel.hessian | def hessian(self, x, y, kwargs, k=None):
"""
hessian matrix
:param x: x-position (preferentially arcsec)
:type x: numpy array
:param y: y-position (preferentially arcsec)
:type y: numpy array
:param kwargs: list of keyword arguments of lens model parameters match... | python | def hessian(self, x, y, kwargs, k=None):
"""
hessian matrix
:param x: x-position (preferentially arcsec)
:type x: numpy array
:param y: y-position (preferentially arcsec)
:type y: numpy array
:param kwargs: list of keyword arguments of lens model parameters match... | hessian matrix
:param x: x-position (preferentially arcsec)
:type x: numpy array
:param y: y-position (preferentially arcsec)
:type y: numpy array
:param kwargs: list of keyword arguments of lens model parameters matching the lens model classes
:param k: only evaluate th... | https://github.com/sibirrer/lenstronomy/blob/4edb100a4f3f4fdc4fac9b0032d2b0283d0aa1d6/lenstronomy/LensModel/lens_model.py#L119-L131 |
sibirrer/lenstronomy | lenstronomy/LensModel/lens_model.py | LensModel.flexion | def flexion(self, x, y, kwargs, diff=0.000001):
"""
third derivatives (flexion)
:param x: x-position (preferentially arcsec)
:type x: numpy array
:param y: y-position (preferentially arcsec)
:type y: numpy array
:param kwargs: list of keyword arguments of lens mo... | python | def flexion(self, x, y, kwargs, diff=0.000001):
"""
third derivatives (flexion)
:param x: x-position (preferentially arcsec)
:type x: numpy array
:param y: y-position (preferentially arcsec)
:type y: numpy array
:param kwargs: list of keyword arguments of lens mo... | third derivatives (flexion)
:param x: x-position (preferentially arcsec)
:type x: numpy array
:param y: y-position (preferentially arcsec)
:type y: numpy array
:param kwargs: list of keyword arguments of lens model parameters matching the lens model classes
:param diff: ... | https://github.com/sibirrer/lenstronomy/blob/4edb100a4f3f4fdc4fac9b0032d2b0283d0aa1d6/lenstronomy/LensModel/lens_model.py#L189-L210 |
sibirrer/lenstronomy | lenstronomy/Cosmo/cosmography.py | CosmoLikelihood.X2_chain_H0 | def X2_chain_H0(self, args):
"""
routine to compute X2 given variable parameters for a MCMC/PSO chain
"""
#extract parameters
H0 = args[0]
omega_m = self.omega_m_fixed
Ode0 = self._omega_lambda_fixed
logL, bool = self.prior_H0(H0)
if bool is True:
... | python | def X2_chain_H0(self, args):
"""
routine to compute X2 given variable parameters for a MCMC/PSO chain
"""
#extract parameters
H0 = args[0]
omega_m = self.omega_m_fixed
Ode0 = self._omega_lambda_fixed
logL, bool = self.prior_H0(H0)
if bool is True:
... | routine to compute X2 given variable parameters for a MCMC/PSO chain | https://github.com/sibirrer/lenstronomy/blob/4edb100a4f3f4fdc4fac9b0032d2b0283d0aa1d6/lenstronomy/Cosmo/cosmography.py#L37-L48 |
sibirrer/lenstronomy | lenstronomy/Cosmo/cosmography.py | CosmoLikelihood.X2_chain_omega_mh2 | def X2_chain_omega_mh2(self, args):
"""
routine to compute the log likelihood given a omega_m h**2 prior fixed
:param args:
:return:
"""
H0 = args[0]
h = H0/100.
omega_m = self.omega_mh2_fixed / h**2
Ode0 = self._omega_lambda_fixed
logL, bo... | python | def X2_chain_omega_mh2(self, args):
"""
routine to compute the log likelihood given a omega_m h**2 prior fixed
:param args:
:return:
"""
H0 = args[0]
h = H0/100.
omega_m = self.omega_mh2_fixed / h**2
Ode0 = self._omega_lambda_fixed
logL, bo... | routine to compute the log likelihood given a omega_m h**2 prior fixed
:param args:
:return: | https://github.com/sibirrer/lenstronomy/blob/4edb100a4f3f4fdc4fac9b0032d2b0283d0aa1d6/lenstronomy/Cosmo/cosmography.py#L50-L63 |
sibirrer/lenstronomy | lenstronomy/Cosmo/cosmography.py | CosmoLikelihood.X2_chain_H0_omgega_m | def X2_chain_H0_omgega_m(self, args):
"""
routine to compute X^2
:param args:
:return:
"""
#extract parameters
[H0, omega_m] = args
Ode0 = self._omega_lambda_fixed
logL_H0, bool_H0 = self.prior_H0(H0)
logL_omega_m, bool_omega_m = self.prior... | python | def X2_chain_H0_omgega_m(self, args):
"""
routine to compute X^2
:param args:
:return:
"""
#extract parameters
[H0, omega_m] = args
Ode0 = self._omega_lambda_fixed
logL_H0, bool_H0 = self.prior_H0(H0)
logL_omega_m, bool_omega_m = self.prior... | routine to compute X^2
:param args:
:return: | https://github.com/sibirrer/lenstronomy/blob/4edb100a4f3f4fdc4fac9b0032d2b0283d0aa1d6/lenstronomy/Cosmo/cosmography.py#L65-L79 |
sibirrer/lenstronomy | lenstronomy/Cosmo/cosmography.py | CosmoLikelihood.prior_H0 | def prior_H0(self, H0, H0_min=0, H0_max=200):
"""
checks whether the parameter vector has left its bound, if so, adds a big number
"""
if H0 < H0_min or H0 > H0_max:
penalty = -10**15
return penalty, False
else:
return 0, True | python | def prior_H0(self, H0, H0_min=0, H0_max=200):
"""
checks whether the parameter vector has left its bound, if so, adds a big number
"""
if H0 < H0_min or H0 > H0_max:
penalty = -10**15
return penalty, False
else:
return 0, True | checks whether the parameter vector has left its bound, if so, adds a big number | https://github.com/sibirrer/lenstronomy/blob/4edb100a4f3f4fdc4fac9b0032d2b0283d0aa1d6/lenstronomy/Cosmo/cosmography.py#L112-L120 |
sibirrer/lenstronomy | lenstronomy/Cosmo/cosmography.py | CosmoLikelihood.prior_omega_m | def prior_omega_m(self, omega_m, omega_m_min=0, omega_m_max=1):
"""
checks whether the parameter omega_m is within the given bounds
:param omega_m:
:param omega_m_min:
:param omega_m_max:
:return:
"""
if omega_m < omega_m_min or omega_m > omega_m_max:
... | python | def prior_omega_m(self, omega_m, omega_m_min=0, omega_m_max=1):
"""
checks whether the parameter omega_m is within the given bounds
:param omega_m:
:param omega_m_min:
:param omega_m_max:
:return:
"""
if omega_m < omega_m_min or omega_m > omega_m_max:
... | checks whether the parameter omega_m is within the given bounds
:param omega_m:
:param omega_m_min:
:param omega_m_max:
:return: | https://github.com/sibirrer/lenstronomy/blob/4edb100a4f3f4fdc4fac9b0032d2b0283d0aa1d6/lenstronomy/Cosmo/cosmography.py#L122-L134 |
sibirrer/lenstronomy | lenstronomy/Cosmo/cosmography.py | MCMCSampler.mcmc_emcee | def mcmc_emcee(self, n_walkers, n_run, n_burn, mean_start, sigma_start):
"""
returns the mcmc analysis of the parameter space
"""
sampler = emcee.EnsembleSampler(n_walkers, self.cosmoParam.numParam, self.chain.likelihood)
p0 = emcee.utils.sample_ball(mean_start, sigma_start, n_wa... | python | def mcmc_emcee(self, n_walkers, n_run, n_burn, mean_start, sigma_start):
"""
returns the mcmc analysis of the parameter space
"""
sampler = emcee.EnsembleSampler(n_walkers, self.cosmoParam.numParam, self.chain.likelihood)
p0 = emcee.utils.sample_ball(mean_start, sigma_start, n_wa... | returns the mcmc analysis of the parameter space | https://github.com/sibirrer/lenstronomy/blob/4edb100a4f3f4fdc4fac9b0032d2b0283d0aa1d6/lenstronomy/Cosmo/cosmography.py#L245-L256 |
sibirrer/lenstronomy | lenstronomy/Util/simulation_util.py | data_configure_simple | def data_configure_simple(numPix, deltaPix, exposure_time=1, sigma_bkg=1, inverse=False):
"""
configures the data keyword arguments with a coordinate grid centered at zero.
:param numPix: number of pixel (numPix x numPix)
:param deltaPix: pixel size (in angular units)
:param exposure_time: exposure... | python | def data_configure_simple(numPix, deltaPix, exposure_time=1, sigma_bkg=1, inverse=False):
"""
configures the data keyword arguments with a coordinate grid centered at zero.
:param numPix: number of pixel (numPix x numPix)
:param deltaPix: pixel size (in angular units)
:param exposure_time: exposure... | configures the data keyword arguments with a coordinate grid centered at zero.
:param numPix: number of pixel (numPix x numPix)
:param deltaPix: pixel size (in angular units)
:param exposure_time: exposure time
:param sigma_bkg: background noise (Gaussian sigma)
:param inverse: if True, coordinate ... | https://github.com/sibirrer/lenstronomy/blob/4edb100a4f3f4fdc4fac9b0032d2b0283d0aa1d6/lenstronomy/Util/simulation_util.py#L10-L33 |
sibirrer/lenstronomy | lenstronomy/Util/simulation_util.py | psf_configure_simple | def psf_configure_simple(psf_type="GAUSSIAN", fwhm=1, kernelsize=11, deltaPix=1, truncate=6, kernel=None):
"""
this routine generates keyword arguments to initialize a PSF() class in lenstronomy. Have a look at the PSF class
documentation to see the full possibilities.
:param psf_type: string, type of ... | python | def psf_configure_simple(psf_type="GAUSSIAN", fwhm=1, kernelsize=11, deltaPix=1, truncate=6, kernel=None):
"""
this routine generates keyword arguments to initialize a PSF() class in lenstronomy. Have a look at the PSF class
documentation to see the full possibilities.
:param psf_type: string, type of ... | this routine generates keyword arguments to initialize a PSF() class in lenstronomy. Have a look at the PSF class
documentation to see the full possibilities.
:param psf_type: string, type of PSF model
:param fwhm: Full width at half maximum of PSF (if GAUSSIAN psf)
:param kernelsize: size in pixel of ... | https://github.com/sibirrer/lenstronomy/blob/4edb100a4f3f4fdc4fac9b0032d2b0283d0aa1d6/lenstronomy/Util/simulation_util.py#L36-L68 |
sibirrer/lenstronomy | lenstronomy/LensModel/Profiles/chameleon.py | Chameleon._theta_E_convert | def _theta_E_convert(self, theta_E, w_c, w_t):
"""
convert the parameter theta_E (deflection angle one arcsecond from the center) into the
"Einstein radius" scale parameter of the two NIE profiles
:param theta_E:
:param w_c:
:param w_t:
:return:
"""
... | python | def _theta_E_convert(self, theta_E, w_c, w_t):
"""
convert the parameter theta_E (deflection angle one arcsecond from the center) into the
"Einstein radius" scale parameter of the two NIE profiles
:param theta_E:
:param w_c:
:param w_t:
:return:
"""
... | convert the parameter theta_E (deflection angle one arcsecond from the center) into the
"Einstein radius" scale parameter of the two NIE profiles
:param theta_E:
:param w_c:
:param w_t:
:return: | https://github.com/sibirrer/lenstronomy/blob/4edb100a4f3f4fdc4fac9b0032d2b0283d0aa1d6/lenstronomy/LensModel/Profiles/chameleon.py#L100-L118 |
sibirrer/lenstronomy | lenstronomy/LensModel/Profiles/numerical_deflections.py | NumericalAlpha.derivatives | def derivatives(self, x, y, center_x = 0, center_y = 0, **kwargs):
"""
returns df/dx and df/dy (un-normalized!!!) interpolated from the numerical deflection table
"""
assert 'norm' in kwargs.keys(), "key word arguments must contain 'norm', " \
"t... | python | def derivatives(self, x, y, center_x = 0, center_y = 0, **kwargs):
"""
returns df/dx and df/dy (un-normalized!!!) interpolated from the numerical deflection table
"""
assert 'norm' in kwargs.keys(), "key word arguments must contain 'norm', " \
"t... | returns df/dx and df/dy (un-normalized!!!) interpolated from the numerical deflection table | https://github.com/sibirrer/lenstronomy/blob/4edb100a4f3f4fdc4fac9b0032d2b0283d0aa1d6/lenstronomy/LensModel/Profiles/numerical_deflections.py#L63-L83 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.