[AstroPy] got centroid?

Marshall Perrin mperrin at stsci.edu
Thu Apr 12 18:45:37 EDT 2012


On Apr 12, 2012, at 6:12 PM, Wolfgang Kerzendorf wrote:
I just wanted to know if anyone has a quick and smart centroid script in any of the python libraries (easily installable). Even better would be star finding algorithms like sextractor.


This is not in a standard library but should be easily installable:  My webbpsf package (for optical simulations of JWST) includes an implementation of the unbiased floating window centroid algorithm adopted for target acquisitions with JWST.  (Note that this algorithm may be considered more smart than quick...)

You can get the entire webbpsf package from http://www.stsci.edu/jwst/software/webbpsf, but as that's overkill for this purpose I attach here just the one relevant file.

Cheers,

 - Marshall





On Apr 12, 2012, at 6:26 PM, Adrian Price-Whelan wrote:

This may not help you because it's not so smart, but to zeroth order, you can
do something like this:

import scipy.ndimage as snd
labels, num = snd.label(imageData > (2.*sigma), np.ones((3,3)))
starCoordinates = snd.center_of_mass(imageData, labels, range(1,num+1))

Obviously it's making some nasty assumptions about the image, but it's at
least a place to start.

- Adrian

On Apr 12, 2012, at 6:12 PM, Wolfgang Kerzendorf wrote:

Hey all,

I just wanted to know if anyone has a quick and smart centroid script in any of the python libraries (easily installable). Even better would be star finding algorithms like sextractor.

Cheers
   Wolfgang
_______________________________________________
AstroPy mailing list
AstroPy at scipy.org<mailto:AstroPy at scipy.org>
http://mail.scipy.org/mailman/listinfo/astropy

--
Adrian Price-Whelan
Department of Astronomy
Columbia University



_______________________________________________
AstroPy mailing list
AstroPy at scipy.org<mailto:AstroPy at scipy.org>
http://mail.scipy.org/mailman/listinfo/astropy

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/astropy/attachments/20120412/e7081407/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: fwcentroid.py
Type: text/x-python-script
Size: 8654 bytes
Desc: fwcentroid.py
URL: <http://mail.python.org/pipermail/astropy/attachments/20120412/e7081407/attachment.bin>


More information about the AstroPy mailing list