Class: Korba::Tle
Instance Attribute Summary collapse
-
#arg_of_pericenter ⇒ Object
readonly
Returns the value of attribute arg_of_pericenter.
-
#bstar ⇒ Object
readonly
Returns the value of attribute bstar.
-
#classification_type ⇒ Object
readonly
Returns the value of attribute classification_type.
-
#eccentricity ⇒ Object
readonly
Returns the value of attribute eccentricity.
-
#element_set_no ⇒ Object
readonly
Returns the value of attribute element_set_no.
-
#element_set_record ⇒ Object
readonly
Returns the value of attribute element_set_record.
-
#epoch ⇒ Object
readonly
Returns the value of attribute epoch.
-
#epoch_datetime ⇒ Object
readonly
Returns the value of attribute epoch_datetime.
-
#epoch_days ⇒ Object
readonly
Returns the value of attribute epoch_days.
-
#inclination ⇒ Object
readonly
Returns the value of attribute inclination.
-
#julian_date ⇒ Object
readonly
Returns the value of attribute julian_date.
-
#mean_anomaly ⇒ Object
readonly
Returns the value of attribute mean_anomaly.
-
#mean_motion ⇒ Object
readonly
Returns the value of attribute mean_motion.
-
#mean_motion_ddot ⇒ Object
readonly
Returns the value of attribute mean_motion_ddot.
-
#mean_motion_dot ⇒ Object
readonly
Returns the value of attribute mean_motion_dot.
-
#object_id ⇒ Object
readonly
Returns the value of attribute object_id.
-
#object_name ⇒ Object
readonly
Returns the value of attribute object_name.
-
#ra_of_asc_node ⇒ Object
readonly
Returns the value of attribute ra_of_asc_node.
-
#revolution_number ⇒ Object
readonly
Returns the value of attribute revolution_number.
-
#satellite_number ⇒ Object
readonly
Returns the value of attribute satellite_number.
-
#tle_json ⇒ Object
readonly
Returns the value of attribute tle_json.
-
#tle_string ⇒ Object
readonly
Returns the value of attribute tle_string.
Instance Method Summary collapse
-
#initialize(tle = nil, type: :string) ⇒ Tle
constructor
A new instance of Tle.
- #propagate_to(minutesAfterEpoch) ⇒ Object
- #to_car ⇒ Object
- #to_kep ⇒ Object
Methods included from OrbitUtils
#deg_to_rad, #distance, #eccentric_anomaly, #height_at_apogee, #height_at_perigee, #normalize_deg, #normalize_rad, #path_angle, #rad_to_deg, #semi_major_axis, #true_anomaly, #velocity
Constructor Details
#initialize(tle = nil, type: :string) ⇒ Tle
13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/korba/tle.rb', line 13 def initialize(tle = nil, type: :string) return if tle.nil? case type when :string initialize_from_string(tle) when :json initialize_from_json(tle) end set_epoch_datetime_and_julian_date set_element_set_record_values end |
Instance Attribute Details
#arg_of_pericenter ⇒ Object (readonly)
Returns the value of attribute arg_of_pericenter.
8 9 10 |
# File 'lib/korba/tle.rb', line 8 def arg_of_pericenter @arg_of_pericenter end |
#bstar ⇒ Object (readonly)
Returns the value of attribute bstar.
8 9 10 |
# File 'lib/korba/tle.rb', line 8 def bstar @bstar end |
#classification_type ⇒ Object (readonly)
Returns the value of attribute classification_type.
8 9 10 |
# File 'lib/korba/tle.rb', line 8 def classification_type @classification_type end |
#eccentricity ⇒ Object (readonly)
Returns the value of attribute eccentricity.
8 9 10 |
# File 'lib/korba/tle.rb', line 8 def eccentricity @eccentricity end |
#element_set_no ⇒ Object (readonly)
Returns the value of attribute element_set_no.
8 9 10 |
# File 'lib/korba/tle.rb', line 8 def element_set_no @element_set_no end |
#element_set_record ⇒ Object (readonly)
Returns the value of attribute element_set_record.
8 9 10 |
# File 'lib/korba/tle.rb', line 8 def element_set_record @element_set_record end |
#epoch ⇒ Object (readonly)
Returns the value of attribute epoch.
8 9 10 |
# File 'lib/korba/tle.rb', line 8 def epoch @epoch end |
#epoch_datetime ⇒ Object (readonly)
Returns the value of attribute epoch_datetime.
8 9 10 |
# File 'lib/korba/tle.rb', line 8 def epoch_datetime @epoch_datetime end |
#epoch_days ⇒ Object (readonly)
Returns the value of attribute epoch_days.
8 9 10 |
# File 'lib/korba/tle.rb', line 8 def epoch_days @epoch_days end |
#inclination ⇒ Object (readonly)
Returns the value of attribute inclination.
8 9 10 |
# File 'lib/korba/tle.rb', line 8 def inclination @inclination end |
#julian_date ⇒ Object (readonly)
Returns the value of attribute julian_date.
8 9 10 |
# File 'lib/korba/tle.rb', line 8 def julian_date @julian_date end |
#mean_anomaly ⇒ Object (readonly)
Returns the value of attribute mean_anomaly.
8 9 10 |
# File 'lib/korba/tle.rb', line 8 def mean_anomaly @mean_anomaly end |
#mean_motion ⇒ Object (readonly)
Returns the value of attribute mean_motion.
8 9 10 |
# File 'lib/korba/tle.rb', line 8 def mean_motion @mean_motion end |
#mean_motion_ddot ⇒ Object (readonly)
Returns the value of attribute mean_motion_ddot.
8 9 10 |
# File 'lib/korba/tle.rb', line 8 def mean_motion_ddot @mean_motion_ddot end |
#mean_motion_dot ⇒ Object (readonly)
Returns the value of attribute mean_motion_dot.
8 9 10 |
# File 'lib/korba/tle.rb', line 8 def mean_motion_dot @mean_motion_dot end |
#object_id ⇒ Object (readonly)
Returns the value of attribute object_id.
8 9 10 |
# File 'lib/korba/tle.rb', line 8 def object_id @object_id end |
#object_name ⇒ Object (readonly)
Returns the value of attribute object_name.
8 9 10 |
# File 'lib/korba/tle.rb', line 8 def object_name @object_name end |
#ra_of_asc_node ⇒ Object (readonly)
Returns the value of attribute ra_of_asc_node.
8 9 10 |
# File 'lib/korba/tle.rb', line 8 def ra_of_asc_node @ra_of_asc_node end |
#revolution_number ⇒ Object (readonly)
Returns the value of attribute revolution_number.
8 9 10 |
# File 'lib/korba/tle.rb', line 8 def revolution_number @revolution_number end |
#satellite_number ⇒ Object (readonly)
Returns the value of attribute satellite_number.
8 9 10 |
# File 'lib/korba/tle.rb', line 8 def satellite_number @satellite_number end |
#tle_json ⇒ Object (readonly)
Returns the value of attribute tle_json.
8 9 10 |
# File 'lib/korba/tle.rb', line 8 def tle_json @tle_json end |
#tle_string ⇒ Object (readonly)
Returns the value of attribute tle_string.
8 9 10 |
# File 'lib/korba/tle.rb', line 8 def tle_string @tle_string end |
Instance Method Details
#propagate_to(minutesAfterEpoch) ⇒ Object
42 43 44 45 46 47 48 49 50 51 52 |
# File 'lib/korba/tle.rb', line 42 def propagate_to(minutesAfterEpoch) r = [0, 0, 0] v = [0, 0, 0] @element_set_record.error = 0 SGP4.sgp4(@element_set_record, minutesAfterEpoch, r, v) @sgp4Error = @element_set_record.error r = r.map { _1 * 1000 } v = v.map { _1 * 1000 } Car.new(object_name:, epoch:, x: r[0], y: r[1], z: r[2], vx: v[0], vy: v[1], vz: v[2]) end |
#to_car ⇒ Object
37 38 39 40 |
# File 'lib/korba/tle.rb', line 37 def to_car kep = to_kep kep.to_car end |
#to_kep ⇒ Object
26 27 28 29 30 31 32 33 34 35 |
# File 'lib/korba/tle.rb', line 26 def to_kep Kep.new(object_name:, epoch:, semi_major_axis:, eccentricity:, inclination:, ra_of_asc_node:, arg_of_pericenter:, mean_anomaly:) end |