comp.lang.idl-pvwave archive - RDF feed
type: channel
description: Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado
items: Re: Already written function to find if a point is within a rectangle?

Re: Already written function to find if a point is within a rectangle?
type: item
description: Jacare Omoplata writes: > So I need a way to find out if a point ( position of a star ) is > within a rectangle ( image boundary ). The rectangle edges are not > strictly horizontal or vertical. > > I've found several methods of doing this, and can write a function. > But I can save some time if someone knows if there's already one > available out there. This "point inside polygon" code might be helpful: http://www.idlcoyote.com/tips/point_in_polygon.html Cheers, David -- David Fanning, Ph.D. Fanning Software Consulting, Inc. Coyote's Guide to IDL Programming: http://www.idlcoyote.com/ Sepore ma de ni thui. ("Perhaps thou speakest truth.")
creator: David Fanning
date: 2012-02-20T22:09:28-00:00

Re: Already written function to find if a point is within a rectangle?
type: item
description: > So I need a way to find out if a point ( position of a star ) is > within a rectangle ( image boundary ). The rectangle edges are not > strictly horizontal or vertical. You talk about coordinates in RA and dec. So are the images really rectangular? It seems to me that the real problem is that you need to deal with spherical geometry.
creator: penteado
date: 2012-02-20T22:56:34-00:00

Re: Already written function to find if a point is within a rectangle?
type: item
description: > > This "point inside polygon" code might be helpful: > > http://www.idlcoyote.com/tips/point_in_polygon.html > Thanks!
creator: Jacare Omoplata
date: 2012-02-20T23:37:04-00:00

Re: Already written function to find if a point is within a rectangle?
type: item
description: > > You talk about coordinates in RA and dec. So are the images really > rectangular? It seems to me that the real problem is that you need to > deal with spherical geometry. The angle is very small and the images were taken very close to the ecliptic. But I'll redo the same thing taking spherical geometry in to account later, if I have time. Thanks for pointing that out.
creator: Jacare Omoplata
date: 2012-02-20T23:47:21-00:00

Re: Already written function to find if a point is within a rectangle?
type: item
description: On Feb 20, 5:56 pm, Paulo Penteado <pp.pente...@gmail.com> wrote: >> So I need a way to find out if a point ( position of a star ) is >> within a rectangle ( image boundary ). The rectangle edges are not >> strictly horizontal or vertical. > > You talk about coordinates in RA and dec. So are the images really > rectangular? It seems to me that the real problem is that you need to > deal with spherical geometry. Not only that, but an "image boundary" will be projection-dependent [*]. For small images it probably won't matter much, but there will always be an edge case that gets you later. Craig [*] "projection" = the cartographic projection which was used to turn a curved sky into a flat image.
creator: Craig Markwardt
date: 2012-02-21T03:22:38-00:00

Re: Already written function to find if a point is within a rectangle?
type: item
description: >>> So I need a way to find out if a point ( position of a star ) is >>> within a rectangle ( image boundary ). The rectangle edges are not >>> strictly horizontal or vertical. > >> You talk about coordinates in RA and dec. So are the images really >> rectangular? It seems to me that the real problem is that you need to >> deal with spherical geometry. > > Not only that, but an "image boundary" will be projection-dependent > [*]. For small images it probably won't matter much, but there will > always be an edge case that gets you later. > I'm thinking of making polygons with a large number of edges, instead of rectangles, with every data point at the edge of a FITS file as a vertex. That would minimize the projection error, right? Thanks
creator: Jacare Omoplata
date: 2012-02-23T03:25:52-00:00