for named_arr in named_antenna_arrays: name = named_arr.name arr = named_arr.array df = DirectionFinder(None, arr, args.freq, logger.getChild('df')) logging.info("Doing array: {arr}".format(arr=name)) y = [] for visibility_rms_err in visibility_rms_errs: logging.info("Doing rms visibility error: {er}".format( er=visibility_rms_err)) df_errors = [] for phi in phi_domain: array_response = arr.each_pair_phase_difference_at_angle( phi, args.freq) visibility_errors = np.random.normal(0, visibility_rms_err, array_response.shape) array_response += visibility_errors angle_out = df.find_closest_point(array_response) angular_error = np.arctan2(np.sin(phi - angle_out), np.cos(phi - angle_out)) df_errors.append(angular_error) rmserror = np.sqrt(np.sum(np.square(df_errors)) / len(df_errors)) y.append(rmserror) plt.plot(visibility_rms_errs, y, label="{name}".format(name=name)) plt.legend(loc='upper left') plt.grid(True) plt.title("Visibility error vs DF error for various array configurations") plt.ylabel("RMS error of the DF output (radians)") plt.xlabel("RMS error of the visibilities (radians)") plt.show()