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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: dc5cb24ea2424abd3408fb27d0bd8c414b60e02fc3923116f4b4a3f278be049c
4
- data.tar.gz: 6a67a53fa7eda0a04d51bf34732a5fd82b5d97a57963e17acd28fbd64715fbf1
3
+ metadata.gz: e02130eb6662759d8869d606d53c5d7ecc64c26ed59a5605487fdf5e8d785f01
4
+ data.tar.gz: 90d8fe4257842deffd1f45ca5fab34013f9decb275ff03f9d59c369f3182e11e
5
5
  SHA512:
6
- metadata.gz: e3d5ee6cf6802c4c47b04986a7ae9ebf1bc279bb76d9f8e83bebc4bdabe0521be616c662a0358195b373e22a4974c1bca2e316225e4fa79e0fd63c01e35b6920
7
- data.tar.gz: c9e5748953f5d1ad950ca294c7ecf82d099f83ebbe31753453e57930dcc9aaf4ff26ffad97677efb577ad13ba429d287917ff6a47a2dad280a5d2962b5a8d8a6
6
+ metadata.gz: 95b4ade626d6622599c3d7e6b533db46a49b820c81cdbc3a8f57838901220950dfdb2643de622d8a414c63a4a24fa15831a8dc489c821ec15c1d10335a929d6c
7
+ data.tar.gz: 84b650670d1d10fc81b0cd9e9b5005a2dba965bb119df8913a7e38d0997b0c0f31f53ba105d9c3d13198ae4b768df5c7f23b5eb8e3d4694ea86bc7bf0b3e1ff6
data/CHANGELOG.md CHANGED
@@ -1,3 +1,11 @@
1
+ ## [0.4.0] - 2024-12-09
2
+
3
+ - Enable save tle_string
4
+
5
+ ## [0.3.0] - 2024-12-09
6
+
7
+ - Enable instance creation without arguments
8
+
1
9
  ## [0.2.0] - 2024-12-08
2
10
 
3
11
  - Enable to create tle object from string
data/README.md CHANGED
@@ -1,28 +1,55 @@
1
- # Korba
1
+ [![Gem Version](https://badge.fury.io/rb/korba.svg)](https://rubygems.org/gems/korba)
2
2
 
3
- TODO: Delete this and the text below, and describe your gem
3
+ # Korba
4
4
 
5
- Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/korba`. To experiment with that code, run `bin/console` for an interactive prompt.
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 UPDATE_WITH_YOUR_GEM_NAME_IMMEDIATELY_AFTER_RELEASE_TO_RUBYGEMS_ORG
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 UPDATE_WITH_YOUR_GEM_NAME_IMMEDIATELY_AFTER_RELEASE_TO_RUBYGEMS_ORG
18
+ gem install korba
21
19
  ```
22
20
 
23
21
  ## Usage
24
22
 
25
- TODO: Write usage instructions here
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/[USERNAME]/korba.
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Korba
4
- VERSION = "0.2.0"
4
+ VERSION = "0.4.0"
5
5
  end
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.2.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-08 00:00:00.000000000 Z
11
+ date: 2024-12-09 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Orbital elements calculation library
14
14
  email: