Skip to content
Merged
Changes from all commits
Commits
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
13 changes: 8 additions & 5 deletions autolens/interferometer/simulator.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@


class SimulatorInterferometer(aa.SimulatorInterferometer):
def via_tracer_from(self, tracer, grid):
def via_tracer_from(self, tracer, grid, xp=None):
"""
Returns a realistic simulated image by applying effects to a plain simulated image.

Expand All @@ -42,11 +42,14 @@ def via_tracer_from(self, tracer, grid):
A seed for random noise_maps generation
"""

image = tracer.image_2d_from(grid=grid)
if xp is None:
xp = self._xp

return self.via_image_from(image=image)
image = tracer.image_2d_from(grid=grid, xp=xp)

return self.via_image_from(image=image, xp=xp)

def via_galaxies_from(self, galaxies, grid):
def via_galaxies_from(self, galaxies, grid, xp=None):
"""Simulate imaging data for this data, as follows:

1) Setup the image-plane grid of the Imaging arrays, which defines the coordinates used for the ray-tracing.
Expand All @@ -64,7 +67,7 @@ def via_galaxies_from(self, galaxies, grid):

tracer = Tracer(galaxies=galaxies)

return self.via_tracer_from(tracer=tracer, grid=grid)
return self.via_tracer_from(tracer=tracer, grid=grid, xp=xp)

def via_deflections_and_galaxies_from(
self, deflections: aa.VectorYX2D, galaxies: List[ag.Galaxy]
Expand Down
Loading