HMpTy.htm.sets module ∞
Given a list of coordinates and a crossmatch radius, split the list up into sets of associated locations
- Author
David Young
-
class
sets
(log, ra, dec, radius, sourceList, convertToArray=True)[source] ∞ Bases:
object
Given a list of coordinates and a crossmatch radius, split the list up into sets of associated locations
Key Arguments
log
– loggerra
– a list of the corrdinate right ascensionsdec
– a list of the corrdinate declinations (same length asra
)radius
– the radius to crossmatch the list of coordinates against itself (degrees)sourceList
– the list of source imformation to be divided into associated sets (same length asra
anddec
)convertToArray
– convert the coordinates into an array. Default True. Can bypass the conversion check if you are sure coordinates in numpy array
Usage
Given a list of transient metadata (any list, possibly a list of dictionaries) you can divide the list to assoicated sets of transients by running the following code:
from HMpTy.htm import sets xmatcher = sets( log=log, ra=raList, dec=decList, radius=10 / (60. * 60.), sourceList=transientList ) allMatches = xmatcher.match
raList
anddecList
are the coordinates for the sources found in thetransientList
and are therefore the same length as the transientList``(it’s up to the user to create these lists). This code will group the sources into set of assocated transients which are within a radius of 10 arcsecs from one-another.`allMatches`` is a list of lists, each contained list being an associate group of sources.:width: 800px :alt: divide a list of sources into associated sets