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

Home » Public Forums » archive » extract points of acircle
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: extract points of acircle [message #93560 is a reply to message #93559] Thu, 18 August 2016 10:46 Go to previous messageGo to previous message
wlandsman is currently offline  wlandsman
Messages: 743
Registered: June 2000
Senior Member
Its not the most efficient way, but I would use the program dist_circle.pro
http://idlastro.gsfc.nasa.gov/ftp/pro/image/dist_circle.pro

dist_circle, dim, N, xcenter, ycenter
g = where( dim lt radius)

where N is the dimension of the square array. g will give the 1-d index of every pixel within the specified radius. You can use ARRAY_INDICES() to convert this 1d index into separate X and Y subscript values. --Wayne


On Thursday, August 18, 2016 at 10:30:18 AM UTC-4, AGW wrote:
> On Tuesday, August 16, 2016 at 5:21:20 PM UTC+2, AGW wrote:
>> Hi,
>> I want to plot four circles on picture then extract mean x,y for every circle
>> I use this program.
>>
>> ;******************************************
>> FUNCTION CIRCLE, xcenter, ycenter, radius
>> points = (2 * !PI / 99.0) * FINDGEN(100)
>> x = xcenter + radius * COS(points )
>> y = ycenter + radius * SIN(points )
>> RETURN, TRANSPOSE([[x],[y]])
>> END
>>
>> restore,file='sm.isv' ;/v
>> sm1=sm[*,*,5]
>> window,0,xs=999,ys=512
>> tvscl,sm1
>>
>> n=5
>> for i=0,n-1 do begin
>> radius=10*i
>> pp=circle(200,352,radius)
>> cgPlotS, pp,color='red',thick=2.0, /Device
>>
>> ;*************************************
>>
>> at this point no problem, I want to print mean(x,y) for every circle
>>
>> how can I do it ?
>>
>> help, please
>
> every point in circle have a coordinates x,y, I want to extract this coordinates for every circle
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Calling Supermongo in IDL
Next Topic: How convert the grid size from irregular grid to regrid size using CMIP5 model in IDL?

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

Current Time: Wed Oct 08 13:38:33 PDT 2025

Total time taken to generate the page: 0.00396 seconds