You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Aug 14, 2021. It is now read-only.
When doing a set reference, fix_spectra copies the values to the right x indices in the new spectrum but has two problems
y values that will be moved to x's outside the range after the shift are discarded. This can conceivably lose precious data that doesn't need to be lost.
y values from x's that originally lie outside the range and that the shift would bring into the range are left unchanged - giving realistic looking garbage
The second problem is the worst. Imagine that a spectrum needs to be shifted 7 array indices. Then the first seven and second seven indices will hold duplicate y values. This can throw off error standard-deviation estimation which uses the first 30 points.
A proposed fix
Initially, keep a different set of x-values for each spectrum. We can create this new set by adding the shift amount to each x value.
Then take the intersection of the ranges covered by the resulting x values as the new range. Choose the union for all spectra of all the x-values that fall in this range. These are the new x-values. For each spectrum, linearly interpolate the y-values at x values that were not directly measured and copy the rest.
The text was updated successfully, but these errors were encountered:
When doing a set reference, fix_spectra copies the values to the right x indices in the new spectrum but has two problems
The second problem is the worst. Imagine that a spectrum needs to be shifted 7 array indices. Then the first seven and second seven indices will hold duplicate y values. This can throw off error standard-deviation estimation which uses the first 30 points.
A proposed fix
Initially, keep a different set of x-values for each spectrum. We can create this new set by adding the shift amount to each x value.
Then take the intersection of the ranges covered by the resulting x values as the new range. Choose the union for all spectra of all the x-values that fall in this range. These are the new x-values. For each spectrum, linearly interpolate the y-values at x values that were not directly measured and copy the rest.
The text was updated successfully, but these errors were encountered: