Skip to content

Commit 370e67e

Browse files
authored
Merge pull request #366 from ptiede/ptiede-singletime
Push fix
2 parents b9fd00e + a397209 commit 370e67e

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

src/instrument/model.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -195,8 +195,8 @@ function _construct_baselinemap(T, F, bl, x::SiteArray)
195195
i2 = findall(x->(tx[1])&&(x[2]==s2), tsf)
196196
length(i1) > 1 && throw(AssertionError("Multiple indices found for $t, $((s1)) in SiteArray"))
197197
length(i2) > 1 && throw(AssertionError("Multiple indices found for $t, $((s2)) in SiteArray"))
198-
isnothing(i1) && throw(AssertionError("$t, $f, $((s1)) not found in SiteArray"))
199-
isnothing(i2) && throw(AssertionError("$t, $f, $((s2)) not found in SiteArray"))
198+
(isnothing(i1) | isempty(i1)) && throw(AssertionError("$t, $f, $((s1)) not found in SiteArray"))
199+
(isnothing(i2) | isempty(i2)) && throw(AssertionError("$t, $f, $((s2)) not found in SiteArray"))
200200
ind1[i] = i1[begin]
201201
ind2[i] = i2[begin]
202202
end

src/instrument/priors/segmentation.jl

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,12 @@ function timestamps(::IntegSeg, array)
6464
mjd = array.mjd
6565

6666
# TODO build in the dt into the data format
67-
dt = minimum(diff(ts))
67+
if length(ts) <= 1
68+
# arbritrarily set the dt to 1
69+
dt = 1/3600
70+
else
71+
dt = minimum(diff(ts))
72+
end
6873
return IntegrationTime.(mjd, ts, dt)
6974
end
7075

@@ -74,7 +79,9 @@ function timestamps(::TrackSeg, array)
7479

7580
tstart, tend = extrema(array[:Ti])
7681
dt = tend - tstart
77-
82+
if iszero(dt)
83+
dt = 1/3600
84+
end
7885
# TODO build in the dt into the data format
7986
return (IntegrationTime(mjd, (tend-tstart)/2 + tstart, dt),)
8087
end

0 commit comments

Comments
 (0)