comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Pixel positions passing trough a curve
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Pixel positions passing trough a curve [message #93737 is a reply to message #93736] Tue, 11 October 2016 07:43 Go to previous messageGo to previous message
Markus Schmassmann is currently offline  Markus Schmassmann
Messages: 129
Registered: April 2016
Senior Member
On 10/11/2016 04:30 PM, miguelfigueirasebastiao@gmail.com wrote:
> On 10/11/2016 02:36 PM, miguelfigueirasebastiao@gmail.com wrote:
>> I am trying to construct a program that produces a
>> position-velocity diagram whose shape can be fitted by a certain
>> equation (and plotted).
>>
>> I wanted to know if it was possible to obtain somehow the pixels
>> position trough a path I choose. For example, I draw a line (in
>> ds9) from (0,0) to (10,0) and I want to know which pixels represent
>> the line. In this case, the program would give (0,0), (1,0),
>> (2,0),...,(10,0). The thing is that I want to draw an arbitrary
>> path (not necesarily in ds9) and get automatically the points.
>>
>> For the moment, I put a circle, in ds9, in each pixel of the path
>> and obtain the list of pixel positions and saving the region in xy
>> format.
>> I use this catalogue as an input of my program. If there is
>> a way to do it automatically (or some ideas) or an already existing
>> program, I would like to know more.
> Thank you for your answer but maybe it is not completely what I want
> (except if I use very simple path)
>
> In your program, I have to give the coordinates of the beginning and
> end of the segments but if my path is complicated (ellipsis or
> multi-segment path) it seems to be better to make directly the list
> on ds9.
>
> In other words, is it possible to draw a curved line and obtain the
> pixels passing through this curve ?
brute force approach:
- export the curve into a graphic (pixels not vector) without axes
(either plot a line or use sufficient dots to cover the line)
- import into an IDL array
IDL> w=where(array ne 0)
IDL> ari=array_indices(array,w)
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: IDL intro
Next Topic: ncdf_varput for NetCDF coordinate axes

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 13:57:06 PDT 2025

Total time taken to generate the page: 0.00410 seconds