flystar.plots ============= .. py:module:: flystar.plots Classes ------- .. autoapisummary:: flystar.plots.PrintSelected Functions --------- .. autoapisummary:: flystar.plots.trans_positions flystar.plots.pos_diff_hist flystar.plots.pos_diff_err_hist flystar.plots.mag_diff_hist flystar.plots.pos_diff_quiver flystar.plots.vpd flystar.plots.vel_diff_err_hist flystar.plots.residual_vpd flystar.plots.plotStar flystar.plots.plot_pm flystar.plots.plot_gaia flystar.plots.plot_pm_error flystar.plots.plot_mag_error flystar.plots.plot_mean_residuals_by_epoch flystar.plots.plot_quiver_residuals_all_epochs flystar.plots.plot_quiver_residuals_with_orig_all_epochs flystar.plots.plot_mag_scatter_multi_trans_all_epochs flystar.plots.angle_from_xy flystar.plots.calc_da flystar.plots.plot_mag_scatter flystar.plots.plot_y_scatter flystar.plots.T_cte_y flystar.plots.T_line flystar.plots.plot_quiver_residuals flystar.plots.plot_quiver_residuals_magcolor_all_epochs flystar.plots.plot_quiver_residuals_magcolor flystar.plots.plot_quiver_residuals_orig flystar.plots.rotate flystar.plots.plot_quiver_residuals_orig_angle_xy flystar.plots.plot_chi2_dist flystar.plots.plot_chi2_dist_per_epoch flystar.plots.plot_chi2_dist_mag flystar.plots.plot_stars flystar.plots.plot_stars_nfilt flystar.plots.plot_errors_vs_r_m flystar.plots.plot_sky Module Contents --------------- .. py:function:: trans_positions(ref, ref_mat, starlist, starlist_mat, xlim=None, ylim=None, fileName=None, equal_axis=True, root='./') Plot positions of stars in reference list and the transformed starlist, in reference list coordinates. Stars used in the transformation are highlighted. Parameters: ---------- ref: astropy table Reference starlist, with standard column headers ref_mat: astropy table Reference starlist only containing matched stars that were used in the transformation. Standard column headers are assumed. starlist: astropy table Transformed starist with the reference starlist coordinates. Standard column headers are assumed starlist_mat: astropy table Transformed starlist only containing the matched stars used in the transformation. Standard column headers are assumed. xlim: None or list/array [xmin, xmax] If not None, sets the xmin and xmax limit of the plot ylim: None or list/array [ymin, ymax] If not None, sets the ymin and ymax limit of the plot equal_axis: boolean If true, make axes equal. True by default .. py:function:: pos_diff_hist(ref_mat, starlist_mat, nbins=25, bin_width=None, xlim=None, fileName=None, root='./') Plot histogram of position differences for the matched stars: reference - starlist Parameters: ----------- ref_mat: astropy table Reference starlist only containing matched stars that were used in the transformation. Standard column headers are assumed. starlist_mat: astropy table Transformed starlist only containing the matched stars used in the transformation. Standard column headers are assumed. nbins: int Number of bins used in histogram, regardless of data range. This is ignored if bin_width != None bin_width: None or float If float, sets the width of the bins used in the histogram. Will override nbins xlim: None or [xmin, xmax] If not none, set the X range of the plot .. py:function:: pos_diff_err_hist(ref_mat, starlist_mat, transform, nbins=25, bin_width=None, errs='both', xlim=None, outlier=10, fileName=None, root='./') Plot histogram of position residuals / astrometric error for the matched stars: reference - starlist. Also calculates the reduced chi-square of the fit, annotates value on plot. Calculate this reduced chi-square both including and excluding outliers, which we identify as > +/- sigma away from 0 Parameters: ----------- ref_mat: astropy table Reference starlist only containing matched stars that were used in the transformation. Standard column headers are assumed. starlist_mat: astropy table Transformed starlist only containing the matched stars used in the transformation. Standard column headers are assumed. transform: transformation object Transformation object of final transform. Used in chi-square determination nbins: int Number of bins used in histogram, regardless of data range. This is ignored if bin_width != None bin_width: None or float If float, sets the width of the bins used in the histogram. Will override nbins errs: string; 'both', 'reference', or 'starlist' If both, add starlist errors in quadrature with reference errors. If reference, only consider reference errors. This should be used if the starlist does not have valid errors If starlist, only consider starlist errors. This should be used if the reference does not have valid errors xlim: None or [xmin, xmax] (default=None) If not None, set the min and max value of the X axis outlier: float (default = 10) Defines how many sigma away from 0 a star must be in order to be considered an outlier. .. py:function:: mag_diff_hist(ref_mat, starlist_mat, bins=25, fileName=None, root='./') Plot histogram of mag differences for the matched stars: reference - starlist Parameters: ----------- ref_mat: astropy table Reference starlist only containing matched stars that were used in the transformation. Standard column headers are assumed. starlist_mat: astropy table Transformed starlist only containing the matched stars used in the transformation. Standard column headers are assumed. .. py:function:: pos_diff_quiver(ref_mat, starlist_mat, qscale=10, keyLength=0.2, xlim=None, ylim=None, outlier_reject=None, sigma=False, fileName=None, root='./') Quiver plot of position differences for the matched stars: reference - starlist Parameters: ----------- ref_mat: astropy table Reference starlist only containing matched stars that were used in the transformation. Standard column headers are assumed. starlist_mat: astropy table Transformed starlist only containing the matched stars used in the transformation. Standard column headers are assumed. qscale: int (default=10) Scale parameter for the quiver plot. Lower the number, bigger the scale keyLength: float (default=0.2) Key length parameter for quiver plot, in reference units. xlim: None or list/array [xmin, xmax] If not None, sets the xmin and xmax limit of the plot ylim: None or list/array [ymin, ymax] If not None, sets the ymin and ymax limit of the plot outlier_reject: None or float If float, ignore any star with a combined position difference larger than the float. difference = np.hypot(diff_x, diff_y). This value needs to be in reference units sigma = boolean If true, plot position differences divided by reference position error, rather than just the position difference .. py:function:: vpd(ref, starlist_trans, vxlim, vylim) Plot the VPD of the reference starlist and the transformed starlist. If all went well, both should be in the same frame. Note: we need velocities in both starlists in order for this to work. Parameters: ---------- ref: astropy table Reference starlist which contains velocity info. Standard column names are assumed starlist_trans: astropy table Transformed starlist which also contains velocity info. Standard column names are assumed. vxlim: None or list/array [vxmin, vxmax] If not None, sets the vxmin and vxmax limit of the plot vylim: None or list/array [vymin, vymax] If not None, sets the vymin and vymax limit of the plot .. py:function:: vel_diff_err_hist(ref_mat, starlist_mat, nbins=25, bin_width=None, vxlim=None, vylim=None) Plot the distributions of the velocity differences between the reference list and the transformed starlist, realtive to the velocity errors. We assume that both lists have velocities and velocity errors Paramters: ---------- ref_mat: astropy table Reference starlist, with velocities starlist_mat: astropy table Transformed starlist, with velocities nbins: int Number of bins used in histogram, regardless of data range. This is ignored if bin_width != None bin_width: None or float If float, sets the width of the bins used in the histograms. Will override nbins vxlim: None or [vx_min, vx_max] If not none, set the X axis of the Vx plot by defining the minimum and maximum values vylim: None or [vy_min, vy_max] If not none, set the Y axis of the Vy plot by defining the minimum and maximum values .. py:function:: residual_vpd(ref_mat, starlist_trans_mat, pscale=None) Make VPD diagram of the residuals between the reference proper motions and the transformed proper motions. Parameters: ----------- ref_mat: astropy table Table with matched stars from the reference starlist. Assumes standard headers starlist_trans: astropy table Table with matched stars from the transformed starlist. Assumes standard headers pscale: None or float If float, convert all values to mas/yr using pscale as the plate scale. Assumes pscale is conversion from pixels to milliarcsecs Output: ------ Creates (reference - transformed) VPD .. py:function:: plotStar(starNames, rootDir='./', align='align/align_d_rms_1000_abs_t', poly='polyfit_d/fit', points='points_d/', radial=False, NcolMax=3, figsize=(15, 15)) .. py:function:: plot_pm(tab) .. py:function:: plot_gaia(gaia) .. py:function:: plot_pm_error(tab) .. py:function:: plot_mag_error(tab) .. py:function:: plot_mean_residuals_by_epoch(tab) Plot mean position and magnitude residuals vs. epoch. Note we are plotting the mean( |dx} ) to see the size of the mean residual. .. py:function:: plot_quiver_residuals_all_epochs(tab, unit='arcsec', scale=None, plotlim=None) .. py:function:: plot_quiver_residuals_with_orig_all_epochs(tab, trans_list, unit='arcsec', scale=None, plotlim=None, scale_orig=None, cte_fit=None, mlim=15) .. py:function:: plot_mag_scatter_multi_trans_all_epochs(tab_list, trans_list_list, unit='arcsec', scale=None, plotlim=None, scale_orig=None) .. py:function:: angle_from_xy(x, y) Given x and y, calculate the angle theta in degrees .. py:function:: calc_da(trans_list) Rotation angle. .. py:function:: plot_mag_scatter(m_t, m0, m0e, x_t, y_t, xe_t, ye_t, x_ref, y_ref, good_idx, ref_idx, title, da=0, xorig=None, yorig=None, cte_fit=None, mlim=15) .. py:function:: plot_y_scatter(m_t, m0, m0e, x_t, y_t, xe_t, ye_t, x_ref, y_ref, good_idx, ref_idx, title, da=0, xorig=None, yorig=None, cte_fit=None, mlim=15) .. py:function:: T_cte_y(m, A, m0, alpha, m1) .. py:function:: T_line(m, a, b) .. py:function:: plot_quiver_residuals(x_t, y_t, x_ref, y_ref, good_idx, ref_idx, title, unit='pixel', scale=None, plotlim=None) unit : str 'pixel' or 'arcsec' The pixel units of the input values. Note, if arcsec, then the values will be converted to milli-arcsec for plotting when appropriate. scale : float The quiver scale. If none, then default units will be used appropriate to the unit. plotlim : float (positive) Sets the size of the plotted figure. If None, then default is used. Otherwise plots figure of range [-plotlim, plotlim] x [-plotlim, plotlim]. .. py:function:: plot_quiver_residuals_magcolor_all_epochs(tab, unit='arcsec', scale=None, plotlim=None, lower_mag=18, upper_mag=13) .. py:function:: plot_quiver_residuals_magcolor(x_t, y_t, x_ref, y_ref, mag, good_idx, ref_idx, title, unit='pixel', scale=None, plotlim=None) unit : str 'pixel' or 'arcsec' The pixel units of the input values. Note, if arcsec, then the values will be converted to milli-arcsec for plotting when appropriate. scale : float The quiver scale. If none, then default units will be used appropriate to the unit. plotlim : float (positive) Sets the size of the plotted figure. If None, then default is used. Otherwise plots figure of range [-plotlim, plotlim] x [-plotlim, plotlim]. .. py:function:: plot_quiver_residuals_orig(x_t, y_t, x_ref, y_ref, good_idx, ref_idx, x_orig, y_orig, da, title, scale=None, plotlim=None) unit : str 'pixel' or 'arcsec' The pixel units of the input values. Note, if arcsec, then the values will be converted to milli-arcsec for plotting when appropriate. scale : float The quiver scale. If none, then default units will be used appropriate to the unit. plotlim : float (positive) Sets the size of the plotted figure. If None, then default is used. Otherwise plots figure of range [-plotlim, plotlim] x [-plotlim, plotlim]. .. py:function:: rotate(x, y, theta) theta: in degrees .. py:function:: plot_quiver_residuals_orig_angle_xy(x_t, y_t, x_ref, y_ref, good_idx, ref_idx, x_orig, y_orig, da, title, scale=None, plotlim=None) unit : str 'pixel' or 'arcsec' The pixel units of the input values. Note, if arcsec, then the values will be converted to milli-arcsec for plotting when appropriate. scale : float The quiver scale. If none, then default units will be used appropriate to the unit. plotlim : float (positive) Sets the size of the plotted figure. If None, then default is used. Otherwise plots figure of range [-plotlim, plotlim] x [-plotlim, plotlim]. .. py:function:: plot_chi2_dist(tab, Ndetect, xlim=40, n_bins=50) tab = flystar table Ndetect = Number of epochs star detected in .. py:function:: plot_chi2_dist_per_epoch(tab, Ndetect, xlim, ylim=[-1, 1], target_idx=0) tab = flystar table Ndetect = Number of epochs star detected in .. py:function:: plot_chi2_dist_mag(tab, Ndetect, mlim=40, n_bins=30) tab = flystar table Ndetect = Number of epochs star detected in .. py:function:: plot_stars(tab, star_names, NcolMax=2, epoch_array=None, figsize=(15, 25), color_time=False) Plot a set of stars positions, flux and residuals over time. epoch_array : None, array Array of the epoch indicies to plot. If None, plots all epochs. .. py:function:: plot_stars_nfilt(tab, star_names, NcolMax=2, epoch_array_list=None, color_list=None, figsize=(15, 25), color_time=False, resTicRng=None) Plot a set of stars positions, flux and residuals over time. epoch_array : None, array Array of the epoch indicies to plot. If None, plots all epochs. resTicRng : None, array len=2 2 element array with the lower and upper axis range for residuals plots. .. py:function:: plot_errors_vs_r_m(star_tab, vmax_perr=0.75, vmax_pmerr=0.75) Plot the positional errors and the proper motion errors as a function of radius and magnitude. The positional an proper motion errors will be the mean in the two axis (as is used in pick_good_ref_stars()). .. py:function:: plot_sky(stars_tab, plot_errors=False, center_star=None, range=0.4, xcenter=0, ycenter=0, show_names=False, saveplot=False, mag_range=None, with_orbits=True, orbits_file=None, manual_print=False) Plot all the stars at their positions over time with each star having a different symbol and each epoch having a different color. .. py:class:: PrintSelected(points_info, fig, tab, mag_range, manual_print=False) Bases: :py:obj:`object` .. py:attribute:: points_info .. py:attribute:: fig .. py:attribute:: tab .. py:attribute:: manual_print :value: False .. py:attribute:: mag_range .. py:method:: __call__(event)