korba 0.2.0 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +8 -0
- data/README.md +36 -9
- data/lib/korba/tle.rb +5 -2
- data/lib/korba/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e02130eb6662759d8869d606d53c5d7ecc64c26ed59a5605487fdf5e8d785f01
|
4
|
+
data.tar.gz: 90d8fe4257842deffd1f45ca5fab34013f9decb275ff03f9d59c369f3182e11e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 95b4ade626d6622599c3d7e6b533db46a49b820c81cdbc3a8f57838901220950dfdb2643de622d8a414c63a4a24fa15831a8dc489c821ec15c1d10335a929d6c
|
7
|
+
data.tar.gz: 84b650670d1d10fc81b0cd9e9b5005a2dba965bb119df8913a7e38d0997b0c0f31f53ba105d9c3d13198ae4b768df5c7f23b5eb8e3d4694ea86bc7bf0b3e1ff6
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -1,28 +1,55 @@
|
|
1
|
-
|
1
|
+
[](https://rubygems.org/gems/korba)
|
2
2
|
|
3
|
-
|
3
|
+
# Korba
|
4
4
|
|
5
|
-
|
5
|
+
An orbital analytics library for ruby.
|
6
6
|
|
7
7
|
## Installation
|
8
8
|
|
9
|
-
TODO: Replace `UPDATE_WITH_YOUR_GEM_NAME_IMMEDIATELY_AFTER_RELEASE_TO_RUBYGEMS_ORG` with your gem name right after releasing it to RubyGems.org. Please do not do it earlier due to security reasons. Alternatively, replace this section with instructions to install your gem from git if you don't plan to release to RubyGems.org.
|
10
|
-
|
11
9
|
Install the gem and add to the application's Gemfile by executing:
|
12
10
|
|
13
11
|
```bash
|
14
|
-
bundle add
|
12
|
+
bundle add korba
|
15
13
|
```
|
16
14
|
|
17
15
|
If bundler is not being used to manage dependencies, install the gem by executing:
|
18
16
|
|
19
17
|
```bash
|
20
|
-
gem install
|
18
|
+
gem install korba
|
21
19
|
```
|
22
20
|
|
23
21
|
## Usage
|
24
22
|
|
25
|
-
|
23
|
+
### Create Orbital Elements From TLE(Two Line Elements)
|
24
|
+
|
25
|
+
```ruby
|
26
|
+
orbit = Korba::Tle.new(<<~TLE)
|
27
|
+
ISS (ZARYA)
|
28
|
+
1 25544U 98067A 24342.85930654 .00018474 00000+0 32681-3 0 9991
|
29
|
+
2 25544 51.6381 174.9565 0006817 314.0303 175.4461 15.50337242485488
|
30
|
+
TLE
|
31
|
+
|
32
|
+
orbit.semi_major_axis
|
33
|
+
# => 6793877.649839985
|
34
|
+
|
35
|
+
orbit.height_at_perigee
|
36
|
+
# => 411109.2634460889
|
37
|
+
|
38
|
+
orbit.height_at_apogee
|
39
|
+
# => 420372.03623388056
|
40
|
+
|
41
|
+
orbit.to_kep
|
42
|
+
# =>
|
43
|
+
# #<Korba::Kep:xxxxxxxxxxxxxxxx
|
44
|
+
# @arg_of_pericenter=314.0303,
|
45
|
+
# @eccentricity=0.0006817,
|
46
|
+
# @epoch="2024-12-07T20:37:24.085055",
|
47
|
+
# @inclination=51.6381,
|
48
|
+
# @mean_anomaly=175.4461,
|
49
|
+
# @object_name="ISS (ZARYA)",
|
50
|
+
# @ra_of_asc_node=174.9565,
|
51
|
+
# @semi_major_axis=6793877.649839985>
|
52
|
+
```
|
26
53
|
|
27
54
|
## Development
|
28
55
|
|
@@ -32,4 +59,4 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
|
|
32
59
|
|
33
60
|
## Contributing
|
34
61
|
|
35
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/
|
62
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/kk0000-kk/korba.
|
data/lib/korba/tle.rb
CHANGED
@@ -5,9 +5,11 @@ module Korba
|
|
5
5
|
class Tle
|
6
6
|
include Korba::OrbitUtils
|
7
7
|
|
8
|
-
attr_reader :tle_json, :object_name, :object_id, :epoch, :mean_motion, :eccentricity, :inclination, :ra_of_asc_node, :arg_of_pericenter, :mean_anomaly
|
8
|
+
attr_reader :tle_json, :tle_string, :object_name, :object_id, :epoch, :mean_motion, :eccentricity, :inclination, :ra_of_asc_node, :arg_of_pericenter, :mean_anomaly
|
9
|
+
|
10
|
+
def initialize(tle = nil, type: :string)
|
11
|
+
return if tle.nil?
|
9
12
|
|
10
|
-
def initialize(tle, type: :string)
|
11
13
|
case type
|
12
14
|
when :string
|
13
15
|
initialize_from_string(tle)
|
@@ -30,6 +32,7 @@ module Korba
|
|
30
32
|
private
|
31
33
|
|
32
34
|
def initialize_from_string(tle_string)
|
35
|
+
@tle_string = tle_string
|
33
36
|
lines = tle_string.split(/\R/)
|
34
37
|
@object_name = lines.shift if lines.size > 2
|
35
38
|
parse_line1(lines[0].split(" "))
|
data/lib/korba/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: korba
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- kk0000-kk
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-12-
|
11
|
+
date: 2024-12-09 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Orbital elements calculation library
|
14
14
|
email:
|