Academic experience (2013-2020)
Before I called myself a Data Scientist, most of my serious coding lived in fusion experiments and in a plasma spectroscopy lab. This page is the DS-relevant half of that story: Python and MATLAB against live data, project leading on a shared machine, science communication, and my first WordPress site plus my first real ML interpolation tool.
PhD - COMPASS tokamak (2013-2017)
Joint PhD in Fusion Science and Engineering (Ghent University, IPP Prague, CTU Prague) - Python, MATLAB
From November 2013 through November 2017 I ran an experimental program on the COMPASS tokamak at the Institute of Plasma Physics in Prague, inside the Fusion-DC doctoral track. The physics topic was runaway electrons. What stayed with me for later data work was the operating loop: decide what to measure, book the machine, keep the shot lists, turn discharges into figures, and close each year in writing.
Python against a live shot database
I wrote about 60 Python scripts (2015-2016) on NumPy, SciPy, Matplotlib, and pyCDB - the client for the COMPASS discharge database. The pattern was almost always the same:
- a shot list in the file (one shot, a hand-picked set, or a whole campaign via
np.arange) - a
CDBClient()connection - one
try/exceptper signal, so a missing channel becomesNaNand the loop continues - a time window around an event, then a saved figure at a fixed DPI so a hundred shots look the same on the page
That is batch thinking in practice: one interesting discharge is a check; a campaign of 150 shots with holes in the channels is the real job. I added small defensive habits because a long loop should not die on shot 40: division-by-zero guards, safe logarithms, Savitzky-Golay smoothing before an integral. Campaign boundaries showed up as commented shot ranges in the files, so I could rerun last year’s scan without digging through email.
Scripts covered 1-D export for fast revision checks, IR camera frame batches, hard X-ray overlays with plasma current and normalized beta (each channel in its own try), detector debugging scripts, magnetics integrals against coil signals, equilibrium scalars copied into MATLAB, and list-mode reads from a helium-3 neutron counter. I also started HDF5 with h5py as a sketch; production paths stayed on pyCDB.
Tools other people could click
The step past “a script on my machine” was two MATLAB GUIDE apps, REcheck and REcompare, each with dozens of callbacks.
REcheck: type a shot and a time window, tick which signal groups to plot (current, X-ray channels, density, magnetics, equilibrium, radiation, and more). Empty or non-numeric input gets an error dialog; plotting lives in a separate function so the GUI only decides layout.REcompare: the same idea for more than one shot, so a density or gas scan can be viewed side by side.
The lesson for later DS work: validate input, group related signals, keep database access in one place, and separate “which plot” from “how to draw it.”
Driving code I did not write
Large upstream solvers stayed upstream. I learned integration:
- NORSE (a time-dependent kinetic code): a thin driver that pulls measured electron temperature, density, and loop voltage from the database and feeds time series into the solver’s input structures. I kept a clean copy and a copy I was allowed to break.
- SYRUP (synchrotron spectrum GUI): my scripts lived beside the author’s tree and called the same spectrum routines.
- When the MATLAB integral was correct but slow, a C routine compiled with
mexand the GNU Scientific Library replaced the inner loop, with the same call signature so the rest of the tool did not care.
Leading the experimental program
Coding decided how a shot was read. Planning decided which shots existed.
- Proposals and research plans through many drafts (EUROfusion proposal, yearly task proposals, deliverable reports). Filenames carried the version story (
draft,semifinal,final, supervisor initials). - Shooting calendars and session descriptions for the control room: which week was ours, which scan block came first, so operators and diagnosticians knew what had to be on.
- Campaign folders as scope: full campaign vs a shortlist of “the shots that mattered,” calibration data kept separate so a number was obviously a scale factor, and outbound packages in their own folder for collaborators.
- Hardware I helped specify or commission: X-ray detectors, IR camera, Cherenkov head, argon puff hardware with a calibration script, helium-3 counter - each ending as a signal name in the database once grounding and time constants were checked.
Communication and closing the loop
A result was not done when the figure existed. It was done when the discharge summary, a talk, and a thesis chapter agreed on which shots were in.
- Talks at COMPASS meetings, REM workshops, EPS, visiting sessions (Frascati, student schools), while campaigns were still warm.
- Papers kept as full revision trails in folder names; co-authored manuscripts separated from “mine only.”
- A thesis integrated by program chapter order, with reviewer comments tracked issue by issue; abstracts in English, Dutch, and Czech for the joint degree.
What carried over to data science
Data plumbing (one database, many signal names, two client languages). Loops that survive missing data. Two speeds of tool (my script this week vs a GUI for the lab). Scoping work on a shared resource (calendar blocks, shot lists, collaborator folders). Writing for a specific reader (operator, funder, supervisor, referee).
Institute of Physics Belgrade (2017-2019)
Associate Research Scientist, Laboratory for Plasma Spectroscopy and Lasers (PSL) - WordPress, Python
Roughly 2017-2019 at the Institute of Physics Belgrade, in parallel with wrapping up the PhD archive and the freelance work that followed. The lab needed a public face and a numerical pipeline for spectral line work. I owned both, plus smaller batch Python (convolution, peak landmarks, VUV ingestion) that the overviews in my private archive describe in more detail.
Lab website (WordPress)
PSL needed a site that could hold people, publications, equipment, news, and collaborations for years - a content database with a public interface, not a one-off brochure.
What I did:
- Draft on WordPress.com, then self-hosted WordPress.org on the institute server; the public site is psl-lab.ipb.ac.rs.
- Content migration with WP-CLI (WXR import, bulk media import), not the browser importer.
- Pretty permalinks via standard Apache rewrite rules; custom CSS for hover tiles and in-page abstract pop-ups; a small set of plugins (spam filter, stats, importer).
- Staff pages built from colleagues’ CVs and bibliographies; I enforced a light data-quality schema (DOI, journal, impact factor, citation counts where we had them).
- A handover runbook for the next maintainer: SSH, uploads path, news naming (event date as category), and an honest note that plugin updates were manual and often deferred.
DS translation: a small catalog product end to end - entities, ETL from export, presentation layer, operability doc. No passwords or personal credentials belong on a portfolio page; the real runbook stayed local.
Line-profile interpolation (Python, ML)
A colleague needed theoretical spectral line profiles at plasma conditions between simulation grid points, then convolved with the real spectrometer response so curves could be compared to measurements. Simulations existed on a coarse grid: 13 electron densities × 4 temperatures, for five emission lines (roughly Jan-Aug 2019).
Stage 0 - convolution batch job
First deliverable: read theory and Instrumental.txt, resample both onto the finer wavelength step, pad ranges, align peaks, convolve (full mode, then trim so peaks stay lined up), optional Doppler Gaussian left off in the final batch. One finished run covered on the order of 260 cases, each with a PNG and a TSV (lambda, theory, instrumental, convolved columns).
Stage 1 - one big model (did not work)
I tried a single regressor over wavelength, temperature, and density: Gaussian Process Regression, SVR, even a Keras deep MLP with a custom RBF layer, plus inverse-CDF resampling to place sample points where the line actually sits. It did not generalize across the huge dynamic range. The lesson: decompose before you stack more layers.
Stage 2 - GPs done properly
In parallel I worked through the Coursera Bayesian Methods for ML track (GPy, sparse GPs, GPyOpt for hyperparameter search). That fed directly into the next stage; more context in my 2019 education blogs.
Stage 3 - per-line model zoo
Split each profile into shape, wavelength window, and area:
- SVR on log-scaled density for
lambda_min/lambda_max(with a few hand-fixed window outliers). - Matérn GPRs for area vs density (one per tabulated temperature) and area vs temperature (one per tabulated density).
- One GPR per simulated grid profile, saved with joblib (~75 artifacts per line folder).
- Validation by predicting midpoints between training grid points and plotting train vs holdout.
Stage 4 - hybrid GP + spline (final class)
The mature version worked from raw simulation files instead of only the saved GPR shapes:
- Predict window with SVR; pad if narrower than the instrument width.
- At each tabulated density: temperature interpolation that preserves area, GPR resample onto the new grid, clip negatives.
- At each of ~2000 wavelength samples: quadratic interpolation in density across the 13 tabulated points.
- Instrument from file (GPR fit) or a Gaussian FWHM; convolution and peak alignment as before;
control_plot()with three panels for debugging.
I refactored exploratory notebooks into a reusable InterpolateLine class with plotting and export. I kept named hard cases in the notebooks (“three-bumps”, “weird”) as regression stories.
Honest limits: no test suite, no extrapolation guard outside the grid, hardcoded machine paths in the 2019 tree, and a stack that would need retuning on modern NumPy/SciPy/sklearn before it runs unchanged today.
What carried over to data science
Own a small data product (the website). Finish a batch pipeline (260 tables). Iterate ML architecture when the monolith fails (decompose, then hybrid classical + GP). Deliver negatives and diagnostics, not only a happy-path demo. Notebook → class when a collaborator needs to call the same thing twice.
If something is wrong in this summary or you want a subsection expanded, please let me know.