[AstroPy] AstroPy Digest, Vol 69, Issue 19

Sebastian sebas0 at gmail.com
Fri May 11 13:18:53 EDT 2012


Response to Message: 1

I have python code I developed with Eric Tollerud and his astropysics that
uses a KD-Tree
for this.

It is very quick. I can pass it to you if you like.

regards,
- Sebastian


On Fri, May 11, 2012 at 2:00 PM, <astropy-request at scipy.org> wrote:

> Send AstroPy mailing list submissions to
>        astropy at scipy.org
>
> To subscribe or unsubscribe via the World Wide Web, visit
>        http://mail.scipy.org/mailman/listinfo/astropy
> or, via email, send a message with subject or body 'help' to
>        astropy-request at scipy.org
>
> You can reach the person managing the list at
>        astropy-owner at scipy.org
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of AstroPy digest..."
>
>
> Today's Topics:
>
>   1. Re: Cross matching two source lists (Christoph Deil)
>   2. Re: Cross matching two source lists (Erin Sheldon)
>   3. Re: Cross matching two source lists (Eduardo Ba?ados Torres)
>   4. Re :  Cross matching two source lists (Jerome Caron)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Fri, 11 May 2012 13:30:38 +0100
> From: Christoph Deil <Christoph.Deil at mpi-hd.mpg.de>
> Subject: Re: [AstroPy] Cross matching two source lists
> To: Thomas Robitaille <thomas.robitaille at gmail.com>
> Cc: astropy mailing list <astropy at scipy.org>
> Message-ID: <9E5B32B8-8358-43BF-8DC2-CC7340CCBBD6 at mpi-hd.mpg.de>
> Content-Type: text/plain; charset="us-ascii"
>
> Hi Tom,
>
> STILTS [1] and TOPCAT [2] have excellent cross-matching functionality,
> provided via the STIL [3] library.
> You can browse the code online [4].
>
> Unfortunately it's all Java and can only be accessed from Jython, not
> CPython [5].
>
> Because all my analysis scripts are CPython I am saving my source lists to
> FITS files and make an external call to stilts for the cross-matching at
> the moment.
>
> Having similar functionality in astropy would be great!
>
> Christoph
>
> [1] http://www.star.bris.ac.uk/~mbt/stilts
> [2] http://www.star.bris.ac.uk/~mbt/topcat/
> [3] http://www.star.bris.ac.uk/~mbt/stil/
> [4]
> http://www.star.bristol.ac.uk/~mbt/stil/javadocs/uk/ac/starlink/table/join/package-summary.html
> [5] http://www.star.bris.ac.uk/~mbt/stilts/sun256/sun256.html#jystilts
>
> On May 11, 2012, at 9:03 AM, Thomas Robitaille wrote:
>
> > Hi everyone,
> >
> > I am looking for a Python package that can do arbitrary and efficient
> > cross-matching of source lists, i.e. some kind of kd-tree that uses
> > spherical rather than euclidean distances. Is anyone aware of such a
> > package?
> >
> > Thanks,
> > Tom
> > _______________________________________________
> > AstroPy mailing list
> > AstroPy at scipy.org
> > http://mail.scipy.org/mailman/listinfo/astropy
>
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL:
> http://mail.scipy.org/pipermail/astropy/attachments/20120511/312a229c/attachment-0001.html
>
> ------------------------------
>
> Message: 2
> Date: Fri, 11 May 2012 09:08:27 -0400
> From: Erin Sheldon <erin.sheldon at gmail.com>
> Subject: Re: [AstroPy] Cross matching two source lists
> To: Thomas Robitaille <thomas.robitaille at gmail.com>
> Cc: astropy mailing list <astropy at scipy.org>
> Message-ID: <1336741356-sup-102 at rohan>
> Content-Type: text/plain; charset=UTF-8
>
> Excerpts from Thomas Robitaille's message of Fri May 11 04:03:18 -0400
> 2012:
> > Hi everyone,
> >
> > I am looking for a Python package that can do arbitrary and efficient
> > cross-matching of source lists, i.e. some kind of kd-tree that uses
> > spherical rather than euclidean distances. Is anyone aware of such a
> > package?
>
> Hi Thomas-
>
> The HTM module in esutil does this.
>
>    http://code.google.com/p/esutil/
>
>
> http://code.google.com/p/esutil/source/browse/trunk/esutil/htm/__init__.py
>
> It indexes the sky using a Hierarchical Triangular Mesh, which is a
> quaternary tree.
>
> Example to find the closest match between two lists within an arcsecond:
>
>    from esutil import htm
>
>    h = htm.HTM()
>    maxrad=1.0/3600.0
>    m1,m2,radius = h.match(ra1,dec1,ra2,dec2,maxrad)
>
> m1 and m2 are index arrays for the matched pairs and radius is the
> match distance.  You can also allow more than one match.
>
> I hope this helps,
> -e
> --
> Erin Scott Sheldon
> Brookhaven National Laboratory
>
>
> ------------------------------
>
> Message: 3
> Date: Fri, 11 May 2012 15:57:01 +0200
> From: Eduardo Ba?ados Torres <eebanado at uc.cl>
> Subject: Re: [AstroPy] Cross matching two source lists
> To: Erin Sheldon <erin.sheldon at gmail.com>
> Cc: astropy mailing list <astropy at scipy.org>
> Message-ID:
>        <CAE_d_sCo7TY3kXx5bXAGXY7JvPQ10fdDPR24RX5kKT=9n6bWPA at mail.gmail.com
> >
> Content-Type: text/plain; charset=windows-1252
>
> Hi Thomas,
>
> I'm not sure if this is what you want, but I'm using LSD to
> cross-match huge catalogs (3pi of the sky), LSD is written in python
> and is multi-thread! so is very fast (though the installation is not
> that trivial).
>
> The first line of the documentation is:
>
> The Large Survey Database (LSD) is a framework for storing,
> cross-matching, querying, and rapidly iterating through large survey
> datasets (catalogs of >109 rows, >1 TB) on multi-core machines. It is
> implemented in Python, written and maintained by Mario Juric
> (mjuric@?).
>
> all the information is here:
> http://mwscience.net/trac/wiki/LargeSurveyDatabase
>
> Well if you need more help or examples you can contact me
>
> and yes.. I also think it would be nice to have a cross-matching
> algorithm in astropy
>
> Cheers,
>
>
> On Fri, May 11, 2012 at 3:08 PM, Erin Sheldon <erin.sheldon at gmail.com>
> wrote:
> > Excerpts from Thomas Robitaille's message of Fri May 11 04:03:18 -0400
> 2012:
> >> Hi everyone,
> >>
> >> I am looking for a Python package that can do arbitrary and efficient
> >> cross-matching of source lists, i.e. some kind of kd-tree that uses
> >> spherical rather than euclidean distances. Is anyone aware of such a
> >> package?
> >
> > Hi Thomas-
> >
> > The HTM module in esutil does this.
> >
> > ? ?http://code.google.com/p/esutil/
> >
> > ? ?
> http://code.google.com/p/esutil/source/browse/trunk/esutil/htm/__init__.py
> >
> > It indexes the sky using a Hierarchical Triangular Mesh, which is a
> > quaternary tree.
> >
> > Example to find the closest match between two lists within an arcsecond:
> >
> > ? ?from esutil import htm
> >
> > ? ?h = htm.HTM()
> > ? ?maxrad=1.0/3600.0
> > ? ?m1,m2,radius = h.match(ra1,dec1,ra2,dec2,maxrad)
> >
> > m1 and m2 are index arrays for the matched pairs and radius is the
> > match distance. ?You can also allow more than one match.
> >
> > I hope this helps,
> > -e
> > --
> > Erin Scott Sheldon
> > Brookhaven National Laboratory
> > _______________________________________________
> > AstroPy mailing list
> > AstroPy at scipy.org
> > http://mail.scipy.org/mailman/listinfo/astropy
>
>
>
> --
> Eduardo Ba?ados Torres
>
>
> ------------------------------
>
> Message: 4
> Date: Fri, 11 May 2012 15:12:10 +0100 (BST)
> From: Jerome Caron <jerome_caron_astro at ymail.com>
> Subject: [AstroPy] Re :  Cross matching two source lists
> To: "astropy at scipy.org" <astropy at scipy.org>
> Message-ID:
>        <1336745530.78488.YahooMailNeo at web28802.mail.ir2.yahoo.com>
> Content-Type: text/plain; charset="iso-8859-1"
>
> A side-question linked to matching two lists..
> If the coordinate systems between the two lists are already matched, then
> the most simple algorithm is probably- remove the duplicates, i.e. the same
> (x2,y2) being paired with two different (x1,y1), and keep the closest pair.
> - for each (x1,y1) find the closest (x2,y2) such that
> dist((x1,y1),(x2,y2))<=criterium
> I think t
> This occurs for instance with
> list1?= (0,0), (3,0)
> list2 = (1,0), (2,2)
> Then
> findpairs(x1, y1, x2, y2, criterium) -> 1 pair
> findpairs(x2, y2, x1, y1, criterium) -> 2 pairs
> Sorry for distracting the discussion from the initial thread..
> Thankshis algorithm has the feature that findpairs(x1, y1, x2, y2,
> criterium) and findpairs(x2, y2, x1, y1, criterium) (reversed arguments)
> may not always return the same results. Is there?any solution to this ?
> Jerome
>
>
> ________________________________
> De?: Thomas Robitaille <thomas.robitaille at gmail.com>
> ??: astropy mailing list <astropy at scipy.org>
> Envoy? le : Vendredi 11 mai 2012 10h03
> Objet?: [AstroPy] Cross matching two source lists
>
> Hi everyone,
>
> I am looking for a Python package that can do arbitrary and efficient
> cross-matching of source lists, i.e. some kind of kd-tree that uses
> spherical rather than euclidean distances. Is anyone aware of such a
> package?
>
> Thanks,
> Tom
> _______________________________________________
> AstroPy mailing list
> AstroPy at scipy.org
> http://mail.scipy.org/mailman/listinfo/astropy
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL:
> http://mail.scipy.org/pipermail/astropy/attachments/20120511/a905617e/attachment-0001.html
>
> ------------------------------
>
> _______________________________________________
> AstroPy mailing list
> AstroPy at scipy.org
> http://mail.scipy.org/mailman/listinfo/astropy
>
>
> End of AstroPy Digest, Vol 69, Issue 19
> ***************************************
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/astropy/attachments/20120511/f2e72052/attachment.html>


More information about the AstroPy mailing list