2121
2222
2323class SimulatorInterferometer (aa .SimulatorInterferometer ):
24- def via_tracer_from (self , tracer , grid ):
24+ def via_tracer_from (self , tracer , grid , xp = None ):
2525 """
2626 Returns a realistic simulated image by applying effects to a plain simulated image.
2727
@@ -42,11 +42,14 @@ def via_tracer_from(self, tracer, grid):
4242 A seed for random noise_maps generation
4343 """
4444
45- image = tracer .image_2d_from (grid = grid )
45+ if xp is None :
46+ xp = self ._xp
4647
47- return self .via_image_from (image = image )
48+ image = tracer .image_2d_from (grid = grid , xp = xp )
49+
50+ return self .via_image_from (image = image , xp = xp )
4851
49- def via_galaxies_from (self , galaxies , grid ):
52+ def via_galaxies_from (self , galaxies , grid , xp = None ):
5053 """Simulate imaging data for this data, as follows:
5154
5255 1) Setup the image-plane grid of the Imaging arrays, which defines the coordinates used for the ray-tracing.
@@ -64,7 +67,7 @@ def via_galaxies_from(self, galaxies, grid):
6467
6568 tracer = Tracer (galaxies = galaxies )
6669
67- return self .via_tracer_from (tracer = tracer , grid = grid )
70+ return self .via_tracer_from (tracer = tracer , grid = grid , xp = xp )
6871
6972 def via_deflections_and_galaxies_from (
7073 self , deflections : aa .VectorYX2D , galaxies : List [ag .Galaxy ]
0 commit comments