flystar.match
Functions
|
Take two input starlists and select the <Nbrite> brightest stars from |
|
|
|
Finds matches between two different catalogs. No transformations are done and it |
|
|
|
Finds the transformation between two starlists using the first one |
Module Contents
- flystar.match.miracle_match_briteN(xin1, yin1, min1, xin2, yin2, min2, Nbrite, Nbins_vmax=200, Nbins_angle=360, verbose=False)
Take two input starlists and select the <Nbrite> brightest stars from each. Then performa a triangle matching algorithm along the lines of Groth 1986.
For every possible triangle (combination of 3 stars) in a starlist, compute the ratio of two sides and the angle between those sides. These quantities are invariant under scale and rotation transformations. Use a histogram of these quantities to vote for possible matching triangles between the two star lists. Then take the vote winners as actual matches.
There may be some sensitivity to the bin sizes used in the histogram for vmax (ratio of two sides) and the angles. The larger the positional and brightness uncertainties, the more bigger the bin sizes should really be. But this isn’t well tested.
- flystar.match.order_by_brite(xi, yi, mi, Nout, verbose=True)
- flystar.match.match(x1, y1, m1, x2, y2, m2, dr_tol, dm_tol=None, verbose=True)
Finds matches between two different catalogs. No transformations are done and it is assumed that the two catalogs are already on the same coordinate system and magnitude system.
For two stars to be matched, they must be within a specified radius (dr_tol) and delta-magnitude (dm_tol). For stars with more than 1 neighbor (within the tolerances), if one is found that is the best match in both brightness and positional offsets (closest in both), then the match is made. Otherwise, their is a conflict and no match is returned for the star.
Parameters x1 : array-like
X coordinate in the first catalog
- y1array-like
Y coordinate in the first catalog (shape of array must match x1)
- m1array-like
Magnitude in the first catalog. Must have the same shape as x1.
- x2array-like
X coordinate in the second catalog
- y2array-like
Y coordinate in the second catalog (shape of array must match x2)
- m2array-like
Magnitude in the second catalog. Must have the same shape as x2.
- dr_tolfloat
How close (in units of the first catalog) a match has to be to count as a match. For stars with more than one nearest neighbor, the delta-magnitude is checked and the closest in delta-mag is chosen.
- dm_tolfloat or None, optional
How close in delta-magnitude a match has to be to count as a match. If None, then any delta-magnitude is allowed.
- verbosebool or int, optional
Prints on screen information on the matching. Higher verbose values (up to 9) provide more detail.
Returns
- idx1int array
Indicies into the first catalog of the matches. Will never be larger than x1/y1.
- idx2int array
Indicies into the second catalog of the matches. Will never be larger than x1/y1.
- drfloat array
Distance between the matches.
- dmfloat array
Delta-mag between the matches. (m1 - m2)
- flystar.match.calc_triangles_vmax_angle(x, y)
- flystar.match.add_votes(votes, match1, match2)
- flystar.match.generic_match(sl1, sl2, init_mode='triangle', model=transforms.PolyTransform, order_dr=(1, 1.0), dr_final=1.0, xy_match=(None, None, None, None, None, None, None, None), m_match=(None, None, None, None), sigma_match=None, n_bright=100, verbose=True, **kwargs)
Finds the transformation between two starlists using the first one as reference frame. Different matching methods can be used. If no transformation is found, it returns an error message.
Parameters sl1 : StarList
starlist used for reference frame
- sl2StarList
starlist transformed
- init_modestr
Initial matching method. If ‘triangle’, uses the blind triangle method. If ‘match_name’, uses match by name If ‘load’, uses the transformation from a loaded file
- modelstr
Transformation model to be used with the ‘triangle’ initial mode
- poly_orderint
Order of the transformation model
- order_drint, float [n, 2]
Combinations of polinomial order (first column) and search radius (second column) to refine the transformation. Rows are executed in orders
- dr_final: float
Search radius used for the final matching
- n_brightint
Number of bright stars used in the initial blind triangles matching
- xy_matcharray
Area of the images to remove in the matching [reference catalog min x, reference catalog max x, reference catalog min y, reference catalog max y, transformed catalog min x, transformed catalog max x, transformed catalog min y, transformed catalog max y]. Use None for values not used.
- m_matcharray
Magnitude limits of matching stars used to find transformations [reference catalog min mag, reference catalog max mag, transformed catalog min mag, transformed catalog max mag]. Use None for values not used
- sigma_matcharray
Number of Deltap movement sigmas [0] used for sigma-cutting matched stars for a number of times [1]. Use None for no sigma-cut. The last polynomial order and search radius in ‘order_dr’ are used
- transf_filestr
File name and path of the transformation file used with the ‘load’ init_mode
- verbosebool, optional
Prints on screen information on the matching
Returns
- transfTransform2D
Transformation of the second starlist respect to the first
- stStarTable
Startable of the two matched catalogs