;+ ; ; NAME: funct1 ; ; ; PURPOSE: calculate function values and partial derivatives ; ; ; CATEGORY: spectral analysix ; ; ; CALLING SEQUENCE: ; funct1, f_model, x, a, f, pder, free=free ; ; CALLED BY: ; ; ; CALLS TO: ; none ; ; INPUTS: ; x - vector of independent variable ; a - function parameters ; f_model - function name, a string ; ; OPTIONAL INPUTS: ; ; free - vector of indices of free parameters for calculation of partial derivs. ; ; OUTPUTS: ; f - returned values of functions ; ; OPTIONAL OUTPUTS: ; pder- returned partial derivatives for free parameters ; ; MODIFICATION HISTORY: ; documented ras, 11-aug-94 ;- pro funct1, f_model, x, a, f, pder, free=free ;FUNCT procedure to run with CURVEFIT f = call_function( F_MODEL, x, a ) ;return the values if n_params() eq 5 then begin; CALCULATE PARTIAL DERIVATIVES npar = n_elements(free) pder = dblarr(n_elements(f), npar) for i=0,npar-1 do $ pder(*,i)= f_pder(funct=f_model, par=a, data=x, n=free(i)) endif return end