Skip to content

Commit 6fc18e3

Browse files
NiekWieldersNiekWielders
andauthored
added maximum threshold (#505)
Co-authored-by: NiekWielders <c4072114@newcastle.ac.uk>
1 parent c2e8b95 commit 6fc18e3

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

autolens/analysis/result.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -263,6 +263,7 @@ def positions_likelihood_from(
263263
self,
264264
factor=1.0,
265265
minimum_threshold=None,
266+
maximum_threshold=None,
266267
positions: Optional[aa.Grid2DIrregular] = None,
267268
mass_centre_radial_distance_min: float = None,
268269
plane_redshift: Optional[float] = None,
@@ -289,6 +290,9 @@ def positions_likelihood_from(
289290
minimum_threshold
290291
The output threshold is rounded up to this value if it is below it, to avoid extremely small threshold
291292
values.
293+
maximum_threshold
294+
The output threshold is rounded down to this value if it is above it, to avoid extremely large threshold
295+
values.
292296
positions
293297
If input, these positions are used instead of the computed multiple image positions from the lens mass
294298
model.
@@ -380,6 +384,9 @@ def positions_likelihood_from(
380384
plane_redshift=plane_redshift,
381385
)
382386

387+
if maximum_threshold is not None:
388+
threshold = min(threshold, maximum_threshold)
389+
383390
return PositionsLH(
384391
positions=positions, threshold=threshold, plane_redshift=plane_redshift
385392
)

0 commit comments

Comments
 (0)