[AstroPy] Some Feedbacks about Astropy
Guang Yang
yg1991 at mail.ustc.edu.cn
Fri Jul 11 23:28:40 EDT 2014
> As for the "matching mode", the idea is that there are a lot of
> different "modes" people use, and match_to_catalog_sky (or
> match_to_catalog_3d) along with the `nthneighbor` argument should be
> flexible enough to take care of most of them. Can you be more
> specific about exactly what sort of mode you think is missing?
Thanks for your response.
In fact, we *often* use one-one match. In the code you give, there might be repetitive elements in 'catalogwithmatches'. For example, for source A in 'catalog' there might be source B & C in 'coordstomatch' that both satisfy the criterion 'd2d < 3*u.arcmin'. In this case, we want to pick up only the nearest one, say if distance A_B < A_C, we only regard A_B as real match.
Though only several lines can carry it out, it's so frequently used that I think it should be a part of astropy.
best wishes,
guang
> -----Original email-----
> From: "Erik Tollerud" <erik.tollerud at gmail.com>
> Sent Time: Jul 12, 2014 5:05:07 AM
> To: "Astronomical Python mailing list" <astropy at scipy.org>
> Cc: "Guang Yang" <yg1991 at mail.ustc.edu.cn>
> Subject: Re: [AstroPy] Some Feedbacks about Astropy
>
> > 2. Though there's astropy.coordinates.matching.match_coordinates_sky to cross-correlate two catalogs, it doesn't allow user to specify matching radius and matching mode (e.g., one-one match). I've made a function to do so, and hope similar function can be included in astropy (https://github.com/Guang91/Astronomers_Tool_Box/blob/master/my_srcor.py).
>
> The idea is to use it like this (this is astropy 0.4 syntax - for
> astropy 0.3 it's similar, but replace SkyCoord with `ICRS` or whatever
> class makes sense for your coordinates):
>
> catalog = SkyCoord(ra_cat*u.deg, dec_cat*u.deg, frame='icrs')
> coordstomatch = SkyCoord(ra*u.deg, dec*u.deg, frame='icrs')
>
> idx, d2d, d3d = coordstomatch.match_to_catalog_sky(catalog)
>
> coordinateswithmatches = coordstomatch[d2d < 3*u.arcmin]
> catalogwithmatches = catalog[idx[d2d < 3*u.arcmin]]
>
>
> As for the "matching mode", the idea is that there are a lot of
> different "modes" people use, and match_to_catalog_sky (or
> match_to_catalog_3d) along with the `nthneighbor` argument should be
> flexible enough to take care of most of them. Can you be more
> specific about exactly what sort of mode you think is missing?
>
>
> This was not too thoroughly documented before v0.4 (the version about
> to be release), but there's a lot more there in v0.4. See
> http://devdocs.astropy.org/coordinates/matchsep.html#matching-catalogs
> (that's the developer documentation, but this will become
> http://docs.astropy.org/en/stable/coordinates/matchsep.html#matching-catalogs
> when 0.4 is released).
>
>
>
> --
> Erik T
More information about the AstroPy
mailing list