User guide
Everything the application can do, and why it does it that way. This is the text Fit itself shows under Help → Explain Everything and in the Explain pane beside the model - generated from the same registry at every publication, so the site and the program you download say the same thing.
Every topic says how much authority stands behind it: Canonical - stated by the field's sources, quoted and cited; Convention - common practice; This software's choice - a decision made here, with its reason; Not settled by the sources.
Deeper reading: How many curves does the profile need? - the rule automatic decomposition follows, and how it compares with AICc, BIC and the other published methods.
Getting started
- What Fit is — Fit describes a measured profile as a sum of curves and tells you the parameters of each curve.
- The window and the compute server — Fit is two programs: the window you work in, and a compute server, fit_server, that does every fit.
- The main window at a glance — The window has a chart in the middle, tools on the left, the model on the right and tables of numbers along the bottom.
- A first fit — Import a profile, choose a curve type, run Fit > Automatically and read the result in the tables below the chart.
- Fitting by hand, step by step — Instead of letting the program decide, you can say where the background is, what to fit and where the curves go, and then fit.
- The Explain pane — A pane below the model list that explains whatever you are looking at, as you look at it.
- Explain Everything — Help > Explain Everything opens a window listing every explanation this build can give, including this user guide.
- How much authority an explanation has — Every explanation carries one of four labels saying whether it rests on the field's sources, on common practice, or on a choice this program made.
- About Fit — Help > About shows which version of Fit you are running.
Projects and files
- Projects — A project is your whole piece of work in one file, so that you can close Fit and later carry on fitting from where you stopped.
- New Project — File > New Project closes what is open and leaves an empty window, ready for a profile to be imported.
- Open Project — File > Open Project asks for a .fitproj file and restores the work it holds.
- Open Recent — File > Open Recent lists the projects you opened or saved most recently, newest first, and opens one with a click.
- Save Project — File > Save Project writes the project to its file, and asks for a name the first time.
- Save Project As — File > Save Project As always asks for a file name and saves the project there.
- What a project file holds — A project holds the data and everything needed to continue fitting it, but nothing that can be recalculated from those.
- The .fitproj file format — A .fitproj file is a ZIP archive of JSON parts, which any archive tool can open.
- Where the data came from — A project remembers which data file it was imported from, and notes in the log when that file no longer says the same thing.
- Unsaved changes — Closing Fit, starting a new project or opening another with unsaved work asks whether to save the project first, and a save that does not happen stops the command.
- Import Profile — File > Import Profile reads a data file and makes it the profile of the current project.
- Two-column data files (.dat) — A .dat file is plain text with the argument and the measured value on each line, and Fit reads the first two numbers of every line.
- Price data files (.csv) — A .csv file is read as a price series: one row per period, and the closing price becomes the value.
- Reload Profile — File > Reload Profile reads the data file the open project came from again, for when it has changed on disk.
- Export Curve Parameters — File > Export > Curve Parameters writes the Curve Attributes table to a tab-separated text file.
- Export Summary Table — File > Export > Summary Table writes the Summary table - data, model and difference point by point - to a tab-separated text file.
- Quit — File > Quit closes Fit, asking first whether to save unsaved work.
- Sample data — Fit comes with a few data files to try it on, in a folder called Data.
- Command-line options — Fit's window accepts a few switches that say what to open at start-up and how much to log.
- Log files — The window and the compute server each keep a log file, which is where to look when something went wrong.
- What Fit remembers between sessions — Some choices belong to you rather than to a project, and Fit keeps them in a settings file of its own.
Data
- The profile — The profile is the measured data a model is fitted to: a list of points, each an argument and the amplitude measured at it.
- The Data table — The Data tab on the left lists every point of the profile, or of the data interval in force, and lets you correct a value by typing over it.
- Argument axes and units — The horizontal axis can show the stored argument in several ways - as the curve type suggests, as a plain position, as a diffraction angle or through formulas of your own - without changing the data or the fit.
- Diffraction angles: Theta, 2 Theta and sin(Theta)/lambda — For a diffraction pattern the stored argument is read as the scattering angle 2 Theta in degrees, and the axis can show it as 2 Theta, as Theta, or as sin(Theta)/lambda.
- Wavelength — The wavelength of the radiation, in angstrom, is the number the Sin Theta / Lambda axis divides by.
- A custom argument axis — Data > Argument Transformation > Use Rule > Custom Position shows the argument through a formula of your own, given together with its inverse.
- Working on part of the profile — Data > Range narrows the program's work to the stretch of the profile between two points you pick, and brings the whole profile back.
- Smoothing the profile — Data > Smooth Profile replaces each amplitude by the mean of itself and its two neighbours, keeping the total of all amplitudes the same.
- Price data — Data > Price Data chooses which column of a price-data (.csv) file becomes the value, and what its argument is.
Model
- The model — The model is what the program fits to the profile: curves of a chosen shape, placed at positions, fitted over intervals, above a background.
- Choosing a curve type — The curve type is the shape every curve placed from a position takes, and is chosen from Model > Curve Type or from the list at the top of the Tools tab.
- Building the model from the Tools tab — The Tools tab on the left carries the model-building commands as buttons, so a round of picking, fitting and adjusting needs no trip through the menus.
- Picking points on the chart — In a picking mode each left click on the chart adds the data point nearest the pointer to the set being built, and a click on a point already in the set takes it out.
- Curve positions — A curve position is the argument where one curve of the model is placed; positions can be picked on the chart, proposed by the program or put at every data point.
- Fit intervals — A fit interval is a stretch of the profile fitted as a problem of its own, marked by a pair of bounds.
- The background — The background is the slowly varying level under the peaks; the program marks it with background points, which you can pick or have proposed.
- Subtracting the background — Model > Background > Subtract joins the background points by straight lines and subtracts those lines from the profile.
- Background fraction — The background fraction decides how small a peak the automatic searches still count: a point below 1/N of the highest point, for the factor N you set, is treated as background.
- Background variation — With Model > Background > Enable Variation ticked, a fit also adjusts a smooth background of its own alongside the curves.
- The Model tab — The Model tab on the right lists the curves of the model, one row per curve with where it sits, and is where one curve is chosen to be explained or deleted.
- The Curve Attributes table — The Curve Attributes tab at the bottom of the window lists every curve of the model with the value of each of its parameters.
- Parameter kinds: fitted, shared, fixed and computed — Each parameter value in the Curve Attributes table is one of four kinds, which say whether and how the fit moves it.
- Deleting a curve — Right-click a curve in the Model tab and choose Delete curve to remove it, together with the position it was placed from.
- Clearing the model — Model > Clear Model removes every curve from the model at once, after asking.
- User-defined curves — You can fit a shape of your own by typing its formula; the program turns it into a curve type that is saved and offered like the built-in ones.
- Writing the formula of a user-defined curve — In the Create New Curve Type dialog you give the curve a name and a formula in x; every other name in the formula becomes a parameter.
- Parameter roles and starting values — The Set Curve Type Properties dialog says which parameter of a user-defined curve is its argument, position, amplitude and width, which are held, and where each starts.
- Selecting and deleting user-defined curves — The curve types you have defined are chosen and deleted under Model > Curve Type > User.
Fitting
- Fitting a model — A fit adjusts the parameters of the model's curves until the calculated profile matches the measured one as closely as it can.
- Automatic decomposition — Fit > Automatically decides how many curves the profile needs: it starts with far more than any profile needs and removes every one the fit can do without.
- How many curves: the difference ceiling — Fit decides how many curves a profile needs with a ceiling on the difference that you choose, rather than with an information criterion.
- Minimize Number of Curves — Removes every curve the fit can do without, starting from the curves and fit intervals you already have.
- Minimize Difference — Fits the model as it stands: every curve is kept and only their parameters change.
- Stop — Ends the fit or other long computation that is running.
- Why a fit command is greyed — The fit commands are offered only when there is something to fit, the background has been dealt with, and nothing else is running.
- The difference (R-factor) — The number Fit reports for how well the model matches the data is an R-factor: the squared differences divided by the square of the summed data.
- Max Acceptable Difference — The ceiling on the R-factor that decides how many curves the automatic decomposition keeps.
- Curve scaling — With curve scaling on, the model is multiplied by one factor per fit interval so that its area matches the data before the two are compared.
- Minimizer — Fit > Minimizer chooses the algorithm that searches for the best parameters; the first one, the default, needs nothing extra.
- Loss Function — Fit > Loss Function chooses the number a fit makes as small as possible; the default, R-factor, suits almost every fit.
- Weighting — Weighting decides how much each point counts in a fit by the Python engine; counting data are conventionally weighted by one over the square root of the count.
- What the fit will actually do — When a choice cannot be honoured, the fit changes it and says so: always in the status bar, and in a dialog when you make the choice.
- When a fit ends — The chart, the tables and the Model panel are refreshed from the result, and the status bar shows how long the fit took and how good it is.
- Compute Server — The window does no fitting itself: every computation runs in a compute server, fit_server, and Fit > Compute Server says where it is.
- Compute backends — Help > Compute Backends summarises the engines a fit can run on and how to set up the optional Python one.
- Setting up the Python engine — The Python engine needs a one-time setup: a private Python environment with numpy, scipy and lmfit at the tested versions.
The window
- The main window — Data and tools on the left, the chart in the middle, the legend and the model on the right, tables along the bottom and a status bar under them.
- The Tools tab — The Tools tab holds the list of curve types and a group of buttons for each step of building and fitting a model.
- The chart — The chart draws the measured profile and everything the model adds to it, and shows the coordinates of the point nearest the pointer.
- Zooming and scrolling the chart — Drag a rectangle from its top-left corner to its bottom-right corner to zoom into it; drag in any other direction to see everything again.
- View Markers — View > View Markers marks every point of the profile and of the model curves, not only the line through them.
- The Graphs tab — The Graphs tab is the chart's legend: one row per series, with a tick to show or hide it and a square of its colour.
- The Model panel — The Model tab lists the curves the model is made of, one row per curve, with the Explain pane under the list.
- The Explain pane — The pane under the Model panel explains what you are looking at: the selected curve, the curve type you clicked, or an entry of the Model panel's right-click menu.
- Explain Everything — Help > Explain Everything opens every explanation this build can give: this guide, every curve type and every rule a module adds.
- The tables at the bottom — Five tabs along the bottom show the model's inputs and results as numbers: Background Points, Fit Intervals, Curve Positions, Curve Attributes and Summary.
- The Background Points table — Lists the background points by Position and Amplitude, beside the buttons that find, subtract and remove them.
- The Fit Intervals table — Lists each fit interval by its Starting Position and Final Position.
- The Curve Positions table — Lists where curves are placed: the positions you picked, or where the fit put the curves when you picked none.
- The Curve Attributes table — One row per curve and one column per parameter, holding the values the last fit found.
- The Summary table — For every point inside every fit interval: the measured value, the model's value, their difference and each curve's own contribution.
- The Edit menu — Edit > Copy to Clipboard, Edit > Delete and Edit > Select All act on the table that has the keyboard focus.
- The status bar — Four panels along the bottom: the elapsed time, the fit's figures, a hint, and what the next fit will do.
- Screen scaling — The window scales itself to the screen's pixel density; the /DPI switch or the FIT_UI_DPI variable sets the density when the guess is wrong.
- What the window remembers — A few choices are kept between sessions in a settings file; everything about the model is kept in the project instead.
- Modules in the window — A build that contains a module shows its commands in a submenu of Model and a group on the Tools tab, and can give it a table tab of its own.
Fit progress
- Fit progress — While a fit runs, the chart area shows how far it has got instead of an empty chart.
- Animation Mode — With View > Animation Mode ticked, a running fit redraws the model over the data as it improves, instead of the chart of its R-factor.
Curve type
- 2 br. Pseudo-Voigt — A pseudo-Voigt peak with an independent width and Gaussian-Lorentzian mix on each side of its maximum.
- Asym. Pseudo-Voigt — A pseudo-Voigt peak made asymmetric by giving its two sides different widths, sigma + deltasigma on the right and sigma - deltasigma on the left.
- Doniach-Sunjic — An asymmetric photoemission line of metals: a Lorentzian of half-width sigma skewed by the singularity index alpha.
- Exponentially Modified Gaussian — A Gaussian convolved with a one-sided exponential decay, giving a peak with a tail of time constant tau.
- Gaussian — A symmetric bell-shaped peak whose area is A, centred at x0, with standard deviation sigma.
- Lorentzian — A symmetric peak with heavy tails, whose area is A, centred at x0, with full width at half maximum sigma.
- Moffat — A symmetric peak of height A with core width sigma and power-law wings set by m, used for stellar images.
- Pearson VII — A symmetric peak of height A and full width at half maximum sigma, whose tail weight m runs from Lorentzian to Gaussian.
- Pseudo-Voigt — A weighted sum of a Gaussian and a Lorentzian with one shared width, used as a fast stand-in for the Voigt profile.
- Skewed Gaussian — A Gaussian made asymmetric by the shape parameter beta, following the skew-normal distribution.
- Step (erf) — A smooth step of height A centred at x0, whose sharpness is set by sigma.
- User Defined — A curve whose formula you type yourself, with parameters named in that formula.
- Voigt — The convolution of a Gaussian of width sigma with a Lorentzian of half-width gamma, scaled by A.