The LAMP Application

Generated by IDLdoc

single page | use frames     summary     class     fields     routine details     file attributes

lamp_mac/

str_fit.pro


Routines

result = str_gettext(wid, numb)

str_getparams, btxt, vp, bb, qq, qqinf, qqsup, pname

result = s4v(str, min=min)

str_get_model, fifi, UserModl, ii

str_write_model, fifi, User_Modl, ok

str_mod_struct, struc, TAG, val

str_fit_event, ev

str_fit_plot, flag, uvg, livc=livc, ymax=ymax, xtmp=xtmp

str_bkg_spec, xx, pars, Fshape, background=background

str_sub_func, xx, pars, User_Modl, nFunc, sub=sub

str_out_par, uvg, flag

str_fit_win, noTabs=noTabs, iniGUI=iniGUI

str_user_defined, leader, lamp_b1

str_slider_param, base=base, model=model, Q=Q, UV=UV, cmd=cmd

result = cool2ga_eval(p, dp, _EXTRA=_EXTRA)

result = cool2tn_eval(p, dp, _EXTRA=_EXTRA)

result = cool2mp_eval(p, dp, _EXTRA=_EXTRA)

result = COOL2MP(x, y, weightsIn, a, sigma, FUNCTION_NAME=FUNCTION_NAME, FITA=FITA, ITMAX=ITMAX, ITER=ITER, TOL=TOL, CHISQ=CHISQ, DOUBLE=DOUBLE, NODERIVATIVE=NODERIVATIVE, YERROR=YERROR, STATUS=STATUS, BOUNDA=BOUNDA, LIMITA=LIMITA, TIED=TIED, MPf=MPf)

result = COOLFIT(x, y, weightsIn, a, sigma, FUNCTION_NAME=FUNCTION_NAME, FITA=FITA, ITMAX=ITMAX, ITER=ITER, TOL=TOL, CHISQ=CHISQ, DOUBLE=DOUBLE, NODERIVATIVE=NODERIVATIVE, YERROR=YERROR, STATUS=STATUS, BOUNDA=BOUNDA, LIMITA=LIMITA, TIED=TIED, MPf=MPf)

mp2cool_eval, X, A, YFIT, pder

result = MP2COOL(Function_Name, aa, functargs=functargs, maxiter=maxiter, autoderivative=autoderivative, FTOL=FTOL, XTOL=XTOL, GTOL=GTOL, parinfo=parinfo, STATUS=STATUS, nfev=nfev, BESTNORM=BESTNORM, covar=covar, perror=perror, niter=niter, nfree=nfree, dof=dof, ERRMSG=ERRMSG, quiet=quiet, fastnorm=fastnorm)

result = di_rev(c)

di_mka, c, s1, s2, s3, s4

result = di_CVnorm(Fres, FC, flag)

result = di_solv(R, bi, R2, bi2, METHOD=METHOD, GUESS=GUESS)

result = di_conv(F, C)

result = di_keeb(V, mi, D, idx, shf)

di_inst_Dreso, flag, Q=Q, deltaQ=deltaQ, pVf=pVf, GetX=GetX, GetY=GetY, Fdisp=Fdisp, Rdisp=Rdisp, Kdisp=Kdisp, Rbdisp=Rbdisp, GetA=GetA, active=active

result = str_Gumbel(X, A0, A1, A2, S)

result = str_Exp(X, A2, A3)

result = str_IsoRot(X, A0, A1, A2, A3, A4, LOOP=LOOP)

result = str_UniRot(X, A0, A1, A2, A3, A4, LOOP=LOOP)

result = str_RwTrans(X, A0, A1, A2, A3)

result = str_RotcTran(X, A0, A1, A2, A3, A4, A5, LOOP=LOOP)

result = str_FOU(w, x2_, D_, q2, alpha_, Tau_, Loop=Loop)

result = str_Hard_Sphere(X, Fv, Rs)

result = str_MultiLam(X, mNs, ds, Delt, Nub, TD=TD, PC=PC, MC=MC)

result = str_MSA(X, ETA, Rd, Ze, Kappa, T, epsR, Salt)

result = str_Vesicle(X, Ri, Rs, Tl, sldS, sldO, sldT, dR1)

result = str_LinShell(X, R, dT, xSin, xSout, sldS, sldC, sldT, dR)

result = str_Mlam_Vesicle(X, R, Ts, Tl, sldS, sldT, Nl, DeltaR, DeltaTs)

result = str_Ellipsoid(X, Dens, Ra, Nab, dR, LOOP=LOOP)

result = str_Ellipsoid2(X, Dens, Ra, Nab, dR, LOOP=LOOP)

result = str_StarPolyGauss(X, I0, R, fa, dR)

result = str_StarPolyPolyG(X, I0, R, fa, dR)

result = str_Disk(X, Sc, Rd, dR)

result = str_Rod(X, Sc, Lr, dL)

result = romb_rod(X)
result = strGAUSS(X, p1, p2, p3)
str_Gauss, X, A, F, PDER

result = strDELTA(X, p1, p2, p3)
str_Delta, X, A, F, PDER

result = strnormLORENTZ(X, p2, p3)

result = strLORENTZ(X, p1, p2, p3, norm=norm)
str_Lorentz, X, A, F, PDER

result = strPSEUDO(X, p1, p2, p3, p4)
str_Pseudo, X, AA, F, PDER

str_exec_UModl, npmnpm, formula, XXX, AAA, Y, name, PDER

str_UserModl, XX, AAA, FF, PPDER

str_Integral, X, A, Data, F_i, D_i, F_a, F_e, S, epsd, modl, npr, npb, mfit, pdelta, Cfunc

str_wks_in_cmd, flag

result = str_bose(X, Temperature=Temperature)

result = str_fit(W_in, file_out, title, bkgd=bkgd, Xrange=Xrange, Pseudo_Voigt=Pseudo_Voigt, Gauss=Gauss, Lorentz=Lorentz, follow=follow, itmax=itmax, Fout=Fout, noweight=noweight, Srange=Srange, num_bkgd=num_bkgd, num_bfix=num_bfix, User_model=User_model, append=append, None=None, Flat=Flat, startBG=startBG, Center=Center, L_Center=L_Center, U_Center=U_Center, fWmH=fWmH, L_fWmH=L_fWmH, U_fWmH=U_fWmH, P2_mod=P2_mod, Pm_Sep=Pm_Sep, C2_mod=C2_mod, C2_Height=C2_Height, C2_fWmH=C2_fWmH, Multi_mod=Multi_mod, Multi_N=Multi_N, Multi_U=Multi_U, Multi_fine=Multi_fine, Multi_fast=Multi_fast, P_extra=P_extra, mpfit=mpfit, debug=debug, stop_id=stop_id, Bose=Bose, Res_wks=Res_wks, Res_Xin=Res_Xin, Res_Zin=Res_Zin, Res_gau=Res_gau, Res_voi=Res_voi, Res_pvf=Res_pvf, Res_gum=Res_gum, Res_spc=Res_spc, Res_xrg=Res_xrg, Res_dti=Res_dti, Res_disp=Res_disp, Res_dfit=Res_dfit, Res_interp=Res_interp, Res_filter=Res_filter, fit=fit, delta=delta, out_subIndex=out_subIndex, out_subF=out_subF, out_Bkg=out_Bkg, ConvFunc=ConvFunc, noTabs=noTabs, iniGUI=iniGUI, Win=Win, Xin=Xin, Yin=Yin, ein=ein, sigma=sigma, Id_Lab=Id_Lab, input_cmd=input_cmd)

str_fit, noTabs=noTabs, iniGUI=iniGUI

Routine details

top str_gettext

result = str_gettext(wid, numb)

******* *********** ** get a text field float value in numb. return 1 if success

Parameters

wid
numb

top str_getparams

str_getparams, btxt, vp, bb, qq, qqinf, qqsup, pname

** ************* ** analyse syntax of an input text field parameters ** dispatch the componantes

Parameters

btxt
vp
bb
qq
qqinf
qqsup
pname

top s4v

result = s4v(str, min=min)

******* *** ** change an array of numbers to a cleaned string ** if array, return '[ 1.0 , 2e-1 , 5]' else return '1.0'

Parameters

str

Keywords

min

top str_get_model

str_get_model, fifi, UserModl, ii

** ************* ** read a model file in UserModl structure variable

Parameters

fifi
UserModl
ii

top str_write_model

str_write_model, fifi, User_Modl, ok

** *************** ** write a model structure in a file

Parameters

fifi
User_Modl
ok

top str_mod_struct

str_mod_struct, struc, TAG, val

** ************** ** modify a model structure

Parameters

struc
TAG
val

top str_fit_event

str_fit_event, ev

** ************* ** ** Event handler of str_fit

Parameters

ev

top str_fit_plot

str_fit_plot, flag, uvg, livc=livc, ymax=ymax, xtmp=xtmp

** ************ ** plotting routine

Parameters

flag
uvg

Keywords

livc
ymax
xtmp

top str_bkg_spec

str_bkg_spec, xx, pars, Fshape, background=background

** ************ ** Get Background for one spectrum (xx is full range) (called from 'plot' and str_fit) **

Parameters

xx
pars
Fshape

Keywords

background

top str_sub_func

str_sub_func, xx, pars, User_Modl, nFunc, sub=sub

** ************ ** Get a sub function for one spectrum (xx is full range) (called from 'plot' , str_out_par , str_fit) ** Care with FUNC_CONV if called from str_fit !!! **

Parameters

xx
pars
User_Modl
nFunc

Keywords

sub

top str_out_par

str_out_par, uvg, flag

** *********** ** output params or total fit or subfunctions in a workspace or in files

Parameters

uvg
flag

top str_fit_win

str_fit_win, noTabs=noTabs, iniGUI=iniGUI

** *********** ** ** GUI for the use of str_fit procedure

Keywords

noTabs
iniGUI

top str_user_defined

str_user_defined, leader, lamp_b1

** **************** ** GUI for user models

Parameters

leader
lamp_b1

top str_slider_param

str_slider_param, base=base, model=model, Q=Q, UV=UV, cmd=cmd

** **************** ** ** Make a sliders base for model parameters

Keywords

base
model
Q
UV
cmd

top cool2ga_eval

result = cool2ga_eval(p, dp, _EXTRA=_EXTRA)

******* ************ ** rmd_ga evaluation interface (un_used)

Parameters

p
dp

Keywords

_EXTRA

top cool2tn_eval

result = cool2tn_eval(p, dp, _EXTRA=_EXTRA)

******* ************ ** tnmin evaluation interface (un_used)

Parameters

p
dp

Keywords

_EXTRA

top cool2mp_eval

result = cool2mp_eval(p, dp, _EXTRA=_EXTRA)

******* ************ ** coolfit to mpfit evaluation interface

Parameters

p
dp

Keywords

_EXTRA

top COOL2MP

result = COOL2MP(x, y, weightsIn, a, sigma, FUNCTION_NAME=FUNCTION_NAME, FITA=FITA, ITMAX=ITMAX, ITER=ITER, TOL=TOL, CHISQ=CHISQ, DOUBLE=DOUBLE, NODERIVATIVE=NODERIVATIVE, YERROR=YERROR, STATUS=STATUS, BOUNDA=BOUNDA, LIMITA=LIMITA, TIED=TIED, MPf=MPf)

******* ******* ** coolfit to mpfit engine interface

Parameters

x
y
weightsIn
a
sigma

Keywords

FUNCTION_NAME
FITA
ITMAX
ITER
TOL
CHISQ
DOUBLE
NODERIVATIVE
YERROR
STATUS
BOUNDA
LIMITA
TIED
MPf

top COOLFIT

result = COOLFIT(x, y, weightsIn, a, sigma, FUNCTION_NAME=FUNCTION_NAME, FITA=FITA, ITMAX=ITMAX, ITER=ITER, TOL=TOL, CHISQ=CHISQ, DOUBLE=DOUBLE, NODERIVATIVE=NODERIVATIVE, YERROR=YERROR, STATUS=STATUS, BOUNDA=BOUNDA, LIMITA=LIMITA, TIED=TIED, MPf=MPf)

******* ******* ** coolfit engine

Parameters

x
y
weightsIn
a
sigma

Keywords

FUNCTION_NAME
FITA
ITMAX
ITER
TOL
CHISQ
DOUBLE
NODERIVATIVE
YERROR
STATUS
BOUNDA
LIMITA
TIED
MPf

top mp2cool_eval

mp2cool_eval, X, A, YFIT, pder

** ************ ** mpfit to coolfit evaluation interface

Parameters

X
A
YFIT
pder

top MP2COOL

result = MP2COOL(Function_Name, aa, functargs=functargs, maxiter=maxiter, autoderivative=autoderivative, FTOL=FTOL, XTOL=XTOL, GTOL=GTOL, parinfo=parinfo, STATUS=STATUS, nfev=nfev, BESTNORM=BESTNORM, covar=covar, perror=perror, niter=niter, nfree=nfree, dof=dof, ERRMSG=ERRMSG, quiet=quiet, fastnorm=fastnorm)

******* ******* ** mpfit to coolfit engine interface

Parameters

Function_Name
aa

Keywords

functargs
maxiter
autoderivative
FTOL
XTOL
GTOL
parinfo
STATUS
nfev
BESTNORM
covar
perror
niter
nfree
dof
ERRMSG
quiet
fastnorm

top di_rev

result = di_rev(c)

******* ****** * ** reverse a 1D or 2D array

Parameters

c

top di_mka

di_mka, c, s1, s2, s3, s4

** ****** ************** ********************************************** ** Return s1,s4 margin & s2,s3 vector index range, used to centerize the resolution tm= findgen(n_elements(c)) i = round (total(tm*c)/total(c)) ;Gravity

Parameters

c
s1
s2
s3
s4

top di_CVnorm

result = di_CVnorm(Fres, FC, flag)

******* ********* *********** ***************************************************** ** Normalize Centerize & reverse the resolution function

Parameters

Fres
FC
flag

top di_solv

result = di_solv(R, bi, R2, bi2, METHOD=METHOD, GUESS=GUESS)

******* ******* *********** ************************************************************** ** Solve linear or bilinear function (coef. of convolution steps)

Parameters

R
bi
R2
bi2

Keywords

METHOD
GUESS

top di_conv

result = di_conv(F, C)

******* ******* *** ********************* ** Just do a convolution

Parameters

F
C

top di_keeb

result = di_keeb(V, mi, D, idx, shf)

******* ******* ************* ********************************** ** Derivatives: return all max values

Parameters

V
mi
D
idx
shf

top di_inst_Dreso

di_inst_Dreso, flag, Q=Q, deltaQ=deltaQ, pVf=pVf, GetX=GetX, GetY=GetY, Fdisp=Fdisp, Rdisp=Rdisp, Kdisp=Kdisp, Rbdisp=Rbdisp, GetA=GetA, active=active

** ************* ************* ********************************************************************************************************************** ** ** Prepare the instrument resolution depending on Q or Theta....

Parameters

flag

Keywords

Q
deltaQ
pVf
GetX
GetY
Fdisp
Rdisp
Kdisp
Rbdisp
GetA
active

top str_Gumbel

result = str_Gumbel(X, A0, A1, A2, S)

******* ********** ** Gumbel ** S=+1 dissymetry on left , -1 on right ** A0=height ** A1=position of maximum ** A2=width

Parameters

X
A0
A1
A2
S

top str_Exp

result = str_Exp(X, A2, A3)

******* ******* ** Stretched Exponantial ** Inspired by Stef Rols ** Y=amplitude * FT(EXP(-(X/beta)^tau)) centered at position ** A0=amplitude ** A1=position ** A2=beta ** A3=tau

Parameters

X
A2
A3

top str_IsoRot

result = str_IsoRot(X, A0, A1, A2, A3, A4, LOOP=LOOP)

******* ********** ** IsoRot ** Inspired by Stef Rols ** Here we use the 20 first functions of spherical bessel jl(QR) ** jl(x)=sqrt(!PI/2x)*J(l+0.5)(x) ** J(l+0.5)=BESELJ(X,l+0.5) ** Amplitude=A0 , Center =A1 ** Dr =A2 , Radius =A3 ;radius*Q ** U2 =A4 ;u2*Q^2

Parameters

X
A0
A1
A2
A3
A4

Keywords

LOOP

top str_UniRot

result = str_UniRot(X, A0, A1, A2, A3, A4, LOOP=LOOP)

******* ********** ** UniRot ** Inspired by Stef Rols ** Here we use the 20 first functions of sphericalcylindrical bessel Jl(QR) ** Jl(X)=BESELJ(X,l) ** Amplitude=A0 , Center =A1 , Dr =A2 ** Radius =A3 ;radius*Q , U2 =A4 ;u2*Q^2

Parameters

X
A0
A1
A2
A3
A4

Keywords

LOOP

top str_RwTrans

result = str_RwTrans(X, A0, A1, A2, A3)

******* ********** ** RwTrans ** Inspired by Stef Rols ** Amplitude=A0 , Center =A1 ** Dt =A2 ;dt*Q^2 , U2 =A3 ;u2*Q^2

Parameters

X
A0
A1
A2
A3

top str_RotcTran

result = str_RotcTran(X, A0, A1, A2, A3, A4, A5, LOOP=LOOP)

******* ************ ** RotcTran ** Inspired by Stef Rols ** Amplitude=A0 , Center =A1 , Dr =A2 ** Radius =A3 ;radius*Q , U2 =A4 ;u2*Q^2 ** Dt =A5 ;dt*Q^2

Parameters

X
A0
A1
A2
A3
A4
A5

Keywords

LOOP

top str_FOU

result = str_FOU(w, x2_, D_, q2, alpha_, Tau_, Loop=Loop)

** ** Inspired by Vania Calandrini ** CALL: Y = str_FOU (X, p1,p2,p3,p4,p5,p6, LOOP=8)

Parameters

w
x2_
D_
q2
alpha_
Tau_

Keywords

Loop

top str_Hard_Sphere

result = str_Hard_Sphere(X, Fv, Rs)

******* *************** ** ** HARD SPHERE STRUCTURE FACTOR ** Fp is Volume Fraction ** Rhs is Sphere Radius

Parameters

X
Fv
Rs

top str_MultiLam

result = str_MultiLam(X, mNs, ds, Delt, Nub, TD=TD, PC=PC, MC=MC)

******* ************ ** ** MULTI LAMELLAR THERMAL DISORDER or PARACRYSTALLINE OR CAILLE STRUCTURE FACTOR ** mNs is mean number of stacks (10) ** d is stacking separation (20) ** Delta is DW disorder or Caillé parameter (2 or .2) ** Nu is number of uncorrelated scattering bilayers ** ** TD for Thermal Disorder ** PC for ParaCrystalline ** MC for Modified Caillé

Parameters

X
mNs
ds
Delt
Nub

Keywords

TD
PC
MC

top str_MSA

result = str_MSA(X, ETA, Rd, Ze, Kappa, T, epsR, Salt)

******* ******* ** ** RESCALED MEAN SPHERICAL APPROXIMATION (Hayter, Penfold, Hansen) ** ETA Volume fraction of Particules (.3) ** Pn=!Pi*ETA*(Rhs*2.)^3/6. Pn is particule number density ** Rd Radius of hard sphere (25.) ** Z Charge unit (20.) ** Kappa Debye-Huckel inverse screening L (.04) ** T Sample Temperature (298.) ** epsR Dielectric constant of solvent (80.) ** Salt Salt ions charge density: Pi*Zi [Z*A-3] * 10^6 (Unused at this time)

Parameters

X
ETA
Rd
Ze
Kappa
T
epsR
Salt

top str_Vesicle

result = str_Vesicle(X, Ri, Rs, Tl, sldS, sldO, sldT, dR1)

******* *********** ** ** BILAYERED VESICULE FORM FACTOR ** R1 Inner Solvent Radius Rc ** Ro Layer Solvent Thickness Th ** T Layer Thickness Tt ** sldS SLD Solvent Nsol ** sldO SLD Layer Solvent Nh ** sldT SLD Layer Nt

Parameters

X
Ri
Rs
Tl
sldS
sldO
sldT
dR1

top str_LinShell

result = str_LinShell(X, R, dT, xSin, xSout, sldS, sldC, sldT, dR)

******* ************ ** ** SPHERICAL SHELL WITH LINEAR VARYING CONTRAST PROFILE FORM FACTOR ** Ri Inner Solvent Radius (R :30) ** T Shell Thickness (dR :10) ** pSin inner amount of solvent in shell (Xin :1 ) ** pSout outer amount of solvent in shell (Xout:.5) ** sldS SLD Solvent (Nsol:0 ) ** sldC SLD core shell (Nc :1 ) ** sldT SLD pure shell (Nsh :1 )

Parameters

X
R
dT
xSin
xSout
sldS
sldC
sldT
dR

top str_Mlam_Vesicle

result = str_Mlam_Vesicle(X, R, Ts, Tl, sldS, sldT, Nl, DeltaR, DeltaTs)

******* **************** ** ** MULTI LAMELLAR VESICULE FORM FACTOR ** Ri Inner Solvent Radius ** Ro Layer Solvent Thickness ** T Layer Thickness ** sldS SLD Solvent ** sldT SLD Layer ** N number of Layers

Parameters

X
R
Ts
Tl
sldS
sldT
Nl
DeltaR
DeltaTs

top str_Ellipsoid

result = str_Ellipsoid(X, Dens, Ra, Nab, dR, LOOP=LOOP)

******* ************* ** ** ELLIPSOID FORM FACTOR ** Dens density ** R Radius of rotational axis (Ra) ** Nu Ratio between both axis (Ra/Rb) ** N number of iterations for integration

Parameters

X
Dens
Ra
Nab
dR

Keywords

LOOP

top str_Ellipsoid2

result = str_Ellipsoid2(X, Dens, Ra, Nab, dR, LOOP=LOOP)

******* ************** ** ** ELLIPSOID FORM FACTOR ; Faster but to be verified ... ** Dens density ** R Radius of rotational axis (Ra) ** Nu Ratio between both axis (Ra/Rb) ** N number of iterations for integration

Parameters

X
Dens
Ra
Nab
dR

Keywords

LOOP

top str_StarPolyGauss

result = str_StarPolyGauss(X, I0, R, fa, dR)

******* ***************** ** ** STAR POLYMER GAUSSIAN STATISTIC FORM FACTOR ** Rg Radius of gyration ** fa number of Arms ** I0 at Q0

Parameters

X
I0
R
fa
dR

top str_StarPolyPolyG

result = str_StarPolyPolyG(X, I0, R, fa, dR)

******* ***************** ** ** STAR POLYDISPERSE POLYMER GAUSSIAN STATISTIC FORM FACTOR ** Rg Radius of gyration ** fa number of Arms ** I0 at Q0

Parameters

X
I0
R
fa
dR

top str_Disk

result = str_Disk(X, Sc, Rd, dR)

******* ******** ** ** DISK FORM FACTOR ** R Radius of Disk ** Sc Scattering contrast

Parameters

X
Sc
Rd
dR

top str_Rod

result = str_Rod(X, Sc, Lr, dL)

******* ******* ** ** ROD FORM FACTOR ** L Lenght of Rod ** Sc Scattering contrast

Parameters

X
Sc
Lr
dL

top romb_rod

result = romb_rod(X)

Parameters

X

top strGAUSS

result = strGAUSS(X, p1, p2, p3)

Parameters

X
p1
p2
p3

top str_Gauss

str_Gauss, X, A, F, PDER

** ********* ** Gaussians procedure ** A(0)=height A(1)=position A(2)=width ** A(3)=flat_background ** A(4)=slope or func_bkgd factor ** A(5)=quadratic_background

Parameters

X
A
F
PDER

top strDELTA

result = strDELTA(X, p1, p2, p3)

Parameters

X
p1
p2
p3

top str_Delta

str_Delta, X, A, F, PDER

** ********* ** Delta procedure A(0)=height A(1)=position A(2)=width A(3)=flat_background A(4)=slope or func_bkgd factor A(5)=quadratic_background

Parameters

X
A
F
PDER

top strnormLORENTZ

result = strnormLORENTZ(X, p2, p3)

******* ************** ** Lorentzian normal function

Parameters

X
p2
p3

top strLORENTZ

result = strLORENTZ(X, p1, p2, p3, norm=norm)

Parameters

X
p1
p2
p3

Keywords

norm

top str_Lorentz

str_Lorentz, X, A, F, PDER

** *********** ** Lorentzians procedure ** A(0)=height A(1)=position A(2)=width ** A(3)=flat_background ** A(4)=slope or func_bkgd factor ** A(5)=quadratic_background

Parameters

X
A
F
PDER

top strPSEUDO

result = strPSEUDO(X, p1, p2, p3, p4)

Parameters

X
p1
p2
p3
p4

top str_Pseudo

str_Pseudo, X, AA, F, PDER

** ********** ** Pseudo Voigt procedure ** AA(0)=fractional pseudo parameter if not fixed ** A(0)=height A(1)=position A(2)=width ** A(3)=flat_background ** A(4)=slope or func_bkgd factor ** A(5)=quadratic_background

Parameters

X
AA
F
PDER

top str_exec_UModl

str_exec_UModl, npmnpm, formula, XXX, AAA, Y, name, PDER

** ************** ** execute the user model formula ** treat also Sans dispersity as instrument sigma Q resolution

Parameters

npmnpm
formula
XXX
AAA
Y
name
PDER

top str_UserModl

str_UserModl, XX, AAA, FF, PPDER

** ************ ** dispatch the user model formula ** A(*) =parameters of all functions defined in structure UserModl ** A(*+1)=flat_background ** A(*+2)=slope or func_bkgd factor ** A(*+3)=quadratic_background

Parameters

XX
AAA
FF
PPDER

top str_Integral

str_Integral, X, A, Data, F_i, D_i, F_a, F_e, S, epsd, modl, npr, npb, mfit, pdelta, Cfunc

** ************ ** This procedure is called for ONE spectra ** A(0)=height A(1)=position A(2)=width ** A(3)=flat_background ** A(4)=slope or func_bkgd factor ** A(5)=quadratic_background ** Data=input spectrum ** return F_i fit integral in X range (total) ** return D_i data integral in X range (total) ** return F_a funct integrals theorical (by functions, classical mod) ** return F_e funct integrals theorical errors (by functions, classical mod) ** return mfit the fit deconvoluted ** return Cfunc the fit convoluted to show for each function

Parameters

X
A
Data
F_i
D_i
F_a
F_e
S
epsd
modl
npr
npb
mfit
pdelta
Cfunc

top str_wks_in_cmd

str_wks_in_cmd, flag

** ************** **

Parameters

flag

top str_bose

result = str_bose(X, Temperature=Temperature)

******* ******** ** calculate Bose vector

Parameters

X

Keywords

Temperature

top str_fit

result = str_fit(W_in, file_out, title, bkgd=bkgd, Xrange=Xrange, Pseudo_Voigt=Pseudo_Voigt, Gauss=Gauss, Lorentz=Lorentz, follow=follow, itmax=itmax, Fout=Fout, noweight=noweight, Srange=Srange, num_bkgd=num_bkgd, num_bfix=num_bfix, User_model=User_model, append=append, None=None, Flat=Flat, startBG=startBG, Center=Center, L_Center=L_Center, U_Center=U_Center, fWmH=fWmH, L_fWmH=L_fWmH, U_fWmH=U_fWmH, P2_mod=P2_mod, Pm_Sep=Pm_Sep, C2_mod=C2_mod, C2_Height=C2_Height, C2_fWmH=C2_fWmH, Multi_mod=Multi_mod, Multi_N=Multi_N, Multi_U=Multi_U, Multi_fine=Multi_fine, Multi_fast=Multi_fast, P_extra=P_extra, mpfit=mpfit, debug=debug, stop_id=stop_id, Bose=Bose, Res_wks=Res_wks, Res_Xin=Res_Xin, Res_Zin=Res_Zin, Res_gau=Res_gau, Res_voi=Res_voi, Res_pvf=Res_pvf, Res_gum=Res_gum, Res_spc=Res_spc, Res_xrg=Res_xrg, Res_dti=Res_dti, Res_disp=Res_disp, Res_dfit=Res_dfit, Res_interp=Res_interp, Res_filter=Res_filter, fit=fit, delta=delta, out_subIndex=out_subIndex, out_subF=out_subF, out_Bkg=out_Bkg, ConvFunc=ConvFunc, noTabs=noTabs, iniGUI=iniGUI, Win=Win, Xin=Xin, Yin=Yin, ein=ein, sigma=sigma, Id_Lab=Id_Lab, input_cmd=input_cmd)

******* ******** ** User callable ** function to read a workspace containing a number of 1D data sets ** fit the peaks, write (append if /append) the title and fit parameters to file_out ** and fit_pars to output workspace (return of the function) ** ** W_in =input data (a workspace from a do command else you must use Xin,Yin,Ein) ** number of background parameters is determined by bb ** 0=flat, 1=linear, 2=quadratic, 3=none or 'flat','linear','quadratic','none' ** startBG =if flat background and un_fixed this is an initial start ** Xrange =[xmin,xmax] (abscissa must be sorted in ascending) ** Srange =[first spectrum , last] ** num_bkgd contains 1D or 2D numerical background shape (same Xsize as W) ** /num_bfix=if set then do not fit the level of num_bkgd ** Pseudo_Voigt may contain the fixed factor f*Lorentz + (1-f)Gauss ** /Gauss to fit all gaussian ** /Lorentz to fit all lorentzian ** follow to fit next spectra with initial params of previous fitted spectra 1:ascend -1:descending ** itmax maximum of fit iterations, default is 100, set to 1 to see initial functions in a user_model ** User_model is a structure which describes a user specific model or the name of a saved model file. ** /noweight gives a better ration fit_int/data_int for poor data ** NOUT is a workspace number which will contain the fitted functions ** wnin should be a workspace number if W_in is 0 ** xin,yin,ein,fit_sigmas,ilab are used only when call is from a procedure (not from a do cmd) ** ** CONSTRAINTS ** ----------- ** Flat =fixed background ** Center =fixed position ** L_Center =lower position ** U_Center =upper position ** fWmH =fixed width ** L_fWmH =lower width ** U_fWmH =upper width ** ** OUTLINE ** ------- ** /P2_mod one double peak ** ** /C2_mod 2 centered peaks ** C2_Height =initial height of second centered peak ** C2_fWmH =initial width of second centered peak ** ** P_extra =# extra peaks for double/centered outline ** Pm_Sep =double/centered peaks: return splited fit parameters ** ** Mlt_mod =multi peak search (resolution is requiered *DECONVOLUTION*) ** Mlt_fast =multi peak medium fWmH (resolution is not requiered) ** Mlt_N =multi peak exact nb of peaks ** Mlt_U =multi peak maximum nb of peaks ** Mlt_fine =multi peak fine peak search (data quality 1->5) ** ** Bose =if >0. this is the temperature(K) for detailed balance factor ** ** RESOLUTION ** ---------- ** Res_wks =workspace# or data containing the numerical resolution function ** Res_xin =Xresolution if data are passed instead of workspace# ** Res_zin =width for each resolution if they are not to be fitted ** ** Res_gau =width of gaussian resolution to construct ** Res_gum =1 or -1 resolution will be an assymetric gaussian, Res_gau must be present ** Res_voi =width of voigt resolution to construct ** Res_pvf =factor for the voigt resolution 1 is lorentzian (may be linked with Res_dti) ** Res_dti =Delta(Q or Theta) instrumental resolution for each Xin points or workspace# ** Res_pvf must be present. ** Res_disp =Poly_dispersity function(SANS) 1:Gaussian 2:Log_norm 3:Schultz ** Res_spc =spectrum# to take as the resolution ** Res_xrg =X range for Res_wks or Res_spc ** /Res_interp=interpolate the data to a regular grid for convolution ** /Res_filter do not fit but results of the function are spectra filtered with F(Resolution) ** ** RETURNS ** ------- ** return of the function is all fitted parameters [nspectra , nparams , nfunct] ** Sigma=Fit_sigmas :return err for all fitted parameters [nspectra , nparams , nfunct] ** ** Res_dfit=mfit :return filtered fit (no background,[deconvoluted]) ** Fit=Wout :return fitted spectra (+background,[ convoluted]) ** Fout=Nout :return fitted spectra in Wrks number Nout ** ** Convfunc=cfunc :return convoluted functions ** Delta=delta :return delta peak deconvoluted ** ** out_subF =return fitted spectra for functions indexed by out_subi [nx , nspectra , nfunct] ** out_Bkg =return backgrd spectra for functions indexed by out_subi [nx , nspectra]

Parameters

W_in
file_out
title

Keywords

bkgd
Xrange
Pseudo_Voigt
Gauss
Lorentz
follow
itmax
Fout
noweight
Srange
num_bkgd
num_bfix
User_model
append
None
Flat
startBG
Center
L_Center
U_Center
fWmH
L_fWmH
U_fWmH
P2_mod
Pm_Sep
C2_mod
C2_Height
C2_fWmH
Multi_mod
Multi_N
Multi_U
Multi_fine
Multi_fast
P_extra
mpfit
debug
stop_id
Bose
Res_wks
Res_Xin
Res_Zin
Res_gau
Res_voi
Res_pvf
Res_gum
Res_spc
Res_xrg
Res_dti
Res_disp
Res_dfit
Res_interp
Res_filter
fit
delta
out_subIndex
out_subF
out_Bkg
ConvFunc
noTabs
iniGUI
Win
Xin
Yin
ein
sigma
Id_Lab
input_cmd

top str_fit

str_fit, noTabs=noTabs, iniGUI=iniGUI

** ******* ** User callable ** call str_fit as a procedure

Keywords

noTabs
iniGUI

File attributes

Modification date: Tue Oct 1 14:36:01 2013
Lines: 7,301