NAME
Physics::Ellipsometry::VASE - Variable Angle Spectroscopic Ellipsometry analysis
VERSION
Version 1.01
SYNOPSIS
use PDL;
use PDL::NiceSlice;
use Physics::Ellipsometry::VASE;
use Physics::Ellipsometry::VASE::TMM qw(psi_delta);
use Physics::Ellipsometry::VASE::Dispersion qw(cauchy);
use Physics::Ellipsometry::VASE::EMA qw(ema_bruggeman);
use Physics::Ellipsometry::VASE::Materials qw(load_material interpolate_material);
use Physics::Ellipsometry::VASE::Optimizer qw(differential_evolution);
# Create VASE fitter with built-in delta handling
my $vase = Physics::Ellipsometry::VASE->new(
layers => 3,
circular_delta => 1, # circular residuals for Delta
deriv_step => 1e-3,
min_deriv_step => 0.01,
);
$vase->load_data('measurement.dat');
# Use built-in dispersion, EMA, TMM
my $cauchy_fn = cauchy(A => 2.1, B => 0.01, C => 0.001);
my $substrate = load_material('ta_pbp.mat');
$vase->set_model(sub { ... });
my $fitted = $vase->fit(pdl [...]);
my $mse = $vase->mse($fitted, nparams => 6);
$vase->plot($fitted, output => 'fit.png');
DESCRIPTION
Physics::Ellipsometry::VASE v1.01 provides a complete framework for spectroscopic ellipsometry analysis including:
Transfer Matrix Method (VASE::TMM)
Dispersion models: Cauchy, Sellmeier, Tauc-Lorentz, Drude, Genosc (VASE::Dispersion)
EMA mixing: Linear, Bruggeman, Maxwell-Garnett (VASE::EMA)
Material file loader with eV/nm conversion (VASE::Materials)
Parameter bounds and vary/fix control (VASE::Parameter)
Global optimizer: Differential Evolution (VASE::Optimizer)
Circular Delta residuals in LM fitting
Robust LM regularization (diagonal floor prevents singular matrices)
METHODS
new
my $vase = Physics::Ellipsometry::VASE->new(%args);
Constructor. Accepts the following options: layers (number of thin-film layers), circular_delta (enable circular Delta residuals), deriv_step, min_deriv_step, maxiter, eps, lm_reg_floor.
load_data
my $data = $vase->load_data($filename);
Reads ellipsometry data from $filename. The format is auto-detected:
- Simple format
-
Whitespace-separated columns. Lines starting with
#are comments; blank lines are skipped.# Wavelength(nm) Angle(deg) Psi(deg) Delta(deg) 400 70 45.0 120.0 410 70 44.5 121.0 - Woollam VASE format
-
Recognised when line 2 starts with
VASEmethod[. The four-line header is parsed and stored as object attributes:$vase->{sample_name} # line 1 $vase->{vase_method} # VASEmethod[...] content $vase->{original_file} # Original[...] content $vase->{units} # line 4 (e.g. "nm")Columns 5-6 (sigma_psi, sigma_delta) are extracted into
$vase->{sigma}and automatically used as weights during fitting.
Returns a PDL piddle of shape (4, npts) where the columns are wavelength, angle, psi, delta.
set_model
$vase->set_model(\&my_model);
Sets the model function used for fitting. The function receives two arguments:
sub my_model {
my ($params, $x) = @_;
# $params - PDL piddle of fit parameters
# $x - PDL piddle of shape (npts, 2):
# column 0 = wavelength (nm)
# column 1 = angle of incidence (degrees)
my $psi = ...; # compute psi (npts values)
my $delta = ...; # compute delta (npts values)
return cat($psi, $delta)->flat; # concatenated 1-D piddle
}
The return value must be a flat piddle of length 2*npts with all psi values followed by all delta values.
fit
my $fitted_params = $vase->fit($initial_params);
Performs a Levenberg-Marquardt fit of the current model to the loaded data.
$initial_params is a PDL piddle of starting parameter values. Returns a piddle of optimised parameters.
After fitting, the following attributes are available:
$vase->{covar} # covariance matrix (PDL)
$vase->{iters} # number of LM iterations
$vase->{ym} # model values at the fitted parameters
The fit uses relative-step finite differences for the numerical Jacobian (step size |p_i| * 1e-7 + 1e-10) and converges when the relative change in chi-squared falls below 1e-7, or after 300 iterations.
mse
my $mse = $vase->mse($fit_params, nparams => $n);
Calculates WVASE-convention mean squared error: sqrt(chi2 / (2*npts - nparams)).
plot
$vase->plot($fit_params, %options);
Plots measured data with the model fit overlaid. Requires PDL::Graphics::Gnuplot (loaded on demand).
Options:
- output
-
Filename for the plot image. The format is inferred from the extension:
.png,.pdf,.svg,.eps. If omitted, an interactive window is opened. - title
-
Title string for the plot (default:
"VASE Fit Results").
When multiple angles of incidence are present, each angle is plotted as a separate colour-coded series.
EXAMPLES
The examples/ directory in the distribution contains:
- fit_linear.pl
-
Minimal example fitting a linear dispersion model.
- vase_test_fit.pl
-
Cauchy thin-film model with complex Fresnel equations for Ta2O5 on Si.
- vase_tauc_lorentz_fit.pl
-
Tauc-Lorentz oscillator model with numerical Kramers-Kronig integration.
DEPENDENCIES
- PDL (≥ 2.0)
- PDL::Fit::LM
- PDL::NiceSlice
- PDL::Graphics::Gnuplot (optional, for plotting)
SEE ALSO
Physics::Ellipsometry::VASE::TMM, Physics::Ellipsometry::VASE::Dispersion, Physics::Ellipsometry::VASE::EMA, Physics::Ellipsometry::VASE::Materials, Physics::Ellipsometry::VASE::Parameter, Physics::Ellipsometry::VASE::Optimizer
PDL, PDL::Fit::LM, PDL::Graphics::Gnuplot
H. Fujiwara, Spectroscopic Ellipsometry: Principles and Applications, John Wiley & Sons, 2007.
G.E. Jellison and F.A. Modine, "Parameterization of the optical functions of amorphous materials in the interband region", Appl. Phys. Lett. 69, 371 (1996).
AUTHOR
Jovan Trujillo <jtrujil1 at asu.edu>
LICENSE AND COPYRIGHT
Copyright 2026 Jovan Trujillo.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. See https://dev.perl.org/licenses/ for details.