Re: Already written function to find if a point is within a rectangle? [message #79338] |
Mon, 20 February 2012 19:22  |
Craig Markwardt
Messages: 1869 Registered: November 1996
|
Senior Member |
|
|
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.
|
|
|
|
|
|
|
Re: Already written function to find if a point is within a rectangle? [message #79400 is a reply to message #79338] |
Wed, 22 February 2012 19:25  |
Jacare Omoplata
Messages: 6 Registered: February 2012
|
Junior Member |
|
|
>>> 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
|
|
|