@geometry_profiles.transform_grid<EOL><INDENT>@geometry_profiles.move_grid_to_radial_minimum<EOL>def deflections_from_grid(self, grid):<DEDENT>
factor = <NUM_LIT> * self.einstein_radius_rescaled * self.axis_ratio / np.sqrt(<NUM_LIT:1> - self.axis_ratio ** <NUM_LIT:2>)<EOL>psi = np.sqrt(np.add(np.multiply(self.axis_ratio ** <NUM_LIT:2>, np.square(grid[:, <NUM_LIT:1>])), np.square(grid[:, <NUM_LIT:0>])))<EOL>deflection_y = np.arctanh(np.divide(np.multiply(np.sqrt(<NUM_LIT:1> - self.axis_ratio ** <NUM_LIT:2>), grid[:, <NUM_LIT:0>]), psi))<EOL>deflection_x = np.arctan(np.divide(np.multiply(np.sqrt(<NUM_LIT:1> - self.axis_ratio ** <NUM_LIT:2>), grid[:, <NUM_LIT:1>]), psi))<EOL>return self.rotate_grid_from_profile(np.multiply(factor, np.vstack((deflection_y, deflection_x)).T))<EOL>
Calculate the deflection angles at a given set of arc-second gridded coordinates.

For coordinates (0.0, 0.0) the analytic calculation of the deflection angle gives a NaN. Therefore, \
coordinates at (0.0, 0.0) are shifted slightly to (1.0e-8, 1.0e-8).

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