Workflow: FCS fitting
This tab fits Fluorescence Correlation Spectroscopy (FCS) autocorrelation curves using a selection of diffusion/blinking models.
The GUI supports:
Single-file fitting: choose one exported correlation CSV
Batch fitting: choose a folder and fit all matching CSV files recursively
Model-dependent initial parameters: the initial-parameter editor shows only parameters relevant to the selected model
Publication export: the displayed fit is saved as SVG, and numerical outputs are saved as CSV
Input data format
The fitter expects a correlation CSV file where the first columns are:
tau(lag time, seconds)G(tau)(correlation)count_rate(scalar; typically stored in a fixed row/column in your export)sigma_G(uncertainty ofG(tau))
The code reads the CSV using pandas.read_csv(..., header=None) and then uses:
tau = col 0G = col 1count_rate = data.iloc[0, 2]sigma_G = col 3
So your CSV must contain at least these columns. Essentially, make sure that at lease the first column contains the diffusion time in seconds and second column contains correlation values. Ideally the 4th column contains the std deviation in G.
Single-file fitting
Open the FCS Fitting tab.
Under Single CSV, click Browse and select a correlation
*.csv.Choose a Model (see below).
Set fit limits:
Tau min (s)
Tau max (s)
Set optical parameters used by the model:
PSF radius (µm)
PSF aspect ratio
Set temperature information:
Experiment T (°C)
(Optional) Adjust Initial parameters shown for the selected model.
Click Run Fit.
The fit result is displayed inside the GUI (Matplotlib canvas) and exported to disk.
Batch fitting
Under Batch folder, click Browse and select a folder.
The program searches recursively for matching CSV files (default pattern
*.csvunless you restrict it in code).Choose model and parameters as above.
Click Run Fit.
During batch fitting, the GUI can optionally update the display per finished file (depending on your worker/batch configuration).
Models
The model list includes (examples):
g2diff,g2diffSFCS,g2diffOffset,g2diffBlinkg3diff,g3diffOffset,g3diffBlink,g3diffBlinkOffsetg3diffTwoComponents,g3diffTwoComponentsBlinkg3diffDoubleBlinkg3diffLargeParticlesg3anomalousDiff,g3anomalousDiffBlinksiFCS,siFCSTwoComponentsg3diffMEMFCSCalibration variants:
...Cal
Blinking and offset conventions
Any model name containing
Blinkuses blinking parameters (e.g.delta,F_Blink/F_B).Any model name containing
Offsetincludes an additive offset parameter (offset).
The GUI shows the relevant initial parameters automatically.
Initial parameters (model-dependent)
The initial parameter editor displays only the parameters relevant to the currently selected model.
Values are pre-filled from legacy defaults.
You can overwrite any shown value.
Parameters not shown remain at their default values internally.
Typical initial parameters include:
N,tau diffusionBlinking:
delta,F_Blink(and compatibility keyF_B)Two-component diffusion:
f1,rho_DMEMFCS:
tau_D limits,number of diffusion components,number of iterationsAnomalous diffusion:
Gamma,AlphaOffset models:
offset
Calibration parameters (Given D)
For calibration-type models (model name contains Cal), the GUI displays:
Given D (µm²/s)
Given D temp (°C)
These are used to temperature-correct a known diffusion coefficient to the experiment temperature.
For non-calibration models, these fields are hidden and not used.
Display and exported outputs
The GUI display typically shows:
Correlation data and fitted model
G(tau)Weighted residuals
iMSD (if applicable) or log-log correlation for models where iMSD does not apply
Histogram of weighted residuals
Output folder
For each fitted CSV file, outputs are written next to the file into:
Results/
Output files
For an input base name mycurve and model g2diffSFCS, the program saves:
Results/mycurve_g2diffSFCS.svg
(SVG export of the displayed figure)Results/mycurve_g2diffSFCS.csv
(tau, G, sigma_G, fitted curve)Results/mycurve_g2diffSFCS_iMSD.csv
(tau, iMSD) — only for models where iMSD is meaningfulResults/g2diffSFCS_fit_summary.csv
(fit parameters; appended per file)
Troubleshooting
“CSV columns are wrong” / indexing errors
Your CSV must contain at least 4 columns as described above (tau, G, count_rate, sigma_G). If your exporter uses a different layout, adapt the column indices in the fitter.
No SVG output
SVG export is performed by the GUI display function. Ensure the fit completed and the Results folder is writable.
Batch is slow
Batch fitting can be slow for large datasets and complex models. If the GUI updates the plot for every file, that also adds overhead. You can choose to update the display only for the last completed file.