Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
I
isisscripts
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
20
Issues
20
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
remeis
isisscripts
Commits
39bf7e4d
Commit
39bf7e4d
authored
Aug 03, 2023
by
Ole Koenig
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add lorentz_xyfit
parent
9f8f3932
Pipeline
#6756
passed with stages
in 42 seconds
Changes
1
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
35 additions
and
0 deletions
+35
-0
src/fitting/xyfit/fit-functions/lorentz_xyfit.sl
src/fitting/xyfit/fit-functions/lorentz_xyfit.sl
+35
-0
No files found.
src/fitting/xyfit/fit-functions/lorentz_xyfit.sl
0 → 100644
View file @
39bf7e4d
define lorentz_xyfit()
%!%+
%\function{lorentz_xyfit}
%\synopsis{Lorentzian xy fit function to be used with xyfit_fun}
%\usage{xyfit_fun ("lorentz");}
%\description
% Calling \code{xyfit_fun ("lorentz");} sets up a Lorentzian fit
% function for xy-data. It has the form
% \code{y = norm * sigma/(2pi) * 1/((x-center)^2 + (sigma/2)^2)}
%\example
% variable id = define_xydata(x, y, yerr);
% xyfit_fun("lorentz");
% () = fit_counts;
% variable xfit, yfit;
% (xfit, yfit) = eval_xyfun([min(x) : max(x) : #1000]);
% plot(xfit, yfit);
%\seealso{xyfit_fun, define_xydata, plot_xyfit, linear_regression}
%!%-
{
variable xref, yref, par;
switch(_NARGS)
{ case 0: return ["norm", "center [center]", "sigma [sigma]"];} % fit parameters
{ case 3: (xref, yref, par) = (); }
{ return help(_function_name); }
@yref = par[0] * par[2]/(2*PI) * 1./((@xref - par[1])^2 + (par[2]/2.)^2);
}
define lorentz_xyfit_default(i)
{
switch(i)
{ case 0: return (0.01, 0, -1e10 , 1e10); }
{ case 1: return (0 , 0, 0 , 1e5); }
{ case 2: return (1 , 0, 1e-6 , 1e6); }
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment