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

Home » Public Forums » archive » Rasterize an image
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Rasterize an image [message #52318] Fri, 26 January 2007 13:39
Dave[3] is currently offline  Dave[3]
Messages: 12
Registered: November 2006
Junior Member
Hi all,

I suspect this is trivial (an IDL 2-liner) and I'm struggling on a
Friday... I am trying to model what an image from a known object will
look like using a low-res CCD detector. I can define the shape of the
object being imaged in a simple equation and I know its radiant
flux/color as a function of the radius. The trivial example below
draws a circle and an ellipse using vectors. What I would like to know
is what these would look like if I used a 256x256 array to image them.
All tips, hints and examples greatly appreciated!

Have a great weekend,
Dave

Example:

np = 101
grd = 2*findgen(np)/(np-1) - 1.0

; circle
o = [-1.0, -4.0] ; offset
r = 10.0 ; radius
xc = r * grd
yc = sqrt(r^2 - xc^2)

xc_im = [xc[0:np-1],reverse( xc[0:np-1])] + o[0] ; make the half
circle whole
yc_im = [yc[0:np-1],reverse(-1*yc[0:np-1])] + o[1]

; elipse
o = [2.0, 3.0] ; offset
a = 11.0 ; x semi-axis
b = 8.0 ; y semi-axis
xe = a * grd
ye = b/a * sqrt(a^2 - xe^2)

xe_im = [xe[0:np-1],reverse( xe[0:np-1])] + o[0] ; make the half
elipse whole
ye_im = [ye[0:np-1],reverse(-1*ye[0:np-1])] + o[1]

window, 0, xsize=600, ysize=600
plot, xc_im, yc_im, xrange=[-15,15], yrange=[-15,15], /xstyle, /ystyle
oplot, xe_im, ye_im

end
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: Consulta sobre until - repeat
Next Topic: Re: Rasterize an image

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

Current Time: Fri Oct 10 00:42:16 PDT 2025

Total time taken to generate the page: 0.32311 seconds