[Numpy-discussion] Finding Star Images on a Photo (Video chip) Plate?

Anne Archibald aarchiba at physics.mcgill.ca
Fri May 28 23:31:02 EDT 2010


On 28 May 2010 23:59, Wayne Watson <sierra_mtnview at sbcglobal.net> wrote:
> That opened a few avenues. After reading this, I went on a merry search with
> Google. I hit upon one interesting book, Handbook of CCD astronomy (Steve B.
> Howell), that discusses PSFs. A Amazon Look Inside suggests this is mostly
> about h/w. I tried to figure out how to reach the scipy mail list, but, as
> once a year ago, couldn't figure out the newsgroup GMANE connection. This
> search recalled to mind my Handbook of Astro Image  Processing by Berry and
> Burnell. It has a few pages on the PSF. In the ref section for that
> material(PSFs) there's another ref to Steve Howell that may be of use: Astro
> CCD Observing and Reduction Techniques, ASP, Pacific Conf. Series, vol. 23,
> 1992. There are further Berry and Burnell refs that may be applicable.

Ah, sorry, I've been at an astro conference all week, I should have
expanded that acronym. PSF is short for "Point Spread Function"; the
idea is that with an optically good telescope, a point source anywhere
in the field of view produces a blob of characteristic shape (often
roughly a two-dimensional Gaussian) in your detector. The shape and
size of this blob is set by your optics (including diffraction) and
the atmospheric seeing. A star, being intrinsically a point source,
produces a brighter or less bright version of this blob centered on
the star's true position. To accurately measure the star's position
(and often brightness) one usually fits a model blob to the noisy blob
coming from the star of interest.

I should note that this requires you to have more pixels than you
"need", so that even a point source is spread over many pixels;
without this it's impossible to get subpixel positioning (among other
things). Older consumer digital cameras often lacked this, since it
was difficult to put enough pixels on a CCD, but fortunately megapixel
mania has helpfully ensured that no matter how sharp the focus, every
feature in your image is smeared over many pixels.

> I probed IRAF, SciPy, and Python, but it looks like a steep learning curve.
> The SciPy tutorial page looks like overkill. They have what looks like very
> large tutorials. Perhaps daunting. I did a quick shot at pyraf, a tutorial
> page, but note it has a prereq of IRAF. Another daunting path.

Wait, you think SciPy has too many tutorials? Or that they're too
detailed? Just pick a short, easy, or sketchy one then. Here's one
that's all three:

>>> import scipy.stats
>>> scipy.stats.norm.cdf(3)
0.9986501019683699

That's the value of the CDF of a standard normal at three sigma, i.e.,
one minus the false positive probability for a one-sided three sigma
detection.

> Well, maybe a DIY approach will do the trick for me.

I haven't used IRAF yet (though I have data sets waiting), and I do
understand the urge to write your own code rather than understanding
someone else's, but let me point out that reliably extracting source
parameters from astronomical images is *hard* and requires cleverness,
attention to countless special cases, troubleshooting, and experience.
But it's an old problem, and astronomers have taken all of the needed
things listed above and built them into IRAF. Do consider using it.

Anne

> On 5/28/2010 5:41 PM, Anne Archibald wrote:
>
> On 28 May 2010 21:09, Charles R Harris <charlesr.harris at gmail.com> wrote:
>
>
> On Fri, May 28, 2010 at 5:45 PM, Wayne Watson <sierra_mtnview at sbcglobal.net>
> wrote:
>
>
> Suppose I have a 640x480 pixel video chip and would like to find star
> images on it, possible planets and the moon. A possibility of noise
> exits, or bright pixels. Is there a known method for finding the
> centroids of these astro objects?
>
>
>
> You can threshold the image and then cluster the pixels in objects. I've
> done this on occasion using my own software, but I think there might be
> something in scipy/ndimage that does the same. Someone here will know.
>
>
> There are sort of two passes here - the first is to find all the
> stars, and the second is to fine down their positions, ideally to less
> than a pixel. For the former, thresholding and clumping is probably
> the way to go.
>
> For the latter I think a standard approach is PSF fitting - that is,
> you fit (say) a two-dimensional Gaussian to the pixels near your star.
> You'll fit for at least central (subpixel) position, probably radius,
> and maybe eccentricity and orientation. You might even fit for a more
> sophisticated PSF (doughnuts are natural for Schmidt-Cassegrain
> telescopes, or the diffraction pattern of your spider). Any spot whose
> best-fit PSF is just one pixel wide is noise or a cosmic ray hit or a
> hotpixel; any spot whose best-fit PSF is huge is a detector splodge or
> a planet or galaxy.
>
> All this assumes that your CCD has more resolution than your optics;
> if this is not the case you're more or less stuck, since a star is
> then just a bright pixel. In this case your problem is one of
> combining multiple offset images, dark skies, and dome flats to try to
> distinguish detector crud and cosmic ray hits from actual stars. It
> can be done, but it will be a colossal pain if your pointing accuracy
> is not subpixel (which it probably won't be).
>
> In any case, my optical friends tell me that the Right Way to do all
> this is to use all the code built into IRAF (or its python wrapper,
> pyraf) that does all this difficult work for you.
>
> Anne
> P.S. if your images have been fed through JPEG or some other lossy
> compression the process will become an utter nightmare. -A
>
>
>
> Chuck
>
>
> _______________________________________________
> NumPy-Discussion mailing list
> NumPy-Discussion at scipy.org
> http://mail.scipy.org/mailman/listinfo/numpy-discussion
>
>
>
>
> _______________________________________________
> NumPy-Discussion mailing list
> NumPy-Discussion at scipy.org
> http://mail.scipy.org/mailman/listinfo/numpy-discussion
>
>
>
> --
>            Wayne Watson (Watson Adventures, Prop., Nevada City, CA)
>
>              (121.015 Deg. W, 39.262 Deg. N) GMT-8 hr std. time)
>               Obz Site:  39° 15' 7" N, 121° 2' 32" W, 2700 feet
>
>                There are no statues or memorials dedicated to
>                Thomas Paine for his substantial part in the
>                American Revolution.
>
>                 -- An observation in The Science of Liberty
>                       by Timothy Ferris
>
>
>                     Web Page: <www.speckledwithstars.net/>
>
> _______________________________________________
> NumPy-Discussion mailing list
> NumPy-Discussion at scipy.org
> http://mail.scipy.org/mailman/listinfo/numpy-discussion
>
>



More information about the NumPy-Discussion mailing list