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

Home » Public Forums » archive » GAUSS2DFIT - TILT ?
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
GAUSS2DFIT - TILT ? [message #22787] Mon, 11 December 2000 05:45 Go to previous message
Zeschke is currently offline  Zeschke
Messages: 2
Registered: December 2000
Junior Member
Why does the following example not work correctly ?
This program use the "GAUSS2DFIT.PRO" - Routine. The "Tilt"-Parameter-Fit
does not work.
What can I do ?


Thanks for any help
Thomas



;******************************
loadct,39

; Define array dimensions.
nx = 128 & ny = 128
; Define input function parameters.
A = [ 5., 100., nx/8., ny/20., nx/2., .6*ny]

; Create X and Y arrays.
X = FINDGEN(nx) # REPLICATE(1.0, ny)
Y = REPLICATE(1.0, nx) # FINDGEN(ny)


;Tilt
T=1.

h=A[4]
k=A[5]
x1 = (x - h) * cos(T) - (y - k) * sin(T)
y1 = (x - h) * sin(T) + (y - k) * cos(T)
U = (X1/A[2])^2 + (Y1/A[3])^2; Create an ellipse.
xvec=x[*,0]
yvec=y[0,*]
yvec=transpose(yvec)

Z = A[0] + A[1] * EXP(-U/2) ; Create gaussian Z.
Z = Z + RANDOMN(seed, nx, ny) ; Add random noise, SD = 1.
yfit = GAUSS2DFIT(Z,B,xvec,yvec, /tilt) ; Fit the function with rotation.

PRINT, ' constant scale width_x width_y center_x center_y tilt'
PRINT, 'Should:', STRING(A,T, FORMAT='(6f8.3)')
PRINT, 'Is: ', STRING(B(0:6), FORMAT='(6f8.3)')
contour,z,x,y,/fill,nlevels=30
contour,yfit,x,y,/noerase

;******************************
[Message index]
 
Read Message
Read Message
Previous Topic: Re: IDLgrLegend broken
Next Topic: postscript file sizes

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

Current Time: Tue Dec 02 06:17:35 PST 2025

Total time taken to generate the page: 0.88622 seconds