Alpaga¶
The Alpaga code (AnaLyse en PolArisation de la Génération de second hArmonique) aims to analyse the SHG experimental acquisitions.

It first proposes a robust automatic procedure to extract the intensity of the Gaussian peak (here the SHG signal) from spectral measurements. This automatic procedure is explained here and follows these steps:
First it finds, in a given directory, the different files to analyse. More information are given in the File Management section.
Then, for each acquisition with the same physical parameters, it cleans and averages the numerous acquisitions. The ‘’cleaning’’ refers to the deletion of large non-physical spikes, such as “cosmic particles”. This procedure is explained in the Cleaning and Averaging Spectra along with a discussion about the acquisition time parameter.
Finally, this averaged spectrum is fitted by a Gaussian to extract the target intensity. Several options for this important step are available and explained in the section Fitting the Gaussian. This step is probably the one that leads to the largest numerical uncertainty, depending on the parameters chosen.
The full automated procedure is presented in the section Polarisation Procedure, along with the possible parameter values.
At Institut Lumière Matière (ILM), we use the code to analyse the results obtained from Surface Second Harmonic Generation (SSHG) experiments and Second Harmonic Scattering (SHS). Hence, we briefly present our formalism and analysis tool to extract from the cleaned data obtained in section Polarisation Procedure relevant properties regarding SHS and SSHG in the pages SHS analysis and SSHG analysis, respectively.

The installation procedure is straightforward and is explained in the Installation section. Section For Developers provides some general guidance regarding Git and how to update the code or wiki.
Finally, this wiki proposes some numerical (Python advice) and experimental (Experimental and procedure advice) advice. These are not typically found in articles, but perhaps in books or deep on the Internet. You may be able to find some (or all) from experienced scientists or our directors. If you want to expand these lists, please do not hesitate to contact us.
Contact Us¶
You can contact us using the github page or by e-mail at:
Licence¶
Alpaga is under the Lesser GPL v2.1 license.
Publications¶
To cite Alpaga, use the DOI: 10.5281/zenodo.5639392.
Here is a list of some useful references to understand Second Harmonic Generation in general: [1], [2], [3], [4], [5], [6], and [7].
Here is the list of scientific communications that have used Alpaga so far: [5], [8], [6], and [7].
The references are shown in the Reference page.
- Release:
1.2
- Date:
Aug 26, 2025