User API

IO

oospectro.io.load_spectrum(spectrum_path, lambda_min=100, lambda_max=1000)[source]

Load a spectrum file.

Parameters:
spectrum_path : string

File path.

lambda_min : scalar, optional

Cut the data at this minimum wavelength in nm.

lambda_max : scalar, optional

Cut the data at this maximum wavelength in nm.

Returns:
values : arrays

(lamdbas, intensities)

Thickness

oospectro.thickness.thickness_from_minmax(lambdas, intensities, refractive_index=1.0, min_peak_prominence=0.01, method='linreg', debug=False)[source]

Return the thickness from a min-max detection.

Parameters:
lambdas : array

Wavelength values in nm.

intensities : array

Intensity values.

refractive_index : scalar, optional

Value of the refractive index of the media.

min_peak_prominence : scalar, optional

Required prominence of peaks.

method : string

Either ‘linreg’ for linear regression or ‘ransac’ for Randon Sampling Consensus.

debug : boolean

Show plots of peak detection and lin regression.

Returns:
thickness : scalar

Thickness value in nm.