Fit

Interactive curve fitting for Linux, Windows and macOS

User guide

The window

The main window

This software's choiceA decision made by this software rather than by the field's sources; the explanation says why it was made.

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 window is divided into five parts:

Above the chart is a toolbar with four buttons: Import Profile (File > Import Profile), Zoom In and Zoom Out (View > Zoom In and View > Zoom Out), and Automatically (Fit > Automatically). Hovering over any button shows what it does in a tooltip and in the status bar.

The borders between the parts - left and right of the chart, above the tables, between the curve-type list and the buttons, and above the Explain pane - can be dragged to give any part more room.

A build that contains a module can add a submenu, a group of buttons, rows in the Model panel and a tab of its own at the bottom.

Limitations

See also: The Tools tab · The chart · The Graphs tab · The Model panel · The tables at the bottom · The status bar

The Tools tab

This software's choiceA decision made by this software rather than by the field's sources; the explanation says why it was made.

The Tools tab holds the list of curve types and a group of buttons for each step of building and fitting a model.

The list at the top offers every curve type of this build, grouped under headings - the same types as Model > Curve Type. Click one to make it the type every curve of the model is made of. Click the selected type again and the Explain pane on the Model tab explains it. Hovering over a type shows its one-line summary.

Under it are the buttons, in the order the work is done. Each group's heading shows how many items it holds now:

A Pick button stays pressed while its picking mode runs; press it again to stop. Every button follows the menu entry it stands for: when the entry is greyed, so is the button, and both show the same hint.

A module can add groups of its own below these.

Limitations

See also: The main window · Minimize Difference · The Explain pane

The chart

This software's choiceA decision made by this software rather than by the field's sources; the explanation says why it was made.

The chart draws the measured profile and everything the model adds to it, and shows the coordinates of the point nearest the pointer.

Everything drawn is listed on the Graphs tab, where each can be hidden: the profile; each curve of the model; their sum, Total Amplitude; the Difference between data and model; the background points; the fit interval bounds, drawn as lines down from the top; the curve positions you picked, drawn as crosses, and the fitted positions where the fit put the curves, drawn as circles; and points being picked, drawn as lines up from the bottom.

A crosshair follows the pointer, snapping to the nearest drawn point. Position and Intensity, under the tabs on the right, show that point's two coordinates, to two decimal places.

A left click on the chart places a point while one of the picking modes is on - see the Pick buttons of the Tools tab. A right click opens the menu of argument axes, the same choices as Data > Argument Transformation > Use Rule.

Dragging with the mouse zooms, and the scroll bars move a zoomed view; see "Zooming and scrolling the chart".

While a fit runs, the chart gives way to a chart of the fit's progress. With View > Animation Mode ticked, it shows the model moving over the data instead.

Limitations

See also: Zooming and scrolling the chart · View Markers · The Graphs tab · Animation Mode · Fit progress

Zooming and scrolling the chart

This software's choiceA decision made by this software rather than by the field's sources; the explanation says why it was made.

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.

With the mouse: press the button at the top-left corner of the part you want to see, drag to its bottom-right corner and release. A rectangle follows the pointer while you drag. Dragging in any other direction brings back the whole of what is drawn. The status bar reminds you: "Drag mouse from top-left to bottom-right to zoom".

View > Zoom In narrows the view by a tenth of its width and height on every side, keeping its centre; View > Zoom Out widens it by the same amount. Both are also buttons on the toolbar above the chart, and both are greyed while nothing is drawn.

When the chart is zoomed, the scroll bars below and to the right of it move the view along each axis without changing its size.

Limitations

See also: The chart

View Markers

This software's choiceA decision made by this software rather than by the field's sources; the explanation says why it was made.

View > View Markers marks every point of the profile and of the model curves, not only the line through them.

Without it, the profile, each curve, Total Amplitude and Difference are drawn as lines. With View > View Markers ticked, each of their points gets a small square as well - hollow on the profile, so the model drawn over it stays visible.

Series that consist of markers alone - curve positions, fitted positions, fit interval bounds and picked points - are always drawn and are not affected. The background points, circles joined by a line, follow the tick like the profile.

The tick starts cleared in every session, and the entry is greyed while nothing is drawn.

Limitations

See also: The chart · The Graphs tab

The Graphs tab

This software's choiceA decision made by this software rather than by the field's sources; the explanation says why it was made.

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.

Each row names one series: Profile, Total Amplitude, Difference, Background points, Fit intervals, Curve positions, Fitted positions, Selected interval while an interval of the data is selected, and each curve of the model by its type and number, such as "Gaussian [2]". The square at the right-hand end of a row is the colour the series is drawn in.

Clear a row's tick to hide that series from the chart, and tick it again to show it. The space bar toggles the selected row.

The curves of the model take their colours from a palette of sixteen, in order, so the seventeenth curve has the colour of the first.

When a curve is selected - in the Model panel or in the Curve Attributes table - it is drawn three times as thick and on top of every other series, and its row here turns bold.

Limitations

See also: The chart · The Model panel

The Model panel

This software's choiceA decision made by this software rather than by the field's sources; the explanation says why it was made.

The Model tab lists the curves the model is made of, one row per curve, with the Explain pane under the list.

For a model built from curve positions, each row is one curve: its type and number, and where it sits - for example "Gaussian [1] at 23.5". The list fills as soon as positions are placed, before any fit, and is rebuilt when a fit ends.

Select a row to pick out that curve: it is drawn thick and on top on the chart, its legend row turns bold, and the Explain pane shows its curve type. Selecting a row of the Curve Attributes table selects the same curve here.

Right-click a row for what can be done to that curve; Delete curve removes it from the model, together with the position it was placed from. The entries are greyed over a row that names no curve.

A curve type that is placed from markup of its own - a pattern a module provides, for example - fills the panel itself, possibly as a tree, and may offer commands of its own on the right-click menu.

An empty panel says why it is empty: "Open a data file to start building a model.", "No curves yet - place some with Positions on the Tools tab." or, for a type placed from its own markup, "No curves yet - this curve type is placed from its own markup."

Limitations

See also: The Explain pane · The Curve Attributes table · The Graphs tab

The Explain pane

This software's choiceA decision made by this software rather than by the field's sources; the explanation says why it was made.

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.

It shows one explanation at a time: what the thing is, what stands behind it - the field's own sources, common practice or a choice of this program - what it does not cover, where to read more, and related topics. A related topic opens in the pane; a reference to the literature opens in the web browser.

Which topic it shows:

Every topic it can show is also listed by Help > Explain Everything.

Limitations

See also: The Model panel · Explain Everything

Explain Everything

This software's choiceA decision made by this software rather than by the field's sources; the explanation says why it was made.

Help > Explain Everything opens every explanation this build can give: this guide, every curve type and every rule a module adds.

The window it opens lists every topic on the left, under a heading for each chapter: first the chapters of this guide and Fit progress, then the curve types and what the build's modules explain. Within a chapter the topics are in alphabetical order.

Click a topic to read it on the right. Links in it lead to related topics; references to the literature open in the web browser.

The window stays open beside the main one, so it can be read while you work.

Limitations

See also: The Explain pane · Modules in the window

The tables at the bottom

This software's choiceA decision made by this software rather than by the field's sources; the explanation says why it was made.

Five tabs along the bottom show the model's inputs and results as numbers: Background Points, Fit Intervals, Curve Positions, Curve Attributes and Summary.

Each tab has a small toolbar at its left edge; hovering over a button says what it does.

These tables are filled by the program. To change what they hold, pick on the chart or use the buttons and the Model menu; the profile on the Data tab is the one table you type into.

To take numbers to a spreadsheet, click in a table and use Edit > Select All and Edit > Copy to Clipboard.

A saved project remembers which of these tabs was in front.

See also: The Background Points table · The Fit Intervals table · The Curve Positions table · The Curve Attributes table · The Summary table · The Edit menu

The Background Points table

This software's choiceA decision made by this software rather than by the field's sources; the explanation says why it was made.

Lists the background points by Position and Amplitude, beside the buttons that find, subtract and remove them.

Each row is one point of the background, picked on the chart or found from the data.

The toolbar, from the top:

A point can also be moved by typing: change its Position or its Amplitude and leave the cell, and the point moves, on the chart and in the engine.

See also: The tables at the bottom

The Fit Intervals table

This software's choiceA decision made by this software rather than by the field's sources; the explanation says why it was made.

Lists each fit interval by its Starting Position and Final Position.

Intervals are picked as pairs of bounds on the chart, and each row is one pair. While you are halfway through picking one, the last row has a Starting Position and an empty Final Position.

Only positions are shown: an interval is a stretch of the horizontal axis, and the height at its bounds means nothing.

The toolbar has two buttons: compute fit interval bounds automatically - Model > Fit Intervals > Compute Automatically - and remove all fit interval bounds - Model > Fit Intervals > Remove All.

A bound can be moved by typing: type a new position over it and leave the cell. It goes to the data point nearest what you typed, and the curves are rebuilt over the changed interval.

Limitations

See also: The tables at the bottom · The difference (R-factor)

The Curve Positions table

This software's choiceA decision made by this software rather than by the field's sources; the explanation says why it was made.

Lists where curves are placed: the positions you picked, or where the fit put the curves when you picked none.

Each row is one position, by Position and Amplitude. When you have picked positions, those are shown, because they are what you put there and can change. When you have picked none - a model placed from a module's markup, for example - the positions of the model's curves are shown instead.

The toolbar has two buttons: compute curve positions automatically - Model > Curve Positions > Compute Automatically - and remove all curve positions - Model > Curve Positions > Remove All.

A picked position can be moved by typing: type a new Position over it and leave the cell. It goes to the data point nearest what you typed, and its curve moves with it, keeping the shape a fit found for it. The Amplitude is the profile's value there and is not typed.

On the chart the picked positions are crosses and the fitted positions circles; after a good fit they sit close together.

Limitations

See also: The tables at the bottom · The chart

The Curve Attributes table

This software's choiceA decision made by this software rather than by the field's sources; the explanation says why it was made.

One row per curve and one column per parameter, holding the values the last fit found.

The columns are the parameters of the curves in the model. A cell is left blank where a curve's type has no such parameter. Values are shown to four decimal places; when the engine estimated an uncertainty - the Python engine does - it follows the value as "± error".

The colour of a cell shows how the value is treated, and the key under the table names the colours:

Click a row to select that curve: it is highlighted on the chart and selected in the Model panel. Select one or more rows and use Edit > Delete to remove those curves from the model.

The toolbar's first button writes the table to a text file, like File > Export > Curve Parameters; its Copy to Clipboard button copies the selected rows, like Edit > Copy to Clipboard.

Limitations

See also: The tables at the bottom · The Edit menu · The Model panel · Minimizer

The Summary table

This software's choiceA decision made by this software rather than by the field's sources; the explanation says why it was made.

For every point inside every fit interval: the measured value, the model's value, their difference and each curve's own contribution.

The columns are Position, Amplitude (the measured value), Total Amplitude (the model's value), Difference, and then one column for each curve. Each fit interval starts with a heading row of its own.

A curve's column is filled only on the rows where the curve has points, so a curve covering part of an interval leaves the rest of its column blank.

The table is empty until the model has both curves and fit intervals, and it is refilled when a fit ends.

The toolbar's first button writes the table to a text file, like File > Export > Summary Table; its Copy to Clipboard button copies the selected rows, like Edit > Copy to Clipboard.

Limitations

See also: The tables at the bottom · When a fit ends

The Edit menu

This software's choiceA decision made by this software rather than by the field's sources; the explanation says why it was made.

Edit > Copy to Clipboard, Edit > Delete and Edit > Select All act on the table that has the keyboard focus.

Click in a table first: one of the tables at the bottom, or the Data table on the left. With no table in focus, all three entries are greyed.

Limitations

See also: The tables at the bottom · The Curve Attributes table

The status bar

This software's choiceA decision made by this software rather than by the field's sources; the explanation says why it was made.

Four panels along the bottom: the elapsed time, the fit's figures, a hint, and what the next fit will do.

From left to right:

See also: What the fit will actually do · When a fit ends · The difference (R-factor)

Screen scaling

This software's choiceA decision made by this software rather than by the field's sources; the explanation says why it was made.

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.

Normally the density is what the system reports, and nothing needs doing.

A Linux build that uses GTK2 cannot see a scaled desktop - it reports 96 dots per inch for a 200 % display. There the program looks in turn at GDK_SCALE, QT_SCALE_FACTOR and the Xft.dpi setting of the X server, and uses the first it finds.

To set the density yourself, start the program with /DPI=<ppi> - for example /DPI=192 for a 200 % display - or set the environment variable FIT_UI_DPI to the same number. The switch wins over the variable, and both win over everything the program would otherwise detect.

Limitations

See also: The main window

What the window remembers

This software's choiceA decision made by this software rather than by the field's sources; the explanation says why it was made.

A few choices are kept between sessions in a settings file; everything about the model is kept in the project instead.

Kept in a folder named Fit in your home folder - in config.xml, and the curve types you defined in files of their own beside it:

Kept in the project file instead, and restored when the project is opened: the data, the model and its fit, the maximum acceptable difference, curve scaling, and which table tab was in front.

Limitations

See also: The main window · Screen scaling

Modules in the window

This software's choiceA decision made by this software rather than by the field's sources; the explanation says why it was made.

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.

A module extends the program for one field or one kind of model. What it adds to the window:

A build without modules shows none of this.

Limitations

See also: The main window · Explain Everything