# \[ANN\] Spectra.jl: new major release!

**URL:** <https://discourse.julialang.org/t/ann-spectra-jl-new-major-release/128396>\
**Category:** Package Announcements\
**Tags:** package, announcement\
**Created:** [April 25, 2025, 11:40am UTC](https://discourse.julialang.org/t/ann-spectra-jl-new-major-release/128396 "2025-04-25T11:40:47Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![charlesll](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/charlesll/32/3255_2.png) [@charlesll](https://discourse.julialang.org/u/charlesll)\
**Post date:** [April 25, 2025, 11:40am UTC](https://discourse.julialang.org/t/ann-spectra-jl-new-major-release/128396/1 "2025-04-25T11:40:48Z")

</div>

Spectra.jl version 2.0.1 is just out!

Spectra.jl is a package aimed at helping spectroscopic (Raman, Infrared, Nuclear Magnetic Resonance, XAS…) data treatment under Julia. The aim is to provide a simplest way to perform actions like smoothing, baseline fitting and removal, or peak fitting for instance.

v2.0 is a major re-write of the version 1.0, which was honestly not in great shape and needed a full revision. This is why we have a new major release.

Please check it out, I hope you will enjoy it!

## Improvements

- baseline() was a wrapper of the Python rampy.baseline function. This created problems. This is now using only Julia code.
- smooth() entirely re-written using Julia deps and code (leveraging in particular DSP.jl and SavitskyGolay.jl)
- The API of nearly all functions was improved, to allow various forms of inputs (multiple dispatch).
- docstrings and docs revised in depth. Docs are generated by Documenter.jl, examples by Literate.jl.

## Additions

- gaussian(), lorentzian(), pseudovoigt(): peak shapes
- fit\_peaks() : fit a signal with a sum of peaks.
- FitContext : struct for the context of a fit
- FitResult : struct for the results of a fit
- prepare\_context() : type to prepares the context of a fit
- print\_params() : print parameters after a fit
- plot\_fit() : plot parameters after a fit
- get\_peak\_results() : transform a vector of parameters in to a vector of Named Tuples describing each peak parameters
- fit\_qNewton() : quasi-Newton algorithm for the fit
- fit\_Optim() : IPNewton fit with Optim.jl
- bootstrap() : performs a bootstrapping analysis to get uncertainty estimates on peak parameters.
- create\_peaks(): generate peaks.
- find\_peaks(): detects peaks.
- area\_peaks(): measure peak areas, replace bandarea().
- correct\_xshift(): returns the signal(s) corrected from a given linear `shift`.
- baseline functions in Julia: arPLS\_baseline, drPLS\_baseline, als\_baseline, rubberband\_baseline.
- extract\_signal(): replace get\_portion\_interest().
- invcm\_to\_nm(), nm\_to\_invcm(): allow conversion of the X axis from nm to inverse cm, or the opposite.

## Modifications

- pearson7(): API changed to match that of gaussian(), lorentzian(), pseudovoigt()

## Removed functions

- bandarea(): replaced by area\_peaks(). Moved to src/legacy\_code.jl
- xshift\_correction(): replaced by correct\_xshift(). moved to src/legacy\_code.jl
- xshift\_inversion(): no need. moved to src/legacy\_code.jl
- pseudovoigts(), gaussiennes(), lorentziennes() API do not really make sense now that we have create\_peaks, so those are removed. moved to src/legacy\_code.jl. Use create\_peaks().
- bootperf(): removed as it is not compatible with the new API and dependencies. A better function will be added in an upcoming version. Moved to src/legacy\_code.jl
