Files
BD_Fresnel_GUI/README.md
T
2026-09-21 11:37:42 +00:00

9.4 KiB
Raw Blame History

BD Fresnel

Beam-deflection pump–probe simulator and fitting tool. A Python port of the MATLAB BD_Fresnel_GUI suite.

The program models a weak probe beam crossing a sample that has been excited by a strong pump, propagates the perturbed probe field to a detector by Fresnel diffraction, and computes the transmission T and normalised beam deflection ΔE/E as a function of pump–probe delay. Measured scans can be imported and compared against the simulation, and the result exported as data, a log, and publication-sized figures.

BD Fresnel fitting a measured scan

Features

  • Seven mechanism slots, each independently configurable, summed into the total nonlinear response.
  • Instantaneous (electronic) and non-instantaneous responses, the latter convolved with the pulse envelope.
  • Group-velocity mismatch between pump and probe handled through the walk-off parameter rho.
  • Excited-state absorption via a five-level population model (S₀, S₁, S₂, T₁, T₂) solved through the sample depth for a range of radial irradiances.
  • Side-by-side transmission and deflection plots with imported data overlaid.
  • Optional diagnostic figures showing each mechanism's response function before and after convolution, plus the ESA populations and beam transmissions.
  • Export of the data/fit comparison, a full parameter log, and figures at 6.5 in / 300 dpi.

Requirements

  • Python 3.10 or newer (developed against 3.12)
  • numpy, scipy, matplotlib, mpmath
  • Tkinter, which ships with most Python builds. On Debian/Ubuntu it is a separate package:
sudo apt install python3-tk

Install the Python dependencies with:

pip install -r requirements.txt

Running

python bd_fresnel_gui.py

The window opens with the parameter panel on the left and three tabs on the right: Fitting, Diagnostics, and Parameter log.

A typical session:

  1. Set the Data columns to match your file, and the delimiter.
  2. Press Import… and choose a scan. The plots show the measured data.
  3. Fill in the beam, material and geometry parameters, and configure one or more mechanisms with the Params… buttons.
  4. Press Fit to run the simulation and overlay it on the data.
  5. Press Export… to write the results.

Fit stays disabled until a file is imported, and Export until a fit has completed.

Parameters are saved to last_settings.json beside the scripts when they change, and restored at the next launch. The data file itself is not restored.

Input data format

A delimited text file with one header line, then one row per delay point. Three columns are required; which ones is set in the Data columns box, so extra columns can be present and ignored.

Quantity Units Default column
Delay τ_d fs 1
ΔE/E fractional 2
T fractional (1.0 = no change) 3

The delimiter field takes a single character, \t for a tab, or is left blank to split on any run of whitespace.

Parameters

Data columns (1-indexed)

Variable Default Column contents
`tau_d_col' 0 Delay column (fs)
T_col 1 Transmission data column
DeltaEoE_col 3 Deflection data column
Delimiter , Data column delimiter character

Simlation parameters

Variable Default Column contents
X_num 50 Number of spatial points
X_max 5 Range of spatial sampling (w_0)
T_num 100 Number of temporal points
T_max 5 Range of temportal sampling (tau_p)
T_max 150 Number of delay points over range

Excitation beam parameters

Variable Default Column contents
E_p 1.0 Excitation pulse energy (uJ)
tau_p_FWHM 45 Excitation pulse duration (fs)
w_0p 142.83 Exciation pulse width (um)
lambda_p 800 Exication pulse wavelength (nm)

Probe beam parameters

Variable Default Column contents
tau_FWHM 100 Excitation pulse duration (fs)
w_0 22.253 Exciation pulse width (um)
lambda 650 Exication pulse wavelength (nm)

Material parameters at exication wavelength

Variable Default Column contents
R_p 0.034 Reflectivity
alpha_p 0.03 Linear absorption (cm^-1)
n_p 1.4533 Linear index
dndl_p -0.017284 First order dispersion (um^-1)
alpha_2d 0.0 2 photon absorption (e-11 m/W)

Material parameters at probe wavelength

Variable Default Column contents
R 0.0 Reflectivity
alpha `0.0 Linear absorption (cm^-1)
n 1.4565 Linear index
dndl -0.027158 First order dispersion (um^-1)

Measurement parameters

Variable Default Column contents
l 1.72e-6 Sample thickness (mm)
d `15.0 Distance to detector (cm)
shift 70.0 Temporal shift (fs)
x_0 0.5 Displacement of probe (w_0p)

Mechanisms

Mechanism Parameters
Electronic (both) 2
Collisional (NLR) 3
Librational (NLR) 4
Reorientational (NLR) 3
Vibrational (NLR) 3
ESA – 3 level + triplet (both) 10
Exponential rise/decay (NLA) 3
Exponential rise/decay (NLR) 3
Exponential rise/decay (both) 4

NLR denotes a purely refractive response, NLA a purely absorptive one, and both a mechanism carrying each.

Export output

Exporting to <name>_fit.txt also writes, in the same directory:

File Contents
<name>_fit.txt delay, data and fit for T, ΔE/E and Δn
<name>_fit_log.txt every parameter, plus a manifest of the files written
<name>_fit_combined.jpg / .svg transmission and deflection, 6.5 in at 300 dpi
<name>_fit_raw_response.jpg each mechanism's R[t] and A[t]
<name>_fit_convolved_response.jpg the same after convolution, plus the total

The last two appear only when Show diagnostic plots during Fit is ticked.

The log records enough to reproduce a run: data columns and delimiter, the simulation grid, every beam, material and geometry value, each mechanism with its parameters, and the derived quantities (n_g, T_lin, z_0, I_0, rho).

Files

File Role
bd_fresnel_core.py physics: field propagation, mechanism responses, ESA solver, parameter dataclass, settings I/O. No display dependencies.
bd_fresnel_gui.py Tkinter interface, plotting, import/export, logging. Entry point.
set_params_dialog.py modal dialog for entering one mechanism's parameters.

References

Please cite the following when using results from this program.

  1. Reichert, M., et al. (2014). "Temporal, spectral, and polarization dependence of the nonlinear optical response of carbon disulfide." Optica 1(6): 436.
  2. Reichert, M., et al. (2014). "Temporal, spectral, and polarization dependence of the nonlinear optical response of carbon disulfide: supplementary material." Optica 1(6): 436.
  3. Ferdinandus, M. R., et al. (2013). "Beam deflection measurement of time and polarization resolved ultrafast nonlinear refraction." Opt. Lett. 38(18): 3518–3521.

License

Copyright (C) 2019-2026 Manuel R. Ferdinandus

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see https://www.gnu.org/licenses/.

The full license text is in LICENSE — download it from https://www.gnu.org/licenses/gpl-3.0.txt and save it as LICENSE in the repository root. Both source files carry the corresponding notice at the top.

NumPy, SciPy and Matplotlib are all BSD-licensed, so distributing this program under the GPL alongside them poses no conflict.