Module: IERS::EopParameter Private
- Included in:
- CelestialPoleOffset, LengthOfDay, PolarMotion, UT1
- Defined in:
- lib/iers/eop_parameter.rb
This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.
Constant Summary collapse
- FLAG_TO_QUALITY =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
{"I" => :observed, "P" => :predicted}.freeze
Instance Method Summary collapse
- #derive_quality(window, flag) ⇒ Object private
- #interpolate_field(window, query_mjd, method) ⇒ Object private
- #resolve(input, jd:, mjd:, interpolation:) ⇒ Object private
Instance Method Details
#derive_quality(window, flag) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
34 35 36 37 38 39 40 |
# File 'lib/iers/eop_parameter.rb', line 34 def derive_quality(window, flag) if window.any? { |e| e.public_send(flag) == "P" } :predicted else :observed end end |
#interpolate_field(window, query_mjd, method) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
24 25 26 27 28 29 30 31 32 |
# File 'lib/iers/eop_parameter.rb', line 24 def interpolate_field(window, query_mjd, method) xs = window.map(&:mjd) ys = window.map { |e| yield e } case method when :lagrange then Interpolation.lagrange(xs, ys, query_mjd) when :linear then Interpolation.linear(xs, ys, query_mjd) end end |
#resolve(input, jd:, mjd:, interpolation:) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/iers/eop_parameter.rb', line 8 def resolve(input, jd:, mjd:, interpolation:) query_mjd = TimeScale.to_mjd(input, jd: jd, mjd: mjd) entries = Data.finals_entries method = interpolation || IERS.configuration.interpolation window = case method when :lagrange order = IERS.configuration.lagrange_order EopLookup.window(entries, query_mjd, order: order) when :linear EopLookup.bracket(entries, query_mjd) end [query_mjd, window, method] end |