Thanks.<br>I used that too,but it seems it could only be used in polygon and you should know the vertices of the polygon?And you should convert ra&dec to physical coordinate on ccd first?<br>Hang<br><br><div class="gmail_quote">
On Fri, Feb 1, 2013 at 2:12 AM, Phil Rosenfield <span dir="ltr"><<a href="mailto:philrose@astro.washington.edu" target="_blank">philrose@astro.washington.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr"><br><div class="gmail_extra">I use nxutils for this:</div><div class="gmail_extra"><a href="http://matplotlib.org/api/nxutils_api.html" target="_blank">http://matplotlib.org/api/nxutils_api.html</a><br><br>
<br><div class="gmail_quote">

On Thu, Jan 31, 2013 at 10:00 AM,  <span dir="ltr"><<a href="mailto:astropy-request@scipy.org" target="_blank">astropy-request@scipy.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">


Send AstroPy mailing list submissions to<br>
        <a href="mailto:astropy@scipy.org" target="_blank">astropy@scipy.org</a><br>
<br>
To subscribe or unsubscribe via the World Wide Web, visit<br>
        <a href="http://mail.scipy.org/mailman/listinfo/astropy" target="_blank">http://mail.scipy.org/mailman/listinfo/astropy</a><br>
or, via email, send a message with subject or body 'help' to<br>
        <a href="mailto:astropy-request@scipy.org" target="_blank">astropy-request@scipy.org</a><br>
<br>
You can reach the person managing the list at<br>
        <a href="mailto:astropy-owner@scipy.org" target="_blank">astropy-owner@scipy.org</a><br>
<br>
When replying, please edit your Subject line so it is more specific<br>
than "Re: Contents of AstroPy digest..."<br>
<br>
<br>
Today's Topics:<br>
<br>
   1. point in ellipse (gonghang.naoc)<br>
   2. Re: point in ellipse (Tim Jenness)<br>
   3. Re: point in ellipse (Perry Greenfield)<br>
   4. Re: point in ellipse (Tim Jenness)<br>
   5. Re: point in ellipse (gonghang.naoc)<br>
   6. Re: point in ellipse (gonghang.naoc)<br>
<br>
<br>
----------------------------------------------------------------------<br>
<br>
Message: 1<br>
Date: Thu, 31 Jan 2013 02:33:51 +0800<br>
From: "gonghang.naoc" <<a href="mailto:ghang.naoc@gmail.com" target="_blank">ghang.naoc@gmail.com</a>><br>
Subject: [AstroPy] point in ellipse<br>
To: astropy <<a href="mailto:astropy@scipy.org" target="_blank">astropy@scipy.org</a>><br>
Message-ID:<br>
        <<a href="mailto:CABb23mvkRamvf-7m-atj%2B5moB3z2y4dRvvjQ8H3iUwoZNYxo6Q@mail.gmail.com" target="_blank">CABb23mvkRamvf-7m-atj+5moB3z2y4dRvvjQ8H3iUwoZNYxo6Q@mail.gmail.com</a>><br>
Content-Type: text/plain; charset="utf-8"<br>
<br>
hi?everybody?<div class="im"><br>
     I believe many people here use ds9 and know  its region file<br></div>
format.For example?we can make an ellipse if we know its center ra?dec and<div class="im"><br>
main aixs direction.Is there a pythonic way to judge whether a point is in<br></div>
an ellipse if we know ra&dec of the point?<div class="im"><br>
     Thank you.<br>
     Best wishes.<br>
     Hang<br></div>
-------------- next part --------------<br>
An HTML attachment was scrubbed...<br>
URL: <a href="http://mail.scipy.org/pipermail/astropy/attachments/20130131/87c11093/attachment-0001.html" target="_blank">http://mail.scipy.org/pipermail/astropy/attachments/20130131/87c11093/attachment-0001.html</a><br>



<br>
------------------------------<br>
<br>
Message: 2<br>
Date: Wed, 30 Jan 2013 11:47:52 -0700<br>
From: Tim Jenness <<a href="mailto:tim.jenness@gmail.com" target="_blank">tim.jenness@gmail.com</a>><br>
Subject: Re: [AstroPy] point in ellipse<br>
To: "gonghang.naoc" <<a href="mailto:ghang.naoc@gmail.com" target="_blank">ghang.naoc@gmail.com</a>><br>
Cc: astropy <<a href="mailto:astropy@scipy.org" target="_blank">astropy@scipy.org</a>><br>
Message-ID:<br>
        <CA+G92Rcuoc_kd+Uv32N58kj=<a href="mailto:7RhG2iwbUuUC84Z%2BQuSoJEh2CA@mail.gmail.com" target="_blank">7RhG2iwbUuUC84Z+QuSoJEh2CA@mail.gmail.com</a>><br>
Content-Type: text/plain; charset="utf-8"<div class="im"><br>
<br>
[now replying to list]<br>
<br>
You can use the Region class in pyast for that (it's not part of astropy).<br>
It has support for all the STC regions.<br>
<br>
 <a href="https://github.com/timj/starlink-pyast" target="_blank">https://github.com/timj/starlink-pyast</a><br>
<br>
AST is the library used internally by DS9.<br>
<br>
--<br>
Tim Jenness<br>
<br>
<br>
On Wed, Jan 30, 2013 at 11:33 AM, gonghang.naoc <<a href="mailto:ghang.naoc@gmail.com" target="_blank">ghang.naoc@gmail.com</a>>wrote:<br>
<br></div>
> hi?everybody?<div class="im"><br>
>      I believe many people here use ds9 and know  its region file<br></div>
> format.For example?we can make an ellipse if we know its center ra?dec and<div class="im"><br>
> main aixs direction.Is there a pythonic way to judge whether a point is in<br></div>
> an ellipse if we know ra&dec of the point?<div class="im"><br>
>      Thank you.<br>
>      Best wishes.<br>
>      Hang<br>
><br>
> _______________________________________________<br>
> AstroPy mailing list<br>
> <a href="mailto:AstroPy@scipy.org" target="_blank">AstroPy@scipy.org</a><br>
> <a href="http://mail.scipy.org/mailman/listinfo/astropy" target="_blank">http://mail.scipy.org/mailman/listinfo/astropy</a><br>
><br>
><br></div>
-------------- next part --------------<br>
An HTML attachment was scrubbed...<br>
URL: <a href="http://mail.scipy.org/pipermail/astropy/attachments/20130130/38b2b5d6/attachment-0001.html" target="_blank">http://mail.scipy.org/pipermail/astropy/attachments/20130130/38b2b5d6/attachment-0001.html</a><br>



<br>
------------------------------<br>
<br>
Message: 3<br>
Date: Wed, 30 Jan 2013 13:48:01 -0500<br>
From: Perry Greenfield <<a href="mailto:perry@stsci.edu" target="_blank">perry@stsci.edu</a>><br>
Subject: Re: [AstroPy] point in ellipse<br>
To: "gonghang.naoc" <<a href="mailto:ghang.naoc@gmail.com" target="_blank">ghang.naoc@gmail.com</a>><br>
Cc: astropy <<a href="mailto:astropy@scipy.org" target="_blank">astropy@scipy.org</a>><br>
Message-ID: <<a href="mailto:EBE9F98F-1ED3-4469-8F22-0732319F8405@stsci.edu" target="_blank">EBE9F98F-1ED3-4469-8F22-0732319F8405@stsci.edu</a>><br>
Content-Type: text/plain; charset=utf-8<div class="im"><br>
<br>
Sure.<br>
<br>
But I'm assuming you wanted more than that. I presume you are looking for a function to test if a coordinate (or array of coordinates) lies inside the ellipse or not. Yes, that can be done analytically. You want a python function that does that specifically? (No, I don't have one handy, but it shouldn't be hard to code).<br>



<br>
Perry<br>
<br>
On Jan 30, 2013, at 1:33 PM, gonghang.naoc wrote:<br>
<br></div>
> hi?everybody?<br>
>      I believe many people here use ds9 and know  its region file format.For example?we can make an ellipse if we know its center ra?dec and main aixs direction.Is there a pythonic way to judge whether a point is in an ellipse if we know ra&dec of the point?<div class="im">
<br>


>      Thank you.<br>
>      Best wishes.<br>
>      Hang<br>
>       _______________________________________________<br>
> AstroPy mailing list<br>
> <a href="mailto:AstroPy@scipy.org" target="_blank">AstroPy@scipy.org</a><br>
> <a href="http://mail.scipy.org/mailman/listinfo/astropy" target="_blank">http://mail.scipy.org/mailman/listinfo/astropy</a><br>
<br>
<br>
<br></div>
------------------------------<br>
<br>
Message: 4<br>
Date: Wed, 30 Jan 2013 11:56:34 -0700<br>
From: Tim Jenness <<a href="mailto:tim.jenness@gmail.com" target="_blank">tim.jenness@gmail.com</a>><br>
Subject: Re: [AstroPy] point in ellipse<br>
To: Perry Greenfield <<a href="mailto:perry@stsci.edu" target="_blank">perry@stsci.edu</a>><br>
Cc: astropy <<a href="mailto:astropy@scipy.org" target="_blank">astropy@scipy.org</a>><br>
Message-ID:<br>
        <<a href="mailto:CA%2BG92Rc4YowNQ2kqpVzVW0n%2BCs41YHwLk__kLyoeQSnD9HimYg@mail.gmail.com" target="_blank">CA+G92Rc4YowNQ2kqpVzVW0n+Cs41YHwLk__kLyoeQSnD9HimYg@mail.gmail.com</a>><br>
Content-Type: text/plain; charset="iso-8859-1"<div class="im"><br>
<br>
On Wed, Jan 30, 2013 at 11:48 AM, Perry Greenfield <<a href="mailto:perry@stsci.edu" target="_blank">perry@stsci.edu</a>> wrote:<br>
<br>
> Sure.<br>
><br>
> But I'm assuming you wanted more than that. I presume you are looking for<br>
> a function to test if a coordinate (or array of coordinates) lies inside<br>
> the ellipse or not. Yes, that can be done analytically. You want a python<br>
> function that does that specifically? (No, I don't have one handy, but it<br>
> shouldn't be hard to code).<br>
><br>
><br></div><div class="im">
pyast has this built in. Create an ellipse object and then ask whether a<br>
position (or set of positions) is inside or outside it.<br>
<br>
--<br>
Tim Jenness<br></div>
-------------- next part --------------<br>
An HTML attachment was scrubbed...<br>
URL: <a href="http://mail.scipy.org/pipermail/astropy/attachments/20130130/6b2b8edf/attachment-0001.html" target="_blank">http://mail.scipy.org/pipermail/astropy/attachments/20130130/6b2b8edf/attachment-0001.html</a><br>



<br>
------------------------------<br>
<br>
Message: 5<br>
Date: Thu, 31 Jan 2013 21:41:28 +0800<br>
From: "gonghang.naoc" <<a href="mailto:ghang.naoc@gmail.com" target="_blank">ghang.naoc@gmail.com</a>><br>
Subject: Re: [AstroPy] point in ellipse<br>
To: Tim Jenness <<a href="mailto:tim.jenness@gmail.com" target="_blank">tim.jenness@gmail.com</a>>, astropy <<a href="mailto:astropy@scipy.org" target="_blank">astropy@scipy.org</a>><br>
Message-ID:<br>
        <<a href="mailto:CABb23mtsqd6Y2-qE4Dgpm8KoHOhj-f6ftkoOFM84TNpT3b8QXQ@mail.gmail.com" target="_blank">CABb23mtsqd6Y2-qE4Dgpm8KoHOhj-f6ftkoOFM84TNpT3b8QXQ@mail.gmail.com</a>><br>
Content-Type: text/plain; charset="iso-8859-1"<div class="im"><br>
<br>
Thank you very much. <a href="http://dsberry.github.com/starlink/node1.html" target="_blank">http://dsberry.github.com/starlink/node1.html</a> is<br>
helpful.<br></div>
Hang<br>
<br><div class="im">
On Thu, Jan 31, 2013 at 2:56 AM, Tim Jenness <<a href="mailto:tim.jenness@gmail.com" target="_blank">tim.jenness@gmail.com</a>> wrote:<br>
<br>
><br>
><br>
><br></div>
> On Wed, Jan 30, 2013 at 11:48 AM, Perry Greenfield <<a href="mailto:perry@stsci.edu" target="_blank">perry@stsci.edu</a>>wrote:<div class="im"><br>
><br>
>> Sure.<br>
>><br>
>> But I'm assuming you wanted more than that. I presume you are looking for<br>
>> a function to test if a coordinate (or array of coordinates) lies inside<br>
>> the ellipse or not. Yes, that can be done analytically. You want a python<br>
>> function that does that specifically? (No, I don't have one handy, but it<br>
>> shouldn't be hard to code).<br>
>><br>
>><br></div><div class="im">
> pyast has this built in. Create an ellipse object and then ask whether a<br>
> position (or set of positions) is inside or outside it.<br>
><br>
> --<br>
> Tim Jenness<br>
><br>
><br></div>
-------------- next part --------------<br>
An HTML attachment was scrubbed...<br>
URL: <a href="http://mail.scipy.org/pipermail/astropy/attachments/20130131/edd5670b/attachment-0001.html" target="_blank">http://mail.scipy.org/pipermail/astropy/attachments/20130131/edd5670b/attachment-0001.html</a><br>



<br>
------------------------------<br>
<br>
Message: 6<br>
Date: Thu, 31 Jan 2013 21:49:11 +0800<br>
From: "gonghang.naoc" <<a href="mailto:ghang.naoc@gmail.com" target="_blank">ghang.naoc@gmail.com</a>><br>
Subject: Re: [AstroPy] point in ellipse<br>
To: astropy <<a href="mailto:astropy@scipy.org" target="_blank">astropy@scipy.org</a>><br>
Message-ID:<br>
        <CABb23mu6XjxxTk=<a href="mailto:8FD67BuJ_KwtymPK9uCutASitZUhJ9WfY7w@mail.gmail.com" target="_blank">8FD67BuJ_KwtymPK9uCutASitZUhJ9WfY7w@mail.gmail.com</a>><br>
Content-Type: text/plain; charset="utf-8"<div class="im"><br>
<br>
Thank you.oh, I thought a graphic way might be more convenient than a<br>
mathematical way .I am lazy to calculate..<br>
Hang<br>
<br>
On Thu, Jan 31, 2013 at 2:48 AM, Perry Greenfield <<a href="mailto:perry@stsci.edu" target="_blank">perry@stsci.edu</a>> wrote:<br>
<br>
> Sure.<br>
><br>
> But I'm assuming you wanted more than that. I presume you are looking for<br>
> a function to test if a coordinate (or array of coordinates) lies inside<br>
> the ellipse or not. Yes, that can be done analytically. You want a python<br>
> function that does that specifically? (No, I don't have one handy, but it<br>
> shouldn't be hard to code).<br>
><br>
> Perry<br>
><br>
> On Jan 30, 2013, at 1:33 PM, gonghang.naoc wrote:<br>
><br></div>
> > hi?everybody?<div class="im"><br>
> >      I believe many people here use ds9 and know  its region file<br></div>
> format.For example?we can make an ellipse if we know its center ra?dec and<div class="im"><br>
> main aixs direction.Is there a pythonic way to judge whether a point is in<br></div>
> an ellipse if we know ra&dec of the point?<div class="im"><br>
> >      Thank you.<br>
> >      Best wishes.<br>
> >      Hang<br>
> >       _______________________________________________<br>
> > AstroPy mailing list<br>
> > <a href="mailto:AstroPy@scipy.org" target="_blank">AstroPy@scipy.org</a><br>
> > <a href="http://mail.scipy.org/mailman/listinfo/astropy" target="_blank">http://mail.scipy.org/mailman/listinfo/astropy</a><br>
><br>
><br></div>
-------------- next part --------------<br>
An HTML attachment was scrubbed...<br>
URL: <a href="http://mail.scipy.org/pipermail/astropy/attachments/20130131/227dd97f/attachment-0001.html" target="_blank">http://mail.scipy.org/pipermail/astropy/attachments/20130131/227dd97f/attachment-0001.html</a><br>



<br>
------------------------------<div class="im"><br>
<br>
_______________________________________________<br>
AstroPy mailing list<br>
<a href="mailto:AstroPy@scipy.org" target="_blank">AstroPy@scipy.org</a><br>
<a href="http://mail.scipy.org/mailman/listinfo/astropy" target="_blank">http://mail.scipy.org/mailman/listinfo/astropy</a><br>
<br>
<br></div>
End of AstroPy Digest, Vol 76, Issue 11<br>
***************************************<span class="HOEnZb"><font color="#888888"><br>
</font></span></blockquote></div><span class="HOEnZb"><font color="#888888"><br><br clear="all"><div><br></div>-- <br>Phil Rosenfield<br>Graduate Student: UW Astronomy<br>Additional contact info: <br><a href="http://www.astro.washington.edu/philrose" target="_blank">http://www.astro.washington.edu/philrose</a>
</font></span></div></div>
<br>_______________________________________________<br>
AstroPy mailing list<br>
<a href="mailto:AstroPy@scipy.org">AstroPy@scipy.org</a><br>
<a href="http://mail.scipy.org/mailman/listinfo/astropy" target="_blank">http://mail.scipy.org/mailman/listinfo/astropy</a><br>
<br></blockquote></div><br>