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

analyse_FadingMeasurement() - plot output of luminescence curves messed up #589

Closed
RLumSK opened this issue Feb 28, 2025 · 3 comments · Fixed by #591
Closed

analyse_FadingMeasurement() - plot output of luminescence curves messed up #589

RLumSK opened this issue Feb 28, 2025 · 3 comments · Fixed by #591
Assignees
Labels
bug (regression) Bug introduced with a recent add or fix
Milestone

Comments

@RLumSK
Copy link
Member

RLumSK commented Feb 28, 2025

Describe the bug
If the dataset has luminescence curves, they will be shown as part of a
2 x 2 panel plot.

Please add a minimalistic reproducible example

library(Luminescence)

l <- list()
time <- 0
set.seed(0)
for(x in runif(3, 120,130)) {
  ## set irr
  irr  <-
    set_RLum(
      "RLum.Data.Curve",
      data = matrix(c(1:x, rep(1,x)), ncol = 2),
      originator = "read_XSYG2R",
      recordType = "irradiation (NA)",
      curveType = "simulated",
      info = list(
        startDate = format(Sys.time() + time, "%Y%m%d%H%M%S"),
        position = 1)
    )
  
  ## set lum
  lum  <-
    set_RLum(
      "RLum.Data.Curve",
      data = matrix(c(1:40, exp(-c(1:40)/ x * 10)), ncol = 2),
      originator = "read_XSYG2R",
      recordType = "IRSL",
      curveType = "measured",
      info = list(
        startDate = format(Sys.time() + time + x + 30, "%Y%m%d%H%M%S"),
        position = 1)
    )
  
  time <- time + x + 60
  l <- c(l, irr, lum)
  
}

object <- set_RLum("RLum.Analysis", records = l, originator = "read_XSYG2R")

analyse_FadingMeasurement(
  object,
  signal.integral = 1:2,
  background.integral = 10:40,
  structure = "Lx"
)

Expected behaviour
Something is reset in the par() settings resulting in the current behaviour.

Screenshots

Image

Session info

R Under development (unstable) (2025-02-23 r87804)
Platform: aarch64-apple-darwin20
Running under: macOS Sequoia 15.3.1

Matrix products: default
BLAS:   /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib 
LAPACK: /Library/Frameworks/R.framework/Versions/4.5-arm64/Resources/lib/libRlapack.dylib;  LAPACK version 3.12.0

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

time zone: Europe/Berlin
tzcode source: internal

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] Luminescence_1.0.0.9000-13

loaded via a namespace (and not attached):
[1] compiler_4.5.0         tools_4.5.0            RcppArmadillo_14.2.3-1 Rcpp_1.0.14           
[5] minpack.lm_1.2-4       data.table_1.17.0      tiff_0.1-12            matrixStats_1.5.0     
[9] XML_3.99-0.18     
@RLumSK RLumSK added the bug (regression) Bug introduced with a recent add or fix label Feb 28, 2025
@RLumSK RLumSK added this to the v1.1.0 milestone Feb 28, 2025
@mcol
Copy link
Contributor

mcol commented Feb 28, 2025

I get this output:
Image

@RLumSK
Copy link
Member Author

RLumSK commented Feb 28, 2025

@mcol You are right, this are in essence two plot windows. The first one is likely overwritten in your case. Therefore you get only three panel (with plots) instead of four. My screenshot shows the panel you are missing.

@mcol
Copy link
Contributor

mcol commented Feb 28, 2025

A bisection points to 9f5a918 as the culprit. Indeed, there were some changes to par() that may need to be undone.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug (regression) Bug introduced with a recent add or fix
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants