Skip to content

Commit

Permalink
Small bug fix to prevent SO
Browse files Browse the repository at this point in the history
  • Loading branch information
ptiede committed Dec 16, 2024
1 parent 7d5946b commit c5b1085
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/instrument/instrument.jl
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,11 @@ struct IntegrationTime{T}
dt::T
end

mjd(ts::IntegrationTime) = ts.mjd
Base.in(t::Number, ts::IntegrationTime) = (ts.t0 - ts.dt/2) t < (ts.t0 + ts.dt/2)
Base.isless(t::IntegrationTime, ts::IntegrationTime) = t.t0 < ts.t0
Base.isless(s::Number, t::IntegrationTime) = s < (t.t0 - t.dt/2)
Base.isless(t::IntegrationTime, s::Number) = (t.t0 + t.dt/2) < s
mjd(ts::IntegrationTime) = ts.mjd
Base.in(t::IntegrationTime, ::Base.Colon) = true

_center(ts::IntegrationTime) = ts.t0
_region(ts::IntegrationTime) = ts.dt
Expand All @@ -25,13 +24,11 @@ struct FrequencyChannel{T, I<:Integer}
bandwidth::T
channel::I
end
Base.in(f::Number, fs::FrequencyChannel) = (fs.central-fs.bandwidth/2) f < (fs.central+fs.bandwidth/2)
channel(fs::FrequencyChannel) = fs.channel
Base.in(f::Number, fs::FrequencyChannel) = (fs.central-fs.bandwidth/2) f < (fs.central+fs.bandwidth/2)
Base.isless(t::FrequencyChannel, ts::FrequencyChannel) = _center(t) < _center(ts)
Base.isless(s::Number, t::FrequencyChannel) = s < (_center(t) - _region(t)/2)
Base.isless(t::FrequencyChannel, s::Number) = (_center(t) + _region(t)/2) < s
Base.in(x, t::FrequencyChannel) = in(t, x)
Base.in(t::FrequencyChannel, ::Base.Colon) = true



Expand Down

0 comments on commit c5b1085

Please sign in to comment.