Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def traced_grids_of_planes_from_grid(self, grid, plane_index_limit=None):
traced_grids = []
traced_deflections = []
for (plane_index, plane) in enumerate(self.planes):
scaled_grid = grid.copy()
if plane_index > 0:
for previous_plane_index in range(plane_index):
scaling_factor = cosmology_util.scaling_factor_between_redshifts_from(
redshift_0=self.plane_redshifts[previous_plane_index],
redshift_1=plane.redshift,
redshift_final=self.plane_redshifts[-1],
cosmology=self.cosmology,
)
scaled_deflections = (
scaling_factor * traced_deflections[previous_plane_index]
)
# TODO : Setup as GridInterpolate
scaled_grid -= scaled_deflections
traced_grids.append(scaled_grid)
def scaling_factor_between_planes(self, i, j):
return cosmology_util.scaling_factor_between_redshifts_from(
redshift_0=self.plane_redshifts[i],
redshift_1=self.plane_redshifts[j],
redshift_final=self.plane_redshifts[-1],
cosmology=self.cosmology,
)