Skip to content

Fit

Interactive curve fitting for Linux, Windows and macOS

User guide

The window

The main window

This software's choice — A 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, above the Explain pane and above the details on the History tab - can be dragged to give any part more room. The window opens at the size and place you left it, with each part as large as you made it; View > Reset Layout puts everything back as it was designed.

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.

See also: The window's size and its parts · 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 choice — A 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 choice — A 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 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; points being picked, drawn as lines up from the bottom; and any series a module adds.

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.

Each axis is marked at no more than ten round values, and a grid line runs from each mark. Zoom in and the marks close up to finer round values; scroll, and the grid moves with the data rather than being counted again from the edge of the view.

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".

A curve position you picked, and the start or end of a fit interval, can be moved by dragging it: press on it, drag, and release. A dashed line shows where it will go, and it lands on the nearest point of the data, as when a position is typed into the Curve Positions or Fit Intervals table. A press on such a point drags it; a press anywhere else zooms. A move that is not allowed - a bound past its neighbour, a position already taken - leaves the point where it was and says why. An analysis module may let its own points be dragged too, and says in its own chapter what that does.

The chart area has a tab for each chart. Model is this chart. R-factor draws the R-factor a fit reached against its time; it keeps the last run's curve until the next run starts. A module included in the build may add a chart of its own, and its chapter says what it shows. Under the Model chart, the Difference structure strip draws, point by point, where the difference between the data and the model holds more than noise - see "Is the difference only noise?". The window never switches tabs by itself; the line over the charts and the status bar report a running fit whichever is in front.

With View > Animation Mode ticked, the model moves over the data in the Model tab while a fit runs, and the Difference structure strip under it moves with it; without it, the Model tab shows the data, and the strip the last result, until the fit ends.

Limitations

See also: Zooming and scrolling the chart · View Markers · The Graphs tab · Animation Mode · Fit progress · Is the difference only noise?

Zooming and scrolling the chart

This software's choice — A 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 shows a fifth less, keeping the centre; View > Zoom Out shows a quarter more, so one undoes the other, and stops at the whole of the data. Both act on the chart of the tab in front, are also buttons on the toolbar above the chart, and are greyed while nothing is drawn.

The strip under the model's chart follows its x - zoomed and scrolled with it, its vertical lines under the model's - but its own values are never zoomed: it always shows them whole over the stretch on show. The R-factor tab, whose x is the run's time, zooms on its own.

Below the model's chart a scroll bar moves the view along x without changing its size, and the one to its right moves it along the model's values. A thumb is as long as the part on show, so its length says how far you are zoomed in, and a bar with nothing to scroll is greyed. A click beside the thumb moves the view by its own width.

A project keeps the part of the chart you had zoomed in on, and opens on it again. Loading other data, selecting an interval or going back to the whole profile shows everything.

Limitations

See also: The chart

View Markers

This software's choice — A 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 choice — A 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.

Difference not noise appears when the difference between the data and the model is not only noise somewhere: those stretches are shaded, hatched the other way from the fit intervals. See "Is the difference only noise?".

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. There are two such palettes, one for a light chart and one for a dark one, and View > Theme chooses between them.

A curve whose part in the model is how far it departs from other curves - a pattern nested inside another, say - is drawn on the curves it rests on, so it appears where it belongs rather than near zero. Only the drawing moves: its values in the tables, the fit and every statistic are its own.

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: Is the difference only noise? · The chart · The Model panel · Theme

Theme

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

View > Theme chooses whether the chart, the tables and the explanation panes are painted light or dark.

View > Theme > Follow System paints in the light or the dark palette as the system's own appearance is, and changes when the system does. View > Theme > Light and View > Theme > Dark keep one palette whatever the system is set to. Follow System is where Fit starts until another is chosen, and the choice is kept between sessions.

A palette is every colour Fit paints with itself: the chart's background and axes, the profile, each curve of the model, the fit intervals, the stripes and tints of the tables, and the text, links and highlighted lines of the explanation and report panes. Each colour in each palette is chosen to stand out against that palette's own background by at least the contrast the Web Content Accessibility Guidelines ask of a graphical object (3:1), and text by at least what they ask of body text (4.5:1).

A colour that a module chooses for what it draws is kept when it can be seen; when it cannot - navy on the dark chart, say - Fit lightens or darkens it just enough to reach the same 3:1.

On macOS, Light and Dark also set the appearance of everything the system draws for Fit - buttons, lists, dialogs, menus and window frames - so the whole application follows the choice; Follow System hands it back to the system.

Limitations

Sources

See also: The Graphs tab · The chart · The Explain pane · What the window remembers

The Model panel

This software's choice — A 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 History tab

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

The History tab lists every model a fit reached, newest first, with a graph of which model each was fitted from.

Each row is one model. Its first line gives the name you gave it, if any, its R-factor - or "Not fitted" - and how many curves it has. The R-factor is given in the form View > R-factor Scale chooses, the one the progress chart is drawn in: on Automatic that is its logarithm, "log10 R-factor -6.26215", so models a power of ten apart do not look alike. The second line says when it was recorded, in local time, and what produced it: Minimize Difference, Minimize Number of Curves, Automatically, or "Edited, not fitted", with ", stopped" when Stop cut the run short.

A filled circle and the mark ● show the current model - the one the chart and the tables show. The mark ★ shows the model with the lowest R-factor among those fitted to the same data with the same objective.

The graph on the left of the rows reads like a version history: a line runs down from each model to the model it was fitted from. When you make an older model current and fit again, the new model starts a branch of its own, drawn in another colour, and the branches meet at the model they started from.

Click a row to see it described in the pane below the list: when and how it was recorded, its R-factor as it is whatever the scale, its statistics, its curves and picked positions, and the model it was fitted from. A click changes nothing else.

Double-click a row, press Enter, or choose Make Current to make that model the current one: the chart, the Model panel, the tables, the Summary and the status bar then show it, R-factor included, and the next fit starts from it. Delete... removes the selected model from the history after asking; the Delete key does the same. Right-click a row for Make Current, Rename... and Delete....

Limitations

See also: The model history · The Model panel · The difference (R-factor)

The Explain pane

This software's choice — A 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 choice — A 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 choice — A decision made by this software rather than by the field's sources; the explanation says why it was made.

Tabs along the bottom show the model's inputs and results as numbers: Fit Intervals, Curve Positions, Curve Attributes and Summary, and any table a module adds.

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 Fit Intervals table · The Curve Positions table · The Curve Attributes table · The Summary table · The Edit menu

The Fit Intervals table

This software's choice — A 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 choice — A 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 choice — A 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 choice — A 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 Run Log

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

The Run Log tab says what a run decided and why: each curve it removed, each it kept, and whether what it left is only noise.

While a fit runs, its decisions are added as they are made, under headings for the stages of the run - Reduction for the curves the automatic run takes away or keeps, Result for its verdict on the difference between the data and the model. An analysis module adds its own, under its name: what it placed, and what it refused and why.

Each line says what was decided, the numbers the rule compared - the BIC with the curve and without it, the randomness test's p before and after - and how far into the run it was decided; its link opens the explanation of the rule.

When the run ends, its log is kept with the model it reached in the History tab and saved in the project, and so is its R-factor as it went. The Run Log then shows the log of the current model, and the R-factor tab its R-factor: making another model current, or opening a project, shows why that one is what it is and how its run got there.

Limitations

See also: The History tab · Is the difference only noise?

The Edit menu

This software's choice — A 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 choice — A 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) · Is the difference only noise?

Screen scaling

This software's choice — A 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 option 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 option 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 choice — A 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 this computer's settings.json; everything about the model is kept in the project instead.

Kept in settings.json, the one file in which Fit keeps what it remembers on this computer (the chapter on projects and files says where it is and how it is laid out):

Kept in files of their own: the curve types you defined yourself, one file each in Fit's settings folder.

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 · The window's size and its parts · Screen scaling · What Fit remembers on this computer · Where Fit keeps its files

The window's size and its parts

Convention — Common practice or a guideline in the field, not a rule its sources require.

The window opens at the size and place you left it, with each part as large as you made it; View > Reset Layout puts it back as it was designed.

When the window closes, Fit notes on this computer how large it was and where, whether it filled the screen, and the position of every border you can drag: the width of the left and right parts, the height of the tables, of the curve-type list on the Tools tab, of the Explain pane on the Model tab and of the details on the History tab. The next session opens the same way. There is nothing to save and nothing to switch on: this is what desktop programs do, and a layout you arranged once should not have to be arranged again.

A window that filled the screen opens filled again, and goes back to the size it had before when you make it smaller.

The window always opens where you can reach it. If the screen it was left on is no longer connected, or is now smaller, it opens on a screen that is there and is made small enough to fit; a window you pushed partly off the edge yourself stays where you put it, as long as its title bar can still be grabbed.

The parts keep their proportions when the screen's scale changes (see Screen scaling): a part you made 300 pixels wide at 200 % is 150 pixels wide at 100 %. A part is never made too small to find again, and the left part is always wide enough for the buttons on the Tools tab.

View > Reset Layout puts the window and every border back as they were designed, at once, and forgets what was remembered. It asks nothing first: no work is lost, and the borders can be dragged again.

All of this is kept in the layout section of settings.json, on this computer only. A project carries none of it, so a project opened on another computer opens in that computer's window.

Limitations

Sources

See also: The main window · Screen scaling · What the window remembers · What Fit remembers on this computer

Modules in the window

This software's choice — A 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