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

Home » Public Forums » archive » summation and 3d plot
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: summation and 3d plot [message #68513 is a reply to message #68421] Thu, 29 October 2009 21:12 Go to previous messageGo to previous message
penteado is currently offline  penteado
Messages: 866
Registered: February 2018
Senior Member
Administrator
On Oct 30, 1:55 am, Jeremy Bailin <astroco...@gmail.com> wrote:
> Can't you replace the for loops with:
>
> nnx = n_elements(nx)
> nny = n_elements(ny)
> nN = n_elements(N)
> x0 = rebin(reform(x0,nnx,1,1),nnx,nny,nN)
> y0 = rebin(reform(y0,1,nny,1),nnx,nny,nN)
> phi = rebin(reform(phi,1,1,nN),nnx,nny,nN)
> r0 = sqrt(x0^2 + y0^2)
> x = abs(x0*cos(phi) + y0*sin(phi))
> y = -x0*sin(phi) + y0*cos(phi)
> h = 50.-y
> deffs = sqrt(d^2 + 2./mu*tan(a/2.*!pi/180.))
> S = deffs^2 * sin(atan(x/h))^3 / (4.*h)^2 * 100.
> deffr = d + alog(2.)/mu*tan(a/2.*!pi/180.)
> R = sqrt((h/f*ri)^2 + (deffr*(h+f)/f)^2)
>
> -Jeremy.

Yes, that is about what I was hinting at when I said it could be done
without loops. But given the initial question, I thought that jumping
directly to this level might make it difficult to understand.
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: Problems with dialog_pickfile and JavaBridge
Next Topic: weird contour lines

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

Current Time: Fri Oct 10 09:47:34 PDT 2025

Total time taken to generate the page: 0.39998 seconds