Physics-Ellipsometry-VASE

 view release on metacpan or  search on metacpan

README.md  view on Meta::CPAN


## Description

Physics::Ellipsometry::VASE provides a framework for fitting optical thin-film
models to VASE data using the Levenberg-Marquardt algorithm.  It handles:

- **Data loading** — simple whitespace-delimited files and native J.A. Woollam
  VASE instrument format (auto-detected)
- **Weighted fitting** — uses measured uncertainties (sigma) from Woollam files
- **Numerical Jacobian** — automatic relative-step finite differences
- **Plotting** — multi-angle color-coded overlays via PDL::Graphics::Gnuplot

## Installation

From CPAN:

```bash
cpanm Physics::Ellipsometry::VASE
```

From source:

lib/Physics/Ellipsometry/VASE.pm  view on Meta::CPAN

        {Maxiter => 300, Eps => 1e-7}
    );

    $self->{covar} = $covar;
    $self->{iters} = $iters;
    $self->{ym}    = $ym;

    return $finalp;
}

# Plot raw data with model fit overlay
sub plot {
    my ($self, $fit_params, %opts) = @_;
    require PDL::Graphics::Gnuplot;

    my $data  = $self->{data};
    my $model = $self->{model};

    my $wavelength = $data->((0),:)->flat;
    my $angles     = $data->((1),:)->flat;
    my $psi_data   = $data->((2),:)->flat;

lib/Physics/Ellipsometry/VASE.pm  view on Meta::CPAN

=item *

Automatic numerical Jacobian computation via relative-step finite differences.

=item *

Weighted fitting using measured uncertainties (sigma columns in Woollam files).

=item *

Multi-angle plotting of data and fit overlays via L<PDL::Graphics::Gnuplot>.

=back

=head1 CONSTRUCTOR

=head2 new

    my $vase = Physics::Ellipsometry::VASE->new(%args);

Creates a new VASE analysis object.

lib/Physics/Ellipsometry/VASE.pm  view on Meta::CPAN


Performs Levenberg-Marquardt fitting.  C<$initial_params> is a PDL
piddle of initial guesses.  Returns a PDL piddle of fitted parameters.

=head2 plot

    $vase->plot($fit_params);
    $vase->plot($fit_params, output => 'fit.png');
    $vase->plot($fit_params, output => 'fit.pdf', title => 'My Fit');

Plots raw data points with model fit overlay in a two-panel layout
(Psi on top, Delta on bottom).  Requires L<PDL::Graphics::Gnuplot>.

Options:

=over 4

=item output

File path for saving the plot.  Format is inferred from the extension
(C<.png>, C<.pdf>, C<.svg>, C<.eps>).  If omitted, displays an



( run in 2.371 seconds using v1.01-cache-2.11-cpan-39bf76dae61 )