Skip to content

Commit 605aca4

Browse files
committed
Only consider youngest max age and oldest min age (in addition to any two-sided constraints) when setting runaway bounds
1 parent 85cb5dc commit 605aca4

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

src/StratMetropolis.jl

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
if bounding>0
5353
# If bounding is requested, add extrapolated top and bottom bounds to avoid
5454
# issues with the stratigraphic markov chain wandering off to +/- infinity
55-
(youngest, oldest) = extrema(Age)
55+
(youngest, oldest) = nanextrema([nanminimum(Age[Age_Sidedness .== -1]); Age[Age_Sidedness .== 0]; nanmaximum(Age[Age_Sidedness .== 1])])
5656
dt_dH = (oldest-youngest)/(top-bottom)
5757
offset = round((top-bottom)*bounding/resolution)*resolution
5858
Age = [oldest + offset*dt_dH; Age; youngest - offset*dt_dH]
@@ -116,7 +116,7 @@
116116
if bounding>0
117117
# If bounding is requested, add extrapolated top and bottom bounds to avoid
118118
# issues with the stratigraphic markov chain wandering off to +/- infinity
119-
(youngest, oldest) = extrema(Age)
119+
(youngest, oldest) = nanextrema([nanminimum(Age[Age_Sidedness .== -1]); Age[Age_Sidedness .== 0]; nanmaximum(Age[Age_Sidedness .== 1])])
120120
dt_dH = (oldest-youngest)/(top-bottom)
121121
offset = round((top-bottom)*bounding/resolution)*resolution
122122
Age = [oldest + offset*dt_dH; Age; youngest - offset*dt_dH]
@@ -332,7 +332,7 @@
332332
if bounding>0
333333
# If bounding is requested, add extrapolated top and bottom bounds to avoid
334334
# issues with the stratigraphic markov chain wandering off to +/- infinity
335-
(youngest, oldest) = extrema(Age)
335+
(youngest, oldest) = nanextrema([nanminimum(Age[Age_Sidedness .== -1]); Age[Age_Sidedness .== 0]; nanmaximum(Age[Age_Sidedness .== 1])])
336336
dt_dH = (oldest-youngest)/(top-bottom)
337337
offset = round((top-bottom)*bounding/resolution)*resolution
338338
Age = [oldest + offset*dt_dH; Age; youngest - offset*dt_dH]
@@ -400,7 +400,7 @@
400400
if bounding>0
401401
# If bounding is requested, add extrapolated top and bottom bounds to avoid
402402
# issues with the stratigraphic markov chain wandering off to +/- infinity
403-
(youngest, oldest) = extrema(Age)
403+
(youngest, oldest) = nanextrema([nanminimum(Age[Age_Sidedness .== -1]); Age[Age_Sidedness .== 0]; nanmaximum(Age[Age_Sidedness .== 1])])
404404
dt_dH = (oldest-youngest)/(top-bottom)
405405
offset = round((top-bottom)*bounding/resolution)*resolution
406406
Age = [oldest + offset*dt_dH; Age; youngest - offset*dt_dH]
@@ -491,7 +491,7 @@
491491
if bounding>0
492492
# If bounding is requested, add extrapolated top and bottom bounds to avoid
493493
# issues with the stratigraphic markov chain wandering off to +/- infinity
494-
(youngest, oldest) = extrema(Age)
494+
(youngest, oldest) = nanextrema([nanminimum(Age[Age_Sidedness .== -1]); Age[Age_Sidedness .== 0]; nanmaximum(Age[Age_Sidedness .== 1])])
495495
dt_dH = (oldest-youngest)/(top-bottom)
496496
offset = round((top-bottom)*bounding/resolution)*resolution
497497
Age = [oldest + offset*dt_dH; Age; youngest - offset*dt_dH]
@@ -559,7 +559,7 @@
559559
if bounding>0
560560
# If bounding is requested, add extrapolated top and bottom bounds to avoid
561561
# issues with the stratigraphic markov chain wandering off to +/- infinity
562-
(youngest, oldest) = extrema(Age)
562+
(youngest, oldest) = nanextrema([nanminimum(Age[Age_Sidedness .== -1]); Age[Age_Sidedness .== 0]; nanmaximum(Age[Age_Sidedness .== 1])])
563563
dt_dH = (oldest-youngest)/(top-bottom)
564564
offset = round((top-bottom)*bounding/resolution)*resolution
565565
Age = [oldest + offset*dt_dH; Age; youngest - offset*dt_dH]

0 commit comments

Comments
 (0)