CURVEFIT, FUNCT [message #297] |
Mon, 24 February 1992 13:07 |
dungan
Messages: 2 Registered: February 1992
|
Junior Member |
|
|
I need help from a generous soul who has
experience with the IDL function CURVEFIT.
Is this considered a trusty and well-written
routine? I am trying to get it to fit a
simple exponential decay function to 307 data,
and am having some trouble. I have created
a procedure called EXPDECAY, which I modified
from FUNCT. It takes 2 parameters, and is of
the form:
y = Ao * exp(-x/A1)
IDL doesn't seem to be recognizing it. My
session looks like this:
Common Blocks:
DEVIO(1)
Saved Procedures:
EXPDECAY FUNCT READNUM READSTRING
SCATTER
Saved Functions:
CURVEFIT
IDL> print,n_elements(x1)
307
IDL> print,n_elements(y1)
307
IDL> print,n_elements(a)
2
IDL> w=replicate(1.,307)
IDL> yfit=curvefit(x1,y1,w,a,Function_Name=expdecay)
% Attempt to subscript A with <INT ( 2)> is out of range.
% Execution halted at FUNCT </u/local/idl.new/lib/userlib/funct.pro( 39)> .
% Called from CURVEFIT </u/local/idl.new/lib/userlib/curvefit.pro( 93)>.
% Called from $MAIN$.
IDL>
I must be specifying the keyword improperly, as IDL is looking for FUNCT.
Any suggestions on this specific question or on the more general question
of curvefitting with IDL would be appreciated.
Sincerely,
Jennifer Dungan
TGS Technology
NASA Ames Research Center
jennifer@vessna.arc.nasa.gov
|
|
|