@@ -54,7 +54,9 @@ def source_plane_centre(self) -> aa.Grid2DIrregular:
5454 """
5555 return self .source_plane_light_profile_centre
5656
57- def image_plane_multiple_image_positions (self , plane_redshift : Optional [float ] = None ) -> aa .Grid2DIrregular :
57+ def image_plane_multiple_image_positions (
58+ self , plane_redshift : Optional [float ] = None
59+ ) -> aa .Grid2DIrregular :
5860 """
5961 Backwards ray-trace the source-plane centres (see above) to the image-plane via the mass model, to determine
6062 the multiple image position of the source(s) in the image-plane.
@@ -89,7 +91,7 @@ def image_plane_multiple_image_positions(self, plane_redshift : Optional[float]
8991 return aa .Grid2DIrregular (values = multiple_images )
9092
9193 def image_plane_multiple_image_positions_for_single_image_from (
92- self , plane_redshift : Optional [float ] = None , increments : int = 20
94+ self , plane_redshift : Optional [float ] = None , increments : int = 20
9395 ) -> aa .Grid2DIrregular :
9496 """
9597 If the standard point solver only locates one multiple image, finds one or more additional images, which are
@@ -149,7 +151,7 @@ def image_plane_multiple_image_positions_for_single_image_from(
149151 return aa .Grid2DIrregular (values = multiple_images )
150152
151153 logger .info (
152- """
154+ """
153155 Could not find multiple images for maximum likelihood lens model, even after incrementally moving the source
154156 centre inwards to the centre of the source-plane.
155157
@@ -163,7 +165,7 @@ def positions_threshold_from(
163165 factor = 1.0 ,
164166 minimum_threshold = None ,
165167 positions : Optional [aa .Grid2DIrregular ] = None ,
166- plane_redshift : Optional [float ] = None ,
168+ plane_redshift : Optional [float ] = None ,
167169 ) -> float :
168170 """
169171 Compute a new position threshold from these results corresponding to the image-plane multiple image positions
@@ -176,10 +178,10 @@ def positions_threshold_from(
176178
177179 This is used for non-linear search chaining, specifically updating the position threshold of a new model-fit
178180 using the maximum likelihood model of a previous search.
179-
181+
180182 The above behaviour assumes a single lens and single source plane, if there are multiple source planes (e.g.
181183 a double source plane lens) the input `plane_redshift_list` can be used to specify which source planea
182- the position threshold is computed for.
184+ the position threshold is computed for.
183185
184186 Parameters
185187 ----------
@@ -216,9 +218,7 @@ def positions_threshold_from(
216218 data = positions , noise_map = None , tracer = tracer , plane_redshift = plane_redshift
217219 )
218220
219- threshold = factor * np .max (
220- positions_fits .max_separation_of_plane_positions
221- )
221+ threshold = factor * np .max (positions_fits .max_separation_of_plane_positions )
222222
223223 if minimum_threshold is not None :
224224 if threshold < minimum_threshold :
@@ -294,10 +294,15 @@ def positions_likelihood_from(
294294 positions = positions [distances > mass_centre_radial_distance_min ]
295295
296296 threshold = self .positions_threshold_from (
297- factor = factor , minimum_threshold = minimum_threshold , positions = positions , plane_redshift = plane_redshift
297+ factor = factor ,
298+ minimum_threshold = minimum_threshold ,
299+ positions = positions ,
300+ plane_redshift = plane_redshift ,
301+ )
302+
303+ return PositionsLH (
304+ positions = positions , threshold = threshold , plane_redshift = plane_redshift
298305 )
299-
300- return PositionsLH (positions = positions , threshold = threshold , plane_redshift = plane_redshift )
301306
302307
303308class ResultDataset (Result ):
0 commit comments