Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

@function spliceCorrection #69

Open
georgejr45 opened this issue Sep 3, 2024 · 2 comments
Open

@function spliceCorrection #69

georgejr45 opened this issue Sep 3, 2024 · 2 comments

Comments

@georgejr45
Copy link

georgejr45 commented Sep 3, 2024

Hi,
I have used spliceCorrection function on my ASD file and came across this following questions,
what length should someone expect for the param "wav" ?
What is the possibilities of an error if the value of "wav" is of different length than that of "x" ?

Yours,
Methun George

@sneumann
Copy link

sneumann commented Sep 3, 2024

Hi, this is mainly a question to improve the documentation.
After some experimenting we got the expected results when length(wav)==length(X), but didn't get an error with length(wav)==2 (i.e. c(minwav,maxwav). Docs could mention that 1) X is the intensity values, 2) wav the corresponding wavelengths.
Maybe throw a warning if length(wav)!=length(X) or length(wav)!=nrow(X), unless there might be (documented) reasons. Yours, Steffen

l-ramirez-lopez added a commit that referenced this issue Sep 4, 2024
l-ramirez-lopez added a commit that referenced this issue Sep 4, 2024
l-ramirez-lopez added a commit that referenced this issue Sep 4, 2024
@l-ramirez-lopez
Copy link
Owner

Hello @sneumann @georgejr45
Thanks for the suggestions, I have made some modifications to the documentation for the upcoming version (0.2.8, see https://github.com/l-ramirez-lopez/prospectr/tree/v0.2.8)
Could you please give me a reproducible example where the function accepts length(wav)==2 for a spectral marix or vector with 3 or more wavelengths?

For example, imagine I have a splice problem at the wavelengh 1200 nm:

data("NIRsoil")
spliceCorrection(NIRsoil$spc, wav = c(1300, 1500), splice = c(1200))

As the wavelengths are wrong, from the above example I expect the error:
Error in spliceCorrection(NIRsoil$spc, wav = c(1300, 1500), splice = c(1200)) : length(wav) must be equal to ncol(X)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants