h2020charisma / ramanchada2

A library for Raman spectroscopy harmonization
https://h2020charisma.github.io/ramanchada2/
MIT License
4 stars 3 forks source link

more spectrum filters: resample filter , L2 norm for normalization #146

Closed vedina closed 1 month ago

vedina commented 2 months ago

wish list

        spline = Akima1DInterpolator(spe.x, spe.y)
        y = np.zeros_like(target_x)
        within_range = (self.x4search >= spe.x.min()) & (self.x4search <= spe.x.max())
       # interpolation only zeroes otherwise
        y[within_range] = spline(target_x[within_range])
        spe_spline = rc2.spectrum.Spectrum(x=target_x,y=y)
vedina commented 1 month ago

Please make sure that splines are not extrapolated beyond original spectrum range - as in the code example above