SmartFitter is a Python application for loading, visualizing, fitting, and exporting data from nitrogen-vacancy (NV) center experiments saved as MATLAB .mat files. It provides an interactive desktop GUI for individual measurements and a command-line batch pipeline for folders of experiments.
- Loads legacy MATLAB
savedDatafiles and newerdata+scanInfosnapshots. - Supports Rabi, Ramsey, spin echo, dynamic decoupling, T1, ODMR, DEER, line scans, and 2D stage scans.
- Provides experiment-aware fitting, diagnostics, exclusions, transformations, overlays, iteration views, and derived NV metrics.
- Includes a unified Plot Editor for legends, annotations, titles, axes, ticks, secondary axes, and report presentation.
- Exports publication-ready PNG, PDF, and SVG figures plus JSON, CSV, and report outputs.
- Includes representative test data and an offscreen GUI regression suite.
- Python 3.12 or newer
- Windows, macOS, or Linux
The GUI uses Qt through PySide6. The included one-click launcher is Windows-specific; the Python launch command works on every supported platform.
Clone the repository and enter its directory:
git clone https://github.com/Divc09/Lab-Data-Analysis.git
cd Lab-Data-AnalysisCreate an isolated Python environment.
Windows PowerShell:
python -m venv .venv
Set-ExecutionPolicy -Scope Process Bypass
.venv\Scripts\Activate.ps1
python -m pip install --upgrade pip
python -m pip install -r requirements.txtmacOS or Linux:
python3 -m venv .venv
source .venv/bin/activate
python -m pip install --upgrade pip
python -m pip install -r requirements.txtStart SmartFitter:
python -m nvfit.gui_appOn Windows, after creating .venv, you can also double-click Launch SmartFitter.vbs.
- Open or drag in a supported
.matfile. - Leave the analysis profile on Auto, or choose an experiment-specific profile.
- Select the observable: contrast, signal, reference, or difference.
- Adjust the region of interest, binning, smoothing, exclusions, or transforms as needed.
- Run the fit for supported 1D experiments.
- Double-click a legend, annotation, title, axis label, or tick label to customize the figure.
- Export the figure, fit data, metadata, or report.
Spatial scans are plot-only. Their map controls provide color scaling, view bounds, pan and zoom, peak/dip navigation, and cursor or best-point linecuts.
Process every .mat file in a folder:
python -m nvfit.pro_batch --input-dir "path/to/data" --output-dir "path/to/results"Process one file:
python -m nvfit.pro_batch --single-file "path/to/data.mat" --output-dir "path/to/results"Run python -m nvfit.pro_batch --help for all options. Batch results include fit figures, JSON records, CSV summaries, validation reports, and aggregate reports.
With the virtual environment active:
python -m pytest -qSome tests use optional lab-local datasets and are skipped automatically when those files are unavailable. The checked-in TestData fixtures cover the portable regression suite.
nvfit/— GUI, data loaders, preprocessing, models, fitting, diagnostics, export, and batch analysis.tests/— automated unit and offscreen GUI tests.TestData/— compact MATLAB fixtures used by the tests.scripts/— specialized research analysis and presentation scripts.USER_GUIDE.txt— detailed end-user instructions.nvfit/APP_REFERENCE.md— implementation and application behavior reference.
The included fixtures are representative experimental data intended for testing and examples. Fit suitability, uncertainty, and physical interpretation remain the responsibility of the user. Review outputs and diagnostics before using results in publications or experimental decisions.
Contributions are welcome. Please:
- Create a branch for the change.
- Add focused tests for new behavior or bug fixes.
- Run
python -m pytest -q. - Open a pull request describing the motivation, implementation, and validation.
Avoid committing private experimental data, credentials, local environments, generated reports, or machine-specific configuration.
This project is available under the MIT License.