def create_arrows(ax: mpl.axes.Axes, normals: np.ndarray, expand=1.05): points = normals * expand ax.quiver(points[:, 0], points[:, 1], points[:, 2], normals[:, 0], normals[:, 1], normals[:, 2], length=0.2, normalize=False, color=COLORS[6], linewidths=3.0)
def plot_astrometric_residuals(ax: matplotlib.axes.Axes, xs: np.ndarray, ys: np.ndarray) -> None: """ Plot the astrometric residual field of a set of points. Parameters ---------- ax: Matplotlib axis in which to plot xs: Array of the x- and y-components of the field ys: Array of the x- and y-components of the astrometric residual field Returns ------- None """ qdict = dict( alpha=1, angles='uv', headlength=5, headwidth=3, headaxislength=4, minlength=0, pivot='middle', scale_units='xy', width=0.002, color='#001146' ) q = ax.quiver(xs[:, 0], xs[:, 1], ys[:, 0], ys[:, 1], scale=1, **qdict) ax.quiverkey(q, 0.0, 1.8, 0.1, 'residual = 0.1 arcsec', coordinates='data', labelpos='N', color='darkred', labelcolor='darkred') ax.set_xlabel('RA [degrees]') ax.set_ylabel('Dec [degrees]') ax.set_xlim(-1.95, 1.95) ax.set_ylim(-1.9, 2.0) ax.set_aspect('equal')