flystar.plots
Classes
Functions
|
Plot positions of stars in reference list and the transformed starlist, |
|
Plot histogram of position differences for the matched |
|
Plot histogram of position residuals / astrometric error for the matched |
|
Plot histogram of mag differences for the matched |
|
Quiver plot of position differences for the matched |
|
Plot the VPD of the reference starlist and the transformed starlist. |
|
Plot the distributions of the velocity differences between the reference list |
|
Make VPD diagram of the residuals between the reference proper motions |
|
|
|
|
|
|
|
|
|
|
Plot mean position and magnitude residuals vs. epoch. |
|
|
|
|
|
|
|
|
Given x and y, calculate the angle theta in degrees |
|
Rotation angle. |
|
|
|
|
|
|
|
|
|
unit : str |
|
|
|
unit : str |
|
unit : str |
|
theta: in degrees |
|
unit : str |
|
tab = flystar table |
|
tab = flystar table |
|
tab = flystar table |
|
Plot a set of stars positions, flux and residuals over time. |
|
Plot a set of stars positions, flux and residuals over time. |
|
Plot the positional errors and the proper motion errors as a function of radius |
|
Plot all the stars at their positions over time with each star having a different |
Module Contents
- flystar.plots.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
- flystar.plots.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
- flystar.plots.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 > +/- <outlier> 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.
- flystar.plots.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.
- flystar.plots.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
- flystar.plots.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
- flystar.plots.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
- flystar.plots.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
- flystar.plots.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))
- flystar.plots.plot_pm(tab)
- flystar.plots.plot_gaia(gaia)
- flystar.plots.plot_pm_error(tab)
- flystar.plots.plot_mag_error(tab)
- flystar.plots.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.
- flystar.plots.plot_quiver_residuals_all_epochs(tab, unit='arcsec', scale=None, plotlim=None)
- flystar.plots.plot_quiver_residuals_with_orig_all_epochs(tab, trans_list, unit='arcsec', scale=None, plotlim=None, scale_orig=None, cte_fit=None, mlim=15)
- flystar.plots.plot_mag_scatter_multi_trans_all_epochs(tab_list, trans_list_list, unit='arcsec', scale=None, plotlim=None, scale_orig=None)
- flystar.plots.angle_from_xy(x, y)
Given x and y, calculate the angle theta in degrees
- flystar.plots.calc_da(trans_list)
Rotation angle.
- flystar.plots.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)
- flystar.plots.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)
- flystar.plots.T_cte_y(m, A, m0, alpha, m1)
- flystar.plots.T_line(m, a, b)
- flystar.plots.plot_quiver_residuals(x_t, y_t, x_ref, y_ref, good_idx, ref_idx, title, unit='pixel', scale=None, plotlim=None)
- unitstr
‘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.
- scalefloat
The quiver scale. If none, then default units will be used appropriate to the unit.
- plotlimfloat (positive)
Sets the size of the plotted figure. If None, then default is used. Otherwise plots figure of range [-plotlim, plotlim] x [-plotlim, plotlim].
- flystar.plots.plot_quiver_residuals_magcolor_all_epochs(tab, unit='arcsec', scale=None, plotlim=None, lower_mag=18, upper_mag=13)
- flystar.plots.plot_quiver_residuals_magcolor(x_t, y_t, x_ref, y_ref, mag, good_idx, ref_idx, title, unit='pixel', scale=None, plotlim=None)
- unitstr
‘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.
- scalefloat
The quiver scale. If none, then default units will be used appropriate to the unit.
- plotlimfloat (positive)
Sets the size of the plotted figure. If None, then default is used. Otherwise plots figure of range [-plotlim, plotlim] x [-plotlim, plotlim].
- flystar.plots.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)
- unitstr
‘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.
- scalefloat
The quiver scale. If none, then default units will be used appropriate to the unit.
- plotlimfloat (positive)
Sets the size of the plotted figure. If None, then default is used. Otherwise plots figure of range [-plotlim, plotlim] x [-plotlim, plotlim].
- flystar.plots.rotate(x, y, theta)
theta: in degrees
- flystar.plots.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)
- unitstr
‘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.
- scalefloat
The quiver scale. If none, then default units will be used appropriate to the unit.
- plotlimfloat (positive)
Sets the size of the plotted figure. If None, then default is used. Otherwise plots figure of range [-plotlim, plotlim] x [-plotlim, plotlim].
- flystar.plots.plot_chi2_dist(tab, Ndetect, xlim=40, n_bins=50)
tab = flystar table Ndetect = Number of epochs star detected in
- flystar.plots.plot_chi2_dist_per_epoch(tab, Ndetect, xlim, ylim=[-1, 1], target_idx=0)
tab = flystar table Ndetect = Number of epochs star detected in
- flystar.plots.plot_chi2_dist_mag(tab, Ndetect, mlim=40, n_bins=30)
tab = flystar table Ndetect = Number of epochs star detected in
- flystar.plots.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_arrayNone, array
Array of the epoch indicies to plot. If None, plots all epochs.
- flystar.plots.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_arrayNone, array
Array of the epoch indicies to plot. If None, plots all epochs.
- resTicRngNone, array len=2
2 element array with the lower and upper axis range for residuals plots.
- flystar.plots.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()).
- flystar.plots.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.