Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding test cases to composite mass modeling #1

Merged
merged 39 commits into from
Dec 7, 2023
Merged
Show file tree
Hide file tree
Changes from 20 commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
995cb3e
added tests cases for parameter_scaling
Dec 6, 2023
80660c0
edited docstrings
Dec 6, 2023
c31af5f
added test cases for hierarchy_likelihood
williyamshoe Dec 6, 2023
2e4f797
added test cases for hierarchy_likelihood
williyamshoe Dec 6, 2023
6e599e0
added test cases for hierarchy_likelihood
williyamshoe Dec 6, 2023
0420dbe
added test cases for lens_param
williyamshoe Dec 6, 2023
1b1a62b
Merge remote-tracking branch 'origin/feature/tests' into feature/tests
williyamshoe Dec 6, 2023
c94e4cc
added test cases for kin_constraints_composite
williyamshoe Dec 7, 2023
b32f4cd
removed impossible edge cases
williyamshoe Dec 7, 2023
34a03bc
Update test/test_LensPosterior/test_kin_constraints_composite.py
ajshajib Dec 7, 2023
d3f3b28
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Dec 7, 2023
f04c6f5
Update test/test_LensPosterior/test_kin_constraints_composite.py
ajshajib Dec 7, 2023
cd57d03
Update test/test_LensPosterior/test_kin_constraints_composite.py
ajshajib Dec 7, 2023
bc910fd
Update test/test_LensPosterior/test_kin_constraints_composite.py
ajshajib Dec 7, 2023
78ef5f7
Update test/test_LensPosterior/test_kin_constraints_composite.py
ajshajib Dec 7, 2023
07e6385
Update test/test_LensPosterior/test_kin_constraints_composite.py
ajshajib Dec 7, 2023
9d113de
Update test/test_LensPosterior/test_kin_constraints_composite.py
ajshajib Dec 7, 2023
e509b1e
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Dec 7, 2023
2426804
Update test/test_LensPosterior/test_kin_constraints_composite.py
ajshajib Dec 7, 2023
1b11594
Update test/test_LensPosterior/test_kin_constraints_composite.py
ajshajib Dec 7, 2023
e28e06e
Update test/test_Likelihood/test_hierarchy_likelihood.py
ajshajib Dec 7, 2023
443ecda
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Dec 7, 2023
2c50737
Update test/test_Likelihood/test_parameter_scaling.py
ajshajib Dec 7, 2023
ce633e4
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Dec 7, 2023
78d6f02
Update test/test_Likelihood/test_parameter_scaling.py
ajshajib Dec 7, 2023
6d442ff
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Dec 7, 2023
070fd1f
Update test/test_Likelihood/test_parameter_scaling.py
ajshajib Dec 7, 2023
1400f2e
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Dec 7, 2023
df4e456
Update test/test_Likelihood/test_parameter_scaling.py
ajshajib Dec 7, 2023
1bd615f
Update test/test_Likelihood/test_parameter_scaling.py
ajshajib Dec 7, 2023
10c231d
Update test/test_Likelihood/test_parameter_scaling.py
ajshajib Dec 7, 2023
2f8649d
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Dec 7, 2023
084c266
Update test/test_Likelihood/test_parameter_scaling.py
ajshajib Dec 7, 2023
a47987c
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Dec 7, 2023
e734fba
Update test/test_Likelihood/test_parameter_scaling.py
ajshajib Dec 7, 2023
c399846
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Dec 7, 2023
4b90e9a
Update test/test_Likelihood/test_parameter_scaling.py
ajshajib Dec 7, 2023
a73dc17
Update test/test_Likelihood/test_parameter_scaling.py
ajshajib Dec 7, 2023
25f77b1
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Dec 7, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 2 additions & 12 deletions hierarc/LensPosterior/kin_constraints_composite.py
Original file line number Diff line number Diff line change
Expand Up @@ -216,21 +216,11 @@ def j_kin_draw_composite(self, kwargs_anisotropy, gamma_in, m2l, no_error=False)

kwargs_lens_stars["amp"] *= m2l

if "sigma" in kwargs_lens_stars:
kwargs_lens_stars["sigma"] *= delta_r_eff
elif "Rs" in kwargs_lens_stars:
kwargs_lens_stars["Rs"] *= delta_r_eff
elif "R_sersic" in kwargs_lens_stars:
kwargs_lens_stars["R_sersic"] *= delta_r_eff
kwargs_lens_stars["sigma"] *= delta_r_eff

kwargs_light = copy.deepcopy(self._kwargs_lens_light)
for kwargs in kwargs_light:
if "sigma" in kwargs:
kwargs["sigma"] *= delta_r_eff
elif "Rs" in kwargs:
kwargs["Rs"] *= delta_r_eff
elif "R_sersic" in kwargs:
kwargs["R_sersic"] *= delta_r_eff
kwargs["sigma"] *= delta_r_eff

kwargs_lens = [
{
Expand Down
8 changes: 3 additions & 5 deletions hierarc/Likelihood/parameter_scaling.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,15 @@ def __init__(self, param_arrays, scaling_grid):
self._f_ani = interp2d(param_arrays[0], param_arrays[1], scaling_grid.T)
else:
self._f_ani = RegularGridInterpolator(
(arr for arr in param_arrays),
tuple(param_arrays),
scaling_grid,
)
self._evalute_scaling = True

def param_scaling(self, param_array):
"""

:param aniso_param_array: anisotropy parameter array
:param param_array: anisotropy parameter array
:return: scaling J(a_ani) for single slit
"""
if self._evalute_scaling is not True or param_array is None:
Expand All @@ -59,10 +59,8 @@ def __init__(
"""

:param anisotropy_model: string, either 'NONE', 'OM' or 'GOM'
:param param_array: array of parameter values
:param param_arrays: array of parameter values
:param scaling_grid_list: list of array with the scalings of J() for each IFU
:param gamma_in_array: array of gamma_in values
:param m2l_array: array of M/L values
"""
self._anisotropy_model = anisotropy_model
self._evalute_ani = False
Expand Down
Loading