R-Lum / RLumModel

Compare 03e573f ... +4 ... 6909863

No flags found

Use flags to group coverage reports by test type, project and/or folders.
Then setup custom commit statuses and notifications for each flag.

e.g., #unittest #integration

#production #enterprise

#frontend #backend

Learn more about Codecov Flags here.


@@ -17,7 +17,7 @@
Loading
17 17
#' \code{\link{plot.default}}. See details for further information
18 18
#'
19 19
#' @return This function returns an RLum.Results object from the illumination simulation.
20 -
#' 
20 +
#'
21 21
#' @section Function version: 0.1.1
22 22
#'
23 23
#' @author Johannes Friedrich, University of Bayreuth (Germany),
@@ -41,8 +41,7 @@
Loading
41 41
){
42 42
43 43
# check input arguments ---------------------------------------------------
44 -
45 -
  ##check if temperature is > 0 K (-273 degree celsius)
44 +
  ##check if temperature is > 0 K (-273 degree Celsius)
46 45
  if(temp < -273){
47 46
    stop("\n [.simulate_illumination()] Argument 'temp' has to be > 0 K!")
48 47
  }
@@ -72,7 +71,6 @@
Loading
72 71
  # P: Photonflux (in Bailey 2002/2004: wavelength [nm]) = 1
73 72
  # b: heating rate [deg. C/s] = 0
74 73
  ##============================================================================##
75 -
76 74
  if(parms$model == "Bailey2004" || parms$model == "Bailey2002"){
77 75
    P <- 0.02/(1.6*10^(-19)*(1240/470))*(optical_power/100)
78 76
  }
@@ -96,7 +94,7 @@
Loading
96 94
    times = times,
97 95
    parms = parms))
98 96
  ##============================================================================##
99 -
  # SOLVING ODE (deSolve requiered)
97 +
  # SOLVING ODE (deSolve required)
100 98
  ##============================================================================##
101 99
  out <- deSolve::ode(y = n, times = times, parms = parameters.step, func = .set_ODE_Rcpp, rtol=1e-3, atol=1e-3, maxsteps=1e5, method = "bdf")
102 100
  ##============================================================================##

@@ -12,7 +12,7 @@
Loading
12 12
#' \bold{A}: conduction band to electron/hole trap transition probability in s^(-1)
13 13
#' \bold{B}: valence band to hole trap transition probability in s^(-1)
14 14
#' \bold{Th}: photo-ionisation cross-section in s^(-1)
15 -
#' \bold{E_th}: `thermal assistance' energy in eV
15 +
#' \bold{E_th}: thermal assistance energy in (eV)
16 16
#' \bold{n}: concentrations of electron/hole traps after sample history in cm^(-3)
17 17
#'
18 18
#' @note \bold{n} are the saved concentrations of the last step of the sample history
@@ -106,6 +106,39 @@
Loading
106 106
  # dimensionless constant (for Details see Wintle (1975))
107 107
  K <- 2.8e7
108 108
109 +
  ## add parameter names
110 +
  names <- c(
111 +
    N = "concentration of electron traps",
112 +
    E = "depth below conduction or valence band",
113 +
    s = "frequency factor",
114 +
    A = "transiation probability to conduction or valence band",
115 +
    B = "conduction band to hole centre transition probability",
116 +
    Th = "photo-ionisation cross-section ",
117 +
    E_th = "thermal assistance energy",
118 +
    n = "concentration of trapped charges",
119 +
    k_B = "Boltzmann constant",
120 +
    W = "activation energy",
121 +
    K = "dimensionlss constant after Wintle (1975)")
122 +
123 +
  ## add units
124 +
  units <- c(
125 +
    N = "cm^-3",
126 +
    E = "eV",
127 +
    s = "s^-1",
128 +
    A = "cm^3 s^-1",
129 +
    B = "cm^3 s^-1",
130 +
    Th = "s^-1",
131 +
    E_th = "eV",
132 +
    n = "cm^-3",
133 +
    k_B = "eV K^-1",
134 +
    W = "eV",
135 +
    K = "")
136 +
137 +
  ## to enter a new model, the structure is as follows:
138 +
  ## First numbers all related to electron traps if B = 0
139 +
  ## Followed by parameters for the recombination centres
140 +
  ## Th and E_th refer to traps only
141 +
  ## n: first traps, then recombination centres, then n_c then n_v
109 142
  parameter.list = list(
110 143
    Bailey2001 = list(
111 144
      N = c(1.5e7, 1e7, 1e9, 2.5e8, 5e10, 3e8, 1e10, 5e9, 1e11),
@@ -122,6 +155,8 @@
Loading
122 155
      k_B = k_B,
123 156
      W = W,
124 157
      K = K,
158 +
      units  = units,
159 +
      names = names,
125 160
      model = model
126 161
      ),
127 162
@@ -141,6 +176,8 @@
Loading
141 176
      k_B = k_B,
142 177
      W = W,
143 178
      K = K,
179 +
      units  = units,
180 +
      names = names,
144 181
      model = model
145 182
    ),
146 183
@@ -160,6 +197,8 @@
Loading
160 197
      k_B = k_B,
161 198
      W = W,
162 199
      K = K,
200 +
      units  = units,
201 +
      names = names,
163 202
      model = model
164 203
    ),
165 204
@@ -178,6 +217,8 @@
Loading
178 217
      k_B = k_B,
179 218
      W = W,
180 219
      K = K,
220 +
      units  = units,
221 +
      names = names,
181 222
      model = model
182 223
    ),
183 224
@@ -197,6 +238,8 @@
Loading
197 238
      k_B = k_B,
198 239
      W = W,
199 240
      K = K,
241 +
      units  = units,
242 +
      names = names,
200 243
      model = model
201 244
    ),
202 245
@@ -215,6 +258,8 @@
Loading
215 258
      k_B = k_B,
216 259
      K = K,
217 260
      W = W,
261 +
      units  = units,
262 +
      names = names,
218 263
      model = model
219 264
    ),
220 265
@@ -233,6 +278,8 @@
Loading
233 278
      k_B = k_B,
234 279
      K = K,
235 280
      W = W,
281 +
      units  = units,
282 +
      names = names,
236 283
      model = model
237 284
    ),
238 285
@@ -242,6 +289,8 @@
Loading
242 289
      k_B = k_B,
243 290
      W = W,
244 291
      K = K,
292 +
      units  = units,
293 +
      names = names,
245 294
      model = model
246 295
    ),
247 296
@@ -251,10 +300,13 @@
Loading
251 300
      k_B = k_B,
252 301
      W = W,
253 302
      K = K,
303 +
      units  = units,
304 +
      names = names,
254 305
      model = model
255 306
    )
256 307
  )
257 308
309 +
258 310
  switch(model,
259 311
        "Bailey2001" = {
260 312
          return(parameter.list$Bailey2001)

@@ -581,16 +581,13 @@
Loading
581 581
        start_temp <- ifelse(is.null(own_start_temperature), 20, own_start_temperature)
582 582
583 583
        if(!is.null(own_state_parameters)){ ## state parameters submitted
584 -
585 584
          own_state_parameters <- c(own_state_parameters, 0, 0)
586 -
587 585
          n <- Luminescence::set_RLum(class = "RLum.Results",
588 586
                                      data = list(n = own_state_parameters,
589 587
                                                  temp = start_temp,
590 588
                                                  model = model))
591 589
592 590
        } else { ## no state parameters submitted
593 -
594 591
          n <- Luminescence::set_RLum(class = "RLum.Results",
595 592
                                      data = list(n = rep(0,length(parms$N)+2),
596 593
                                                  temp = start_temp,
@@ -636,9 +633,7 @@
Loading
636 633
637 634
638 635
# Plot settings -------------------------------------------------------------------------------
639 -
640 636
  if(plot){
641 -
642 637
    plot.data <- get_RLum(model.output,
643 638
                          recordType = c("RF$", "TL$", "OSL$", "LM-OSL$", "RF_heating$", "pause$"),
644 639
                          drop = FALSE)

@@ -1,7 +1,7 @@
Loading
1 1
//set_ODE_Rcpp.cpp
2 2
//author: Johannes Friedrich, University of Bayreuth (Germany)
3 3
//version: 0.1.1 [2016-04-04]
4 -
//Function calculates the ODEs for all quartz luminescence models iterativly
4 +
//Function calculates the ODEs for all quartz luminescence models iteratively
5 5
//
6 6
7 7
@@ -13,7 +13,6 @@
Loading
13 13
List set_ODE_Rcpp(double t, arma::vec n, Rcpp::List parameters) {
14 14
15 15
  //unpack parameters for ODEs
16 -
17 16
  arma::vec N = parameters["N"];
18 17
  arma::vec E = parameters["E"];
19 18
  arma::vec s = parameters["s"];
@@ -34,7 +33,7 @@
Loading
34 33
 int j = 0;
35 34
 int jj = 0;
36 35
 for (std::size_t i = 0; i < N.size(); ++i){
37 -
   if (B[i] == 0)    {//use recombination propability of recombination centers to identify electron traps, because they had no recombination propability to recomibnation centers from conduction band
36 +
   if (B[i] == 0)    {//use recombination probability of recombination centers to identify electron traps, because they had no recombination probability to recombination centers from conduction band
38 37
     j++;
39 38
     jj++;
40 39
@@ -46,7 +45,6 @@
Loading
46 45
 }
47 46
48 47
  //build sub-vectors for conduction/valence band calculation
49 -
  
50 48
  arma::vec temp_dn1 = dn.subvec(0,j-1);
51 49
  arma::vec temp_dn2 = dn.subvec(j,jj-1);
52 50

@@ -60,7 +60,7 @@
Loading
60 60
  ##### check temperature differences between different steps ####
61 61
62 62
  #check if temperatures of step before is lower than current sequence step and if step is not PH or CH
63 -
  #automatically heat to temperatrue of current sequence step
63 +
  #automatically heat to temperature of current sequence step
64 64
65 65
  #check if "temp" or "temp_begin" (only for TL) is part of the sequence, if not, the first entry in sequence is temp (per definition)
66 66
  if(!"temp" %in% names(sequence[[i]]) && !"temp_begin" %in% names(sequence[[i]])) {names(sequence[[i]])[1] <- "temp"}
@@ -69,7 +69,7 @@
Loading
69 69
  if("temp_begin" %in% names(sequence[[i]])) {sequence[[i]]["temp"] <- sequence[[i]]["temp_begin"]}
70 70
71 71
  #check if temperature is higher than the step before
72 -
  #automatically heat to temperatrue of current sequence step, except stepname is "PH" or "CH"
72 +
  #automatically heat to temperature of current sequence step, except stepname is "PH" or "CH"
73 73
  if(((n$temp < sequence[[i]]["temp"])&&(names(sequence)[i] != "PH")&&(names(sequence)[i] != "CH")) == TRUE){
74 74
    n <- .simulate_heating(temp_begin = n$temp,temp_end = sequence[[i]]["temp"], heating_rate = 1, n, parms)
75 75
@@ -362,7 +362,7 @@
Loading
362 362
363 363
    output.model <- c(output.model, n$RF_heating.data, n$concentrations)
364 364
365 -
    ##pause to releax
365 +
    ##pause to relax
366 366
    n <- .simulate_pause(temp = sequence[[i]]["temp_end"], duration = 5, n = n, parms = parms)
367 367
368 368
    ##collect originators

Everything is accounted for!

No changes detected that need to be reviewed.
What changes does Codecov check for?
Lines, not adjusted in diff, that have changed coverage data.
Files that introduced coverage data that had none before.
Files that have missing coverage data that once were tracked.
Files Coverage
calc_concentrations.R 100.00%
calc_signal.R 100.00%
create_DRT.sequence.R 100.00%
create_SAR.sequence.R 100.00%
extract_pars.R 100.00%
model_LuminescenceSignals.R 96.00%
read_SEQ2R.R 63.25%
set_pars.R 100.00%
simulate_CW_OSL.R 97.67%
simulate_LM_OSL.R 100.00%
simulate_RF.R 100.00%
simulate_RF_and_heating.R 98.00%
simulate_TL.R 100.00%
simulate_heating.R 100.00%
simulate_illumination.R 100.00%
simulate_irradiation.R 94.74%
simulate_pause.R 100.00%
translate_sequence.R 78.57%
Folder Totals (18 files) 91.92%
Project Totals (20 files) 92.35%
Loading