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

crash in plot_DetPlot() iwth analyse_function = "analyse_pIRIRSequence" #210

Closed
mcol opened this issue Sep 6, 2024 · 2 comments
Closed

Comments

@mcol
Copy link
Contributor

mcol commented Sep 6, 2024

This crashes:

data(ExampleData.BINfileData, envir = environment())
object <- Risoe.BINfileData2RLum.Analysis(CWOSL.SAR.Data, pos = 1)

plot_DetPlot(
    object,
    method = "expansion",
    signal.integral.min = 1,
    signal.integral.max = 3,
    background.integral.min = 900,
    background.integral.max = 1000,
    analyse_function = "analyse_pIRIRSequence",
    analyse_function.control = list(
      fit.method = "LIN"),
    verbose = FALSE,
    n.channels = 2)

# Error in `levels<-`(`*tmp*`, value = as.character(levels)) : 
#   factor level [4] is duplicated

The error happens in this code inside analyse_SAR.CWOSL():

temp.LnLxTnTx <- data.frame(
Name = factor(x = temp.DoseName[,"Name"], levels = temp.DoseName[,"Name"]),
Repeated = as.logical(temp.DoseName[,"Repeated"]))

@mcol
Copy link
Contributor Author

mcol commented Sep 6, 2024

That error can be fixed using levels = unique(temp.DoseName[, "Name"]), but then the crash moves a bit forward:

Error : [plot_pIRIRSequence()] An error occurred, analysis skipped. Check your sequence!
In addition: Warning message:
[analyse_SAR.CWOSL()] 
[analyse_SAR.CWOSL()] Input OSL/IRSL curves are not a multiple of two.
... >> nothing was done here! 
Error : [plot_pIRIRSequence()] An error occurred, analysis skipped. Check your sequence!
In addition: Warning message:
[analyse_SAR.CWOSL()] 
[analyse_SAR.CWOSL()] Input OSL/IRSL curves are not a multiple of two.
... >> nothing was done here! 
Error in if (!is.na(pIRIR_signals[1])) df <- df[df$Signal == pIRIR_signals[i],  : 
  argument is of length zero
In addition: Warning message:
In merge_RLum(lapply(1:n.channels, function(x) { :
  [merge_RLum()] Nothing was merged as the object list was found to be empty or contains only one object!

When the merge fails because there are no valid results, we should stop rather than continuing.

@mcol
Copy link
Contributor Author

mcol commented Sep 9, 2024

Fixed by #211.

@mcol mcol closed this as completed Sep 9, 2024
@mcol mcol added this to the v0.9.25 (autumn CRAN release) milestone Sep 9, 2024
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

1 participant