Skip to content

Commit

Permalink
Merge pull request #552 from R-Lum/issue_551
Browse files Browse the repository at this point in the history
Plot the natural curve for extrapolation also in the negative quadrant
  • Loading branch information
RLumSK authored Dec 26, 2024
2 parents b05ebc6 + 42deebd commit 0aaeac6
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
4 changes: 4 additions & 0 deletions NEWS.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,10 @@ speed boost. The default setting can be overridden via the `rprime` argument
use to find a good starting point failed: in such cases, we try again using
the simulated fit (#549, fixed in #500; thanks to @SalOehl for reporting and
providing data to reproduce the error).
* The natural/simulated curve was not plotted in the negative quadrant for
`mode = "extrapolation"`, which made it harder to see where it extrapolated
to (#551, fixed in #552; thanks to @SalOehl for reporting).


### `calc_IEU()`
* The code of this function has been consolidated to avoid duplication and
Expand Down
4 changes: 4 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,10 @@
model we use to find a good starting point failed: in such cases, we
try again using the simulated fit (#549, fixed in \#500; thanks to
@SalOehl for reporting and providing data to reproduce the error).
- The natural/simulated curve was not plotted in the negative quadrant
for `mode = "extrapolation"`, which made it harder to see where it
extrapolated to (#551, fixed in \#552; thanks to @SalOehl for
reporting).

### `calc_IEU()`

Expand Down
9 changes: 7 additions & 2 deletions R/calc_Huntley2006.R
Original file line number Diff line number Diff line change
Expand Up @@ -866,9 +866,14 @@ calc_Huntley2006 <- function(
col = adjustcolor("grey", alpha.f = 0.5), border = NA)

## add simulated curve -------
xNew <- seq(if (mode_is_extrapolation) par()$usr[1] else 0,
par()$usr[2], length.out = 200)
yNew <- predict(GC.simulated@data$Fit, list(x = xNew))
if (normalise)
yNew <- yNew / A
points(
x = natdosetimeGray,
y = LxTx_simulated$LxTx,
x = xNew,
y = yNew,
type = "l",
lty = 3)

Expand Down

0 comments on commit 0aaeac6

Please sign in to comment.