@grids.grid_interpolate<EOL><INDENT>@geometry_profiles.cache<EOL>@geometry_profiles.transform_grid<EOL>@geometry_profiles.move_grid_to_radial_minimum<EOL>def deflections_from_grid(self, grid):<DEDENT>
def calculate_deflection_component(npow, index):<EOL><INDENT>sersic_constant = self.sersic_constant<EOL>deflection_grid = self.axis_ratio * grid[:, index]<EOL>deflection_grid *= quad_grid(self.deflection_func, <NUM_LIT:0.0>, <NUM_LIT:1.0>, grid,<EOL>args=(npow, self.axis_ratio, self.intensity,<EOL>self.sersic_index, self.effective_radius,<EOL>self.mass_to_light_ratio, sersic_constant))[<NUM_LIT:0>]<EOL>return deflection_grid<EOL><DEDENT>deflection_y = calculate_deflection_component(<NUM_LIT:1.0>, <NUM_LIT:0>)<EOL>deflection_x = calculate_deflection_component(<NUM_LIT:0.0>, <NUM_LIT:1>)<EOL>return self.rotate_grid_from_profile(np.multiply(<NUM_LIT:1.0>, np.vstack((deflection_y, deflection_x)).T))<EOL>
Calculate the deflection angles at a given set of arc-second gridded coordinates.

Parameters
----------
grid : grids.RegularGrid
    The grid of (y,x) arc-second coordinates the deflection angles are computed on.