satkit 0.2.4__tar.gz → 0.2.5__tar.gz

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.
Files changed (118) hide show
  1. {satkit-0.2.4 → satkit-0.2.5}/Cargo.toml +1 -1
  2. {satkit-0.2.4/python/satkit.egg-info → satkit-0.2.5}/PKG-INFO +21 -4
  3. {satkit-0.2.4 → satkit-0.2.5}/README.md +20 -3
  4. {satkit-0.2.4 → satkit-0.2.5}/pyproject.toml +1 -1
  5. {satkit-0.2.4 → satkit-0.2.5}/python/satkit/__init__.pyi +75 -25
  6. {satkit-0.2.4 → satkit-0.2.5}/python/satkit/density/__init__.pyi +2 -2
  7. {satkit-0.2.4 → satkit-0.2.5}/python/satkit/jplephem/__init__.pyi +2 -2
  8. {satkit-0.2.4 → satkit-0.2.5}/python/satkit/satprop/__init__.pyi +2 -2
  9. {satkit-0.2.4 → satkit-0.2.5}/python/satkit/sun/__init__.pyi +1 -1
  10. {satkit-0.2.4 → satkit-0.2.5/python/satkit.egg-info}/PKG-INFO +21 -4
  11. {satkit-0.2.4 → satkit-0.2.5}/python/test/test.py +119 -1
  12. {satkit-0.2.4 → satkit-0.2.5}/src/astrotime.rs +10 -0
  13. {satkit-0.2.4 → satkit-0.2.5}/src/earth_orientation_params.rs +21 -2
  14. {satkit-0.2.4 → satkit-0.2.5}/src/earthgravity.rs +18 -2
  15. {satkit-0.2.4 → satkit-0.2.5}/src/itrfcoord.rs +44 -8
  16. {satkit-0.2.4 → satkit-0.2.5}/src/pybindings/pyastrotime.rs +125 -8
  17. {satkit-0.2.4 → satkit-0.2.5}/src/pybindings/pyquaternion.rs +31 -2
  18. {satkit-0.2.4 → satkit-0.2.5}/src/sgp4/mod.rs +8 -0
  19. {satkit-0.2.4 → satkit-0.2.5}/LICENSE +0 -0
  20. {satkit-0.2.4 → satkit-0.2.5}/MANIFEST.in +0 -0
  21. {satkit-0.2.4 → satkit-0.2.5}/python/satkit/__init__.py +0 -0
  22. {satkit-0.2.4 → satkit-0.2.5}/python/satkit/astro-data/py.typed +0 -0
  23. {satkit-0.2.4 → satkit-0.2.5}/python/satkit/density/py.typed +0 -0
  24. {satkit-0.2.4 → satkit-0.2.5}/python/satkit/frametransform/__init__.pyi +0 -0
  25. {satkit-0.2.4 → satkit-0.2.5}/python/satkit/frametransform/py.typed +0 -0
  26. {satkit-0.2.4 → satkit-0.2.5}/python/satkit/jplephem/py.typed +0 -0
  27. {satkit-0.2.4 → satkit-0.2.5}/python/satkit/moon/__init__.py +0 -0
  28. {satkit-0.2.4 → satkit-0.2.5}/python/satkit/moon/py.typed +0 -0
  29. {satkit-0.2.4 → satkit-0.2.5}/python/satkit/py.typed +0 -0
  30. {satkit-0.2.4 → satkit-0.2.5}/python/satkit/satprop/py.typed +0 -0
  31. {satkit-0.2.4 → satkit-0.2.5}/python/satkit/sun/py.typed +0 -0
  32. {satkit-0.2.4 → satkit-0.2.5}/python/satkit/utils/__init__.pyi +0 -0
  33. {satkit-0.2.4 → satkit-0.2.5}/python/satkit/utils/py.typed +0 -0
  34. {satkit-0.2.4 → satkit-0.2.5}/python/satkit.egg-info/SOURCES.txt +0 -0
  35. {satkit-0.2.4 → satkit-0.2.5}/python/satkit.egg-info/dependency_links.txt +0 -0
  36. {satkit-0.2.4 → satkit-0.2.5}/python/satkit.egg-info/requires.txt +0 -0
  37. {satkit-0.2.4 → satkit-0.2.5}/python/satkit.egg-info/top_level.txt +0 -0
  38. {satkit-0.2.4 → satkit-0.2.5}/python/test/download_data.py +0 -0
  39. {satkit-0.2.4 → satkit-0.2.5}/python/test/download_from_json.py +0 -0
  40. {satkit-0.2.4 → satkit-0.2.5}/python/test/download_testvecs.py +0 -0
  41. {satkit-0.2.4 → satkit-0.2.5}/python/test/orbitprop_gps_fit.py +0 -0
  42. {satkit-0.2.4 → satkit-0.2.5}/python/test/sp3file.py +0 -0
  43. {satkit-0.2.4 → satkit-0.2.5}/setup.cfg +0 -0
  44. {satkit-0.2.4 → satkit-0.2.5}/src/consts.rs +0 -0
  45. {satkit-0.2.4 → satkit-0.2.5}/src/duration.rs +0 -0
  46. {satkit-0.2.4 → satkit-0.2.5}/src/frametransform/ierstable.rs +0 -0
  47. {satkit-0.2.4 → satkit-0.2.5}/src/frametransform/mod.rs +0 -0
  48. {satkit-0.2.4 → satkit-0.2.5}/src/frametransform/qcirs2gcrs.rs +0 -0
  49. {satkit-0.2.4 → satkit-0.2.5}/src/jplephem.rs +0 -0
  50. {satkit-0.2.4 → satkit-0.2.5}/src/lib.rs +0 -0
  51. {satkit-0.2.4 → satkit-0.2.5}/src/lpephem/mod.rs +0 -0
  52. {satkit-0.2.4 → satkit-0.2.5}/src/lpephem/moon.rs +0 -0
  53. {satkit-0.2.4 → satkit-0.2.5}/src/lpephem/sun.rs +0 -0
  54. {satkit-0.2.4 → satkit-0.2.5}/src/nrlmsise.rs +0 -0
  55. {satkit-0.2.4 → satkit-0.2.5}/src/ode/harmonic_oscillator.rs +0 -0
  56. {satkit-0.2.4 → satkit-0.2.5}/src/ode/mod.rs +0 -0
  57. {satkit-0.2.4 → satkit-0.2.5}/src/ode/nalgebra.rs +0 -0
  58. {satkit-0.2.4 → satkit-0.2.5}/src/ode/rk_adaptive.rs +0 -0
  59. {satkit-0.2.4 → satkit-0.2.5}/src/ode/rk_adaptive_settings.rs +0 -0
  60. {satkit-0.2.4 → satkit-0.2.5}/src/ode/rk_explicit.rs +0 -0
  61. {satkit-0.2.4 → satkit-0.2.5}/src/ode/rkf45.rs +0 -0
  62. {satkit-0.2.4 → satkit-0.2.5}/src/ode/rkts54.rs +0 -0
  63. {satkit-0.2.4 → satkit-0.2.5}/src/ode/rkv65.rs +0 -0
  64. {satkit-0.2.4 → satkit-0.2.5}/src/ode/rkv65_table.rs +0 -0
  65. {satkit-0.2.4 → satkit-0.2.5}/src/ode/rkv87.rs +0 -0
  66. {satkit-0.2.4 → satkit-0.2.5}/src/ode/rkv87_table.rs +0 -0
  67. {satkit-0.2.4 → satkit-0.2.5}/src/ode/rkv98.rs +0 -0
  68. {satkit-0.2.4 → satkit-0.2.5}/src/ode/rkv98_nointerp.rs +0 -0
  69. {satkit-0.2.4 → satkit-0.2.5}/src/ode/rkv98_nointerp_table.rs +0 -0
  70. {satkit-0.2.4 → satkit-0.2.5}/src/ode/rkv98_table.rs +0 -0
  71. {satkit-0.2.4 → satkit-0.2.5}/src/ode/types.rs +0 -0
  72. {satkit-0.2.4 → satkit-0.2.5}/src/orbitprop/drag.rs +0 -0
  73. {satkit-0.2.4 → satkit-0.2.5}/src/orbitprop/mod.rs +0 -0
  74. {satkit-0.2.4 → satkit-0.2.5}/src/orbitprop/point_gravity.rs +0 -0
  75. {satkit-0.2.4 → satkit-0.2.5}/src/orbitprop/propagator.rs +0 -0
  76. {satkit-0.2.4 → satkit-0.2.5}/src/orbitprop/satproperties.rs +0 -0
  77. {satkit-0.2.4 → satkit-0.2.5}/src/orbitprop/satstate.rs +0 -0
  78. {satkit-0.2.4 → satkit-0.2.5}/src/orbitprop/settings.rs +0 -0
  79. {satkit-0.2.4 → satkit-0.2.5}/src/pybindings/mod.rs +0 -0
  80. {satkit-0.2.4 → satkit-0.2.5}/src/pybindings/mod_utils.rs +0 -0
  81. {satkit-0.2.4 → satkit-0.2.5}/src/pybindings/pyconsts.rs +0 -0
  82. {satkit-0.2.4 → satkit-0.2.5}/src/pybindings/pydensity.rs +0 -0
  83. {satkit-0.2.4 → satkit-0.2.5}/src/pybindings/pyduration.rs +0 -0
  84. {satkit-0.2.4 → satkit-0.2.5}/src/pybindings/pyframetransform.rs +0 -0
  85. {satkit-0.2.4 → satkit-0.2.5}/src/pybindings/pygravity.rs +0 -0
  86. {satkit-0.2.4 → satkit-0.2.5}/src/pybindings/pyitrfcoord.rs +0 -0
  87. {satkit-0.2.4 → satkit-0.2.5}/src/pybindings/pyjplephem.rs +0 -0
  88. {satkit-0.2.4 → satkit-0.2.5}/src/pybindings/pylpephem_moon.rs +0 -0
  89. {satkit-0.2.4 → satkit-0.2.5}/src/pybindings/pylpephem_sun.rs +0 -0
  90. {satkit-0.2.4 → satkit-0.2.5}/src/pybindings/pynrlmsise.rs +0 -0
  91. {satkit-0.2.4 → satkit-0.2.5}/src/pybindings/pypropagate.rs +0 -0
  92. {satkit-0.2.4 → satkit-0.2.5}/src/pybindings/pypropsettings.rs +0 -0
  93. {satkit-0.2.4 → satkit-0.2.5}/src/pybindings/pysatproperties.rs +0 -0
  94. {satkit-0.2.4 → satkit-0.2.5}/src/pybindings/pysatstate.rs +0 -0
  95. {satkit-0.2.4 → satkit-0.2.5}/src/pybindings/pysgp4.rs +0 -0
  96. {satkit-0.2.4 → satkit-0.2.5}/src/pybindings/pysolarsystem.rs +0 -0
  97. {satkit-0.2.4 → satkit-0.2.5}/src/pybindings/pytle.rs +0 -0
  98. {satkit-0.2.4 → satkit-0.2.5}/src/pybindings/pyutils.rs +0 -0
  99. {satkit-0.2.4 → satkit-0.2.5}/src/sgp4/dpper.rs +0 -0
  100. {satkit-0.2.4 → satkit-0.2.5}/src/sgp4/dscom.rs +0 -0
  101. {satkit-0.2.4 → satkit-0.2.5}/src/sgp4/dsinit.rs +0 -0
  102. {satkit-0.2.4 → satkit-0.2.5}/src/sgp4/dspace.rs +0 -0
  103. {satkit-0.2.4 → satkit-0.2.5}/src/sgp4/getgravconst.rs +0 -0
  104. {satkit-0.2.4 → satkit-0.2.5}/src/sgp4/initl.rs +0 -0
  105. {satkit-0.2.4 → satkit-0.2.5}/src/sgp4/satrec.rs +0 -0
  106. {satkit-0.2.4 → satkit-0.2.5}/src/sgp4/sgp4.rs +0 -0
  107. {satkit-0.2.4 → satkit-0.2.5}/src/sgp4/sgp4_lowlevel.rs +0 -0
  108. {satkit-0.2.4 → satkit-0.2.5}/src/sgp4/sgp4init.rs +0 -0
  109. {satkit-0.2.4 → satkit-0.2.5}/src/solarsystem.rs +0 -0
  110. {satkit-0.2.4 → satkit-0.2.5}/src/spaceweather.rs +0 -0
  111. {satkit-0.2.4 → satkit-0.2.5}/src/tle.rs +0 -0
  112. {satkit-0.2.4 → satkit-0.2.5}/src/types.rs +0 -0
  113. {satkit-0.2.4 → satkit-0.2.5}/src/utils/datadir.rs +0 -0
  114. {satkit-0.2.4 → satkit-0.2.5}/src/utils/download.rs +0 -0
  115. {satkit-0.2.4 → satkit-0.2.5}/src/utils/mod.rs +0 -0
  116. {satkit-0.2.4 → satkit-0.2.5}/src/utils/skerror.rs +0 -0
  117. {satkit-0.2.4 → satkit-0.2.5}/src/utils/test.rs +0 -0
  118. {satkit-0.2.4 → satkit-0.2.5}/src/utils/update_data.rs +0 -0
@@ -1,6 +1,6 @@
1
1
  [package]
2
2
  name = "satkit"
3
- version = "0.2.4"
3
+ version = "0.2.5"
4
4
  edition = "2021"
5
5
  description = "Satellite Toolkit"
6
6
  readme = "README.md"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: satkit
3
- Version: 0.2.4
3
+ Version: 0.2.5
4
4
  Summary: Satellite Orbital Dynamics Toolkit
5
5
  Author-email: Steven Michael <ssmichael@gmail.com>
6
6
  Maintainer-email: Steven Michael <ssmichael@gmail.com>
@@ -19,16 +19,33 @@ Requires-Dist: numpy>=1.20.0
19
19
 
20
20
  # Satellite Toolkit with Rust
21
21
 
22
+ An accurate, high-performance satellite orbital kinematics toolkit, written in Rust with a sensible interface.
23
+ <br/>
24
+
25
+ ### Github
26
+
22
27
  ![Build Passing?](https://github.com/ssmichael1/satkit/actions/workflows/build.yml/badge.svg)
23
28
  ![Wheel Passing?](https://github.com/ssmichael1/satkit/actions/workflows/wheels.yml/badge.svg)
24
29
  ![GitHub License](https://img.shields.io/github/license/ssmichael1/satkit)
25
- <br/>
26
- An accurate, high-performance satellite orbital kinematics toolkit, written in Rust with a sensible interface.
30
+
31
+ ### Crates.io
32
+
33
+ ![Crates.io Version](https://img.shields.io/crates/v/satkit)
34
+ ![Crates.io Downloads (recent)](https://img.shields.io/crates/dr/satkit)
35
+
36
+ ### PyPi
37
+
38
+ ![PyPI - Version](https://img.shields.io/pypi/v/satkit)
39
+ ![PyPI - Python Version](https://img.shields.io/pypi/pyversions/satkit)
40
+ ![PyPI - Implementation](https://img.shields.io/pypi/implementation/satkit)
41
+ ![PyPI - Status](https://img.shields.io/pypi/status/satkit)
27
42
 
28
43
  ## Language Bindings
29
44
 
30
45
  - **Native Rust** bindings
31
- - **Python bindings** for compiled rust code ... speed of Rust with convenience of Python
46
+ - **Python bindings** for compiled rust code ... speed of Rust with convenience of Python<br/>
47
+ Install with `pip install satkit`<br/>
48
+ PyPi includes binaries for windows, macos (Intel & arm), and linux
32
49
 
33
50
  ## Features
34
51
 
@@ -1,15 +1,32 @@
1
1
  # Satellite Toolkit with Rust
2
2
 
3
+ An accurate, high-performance satellite orbital kinematics toolkit, written in Rust with a sensible interface.
4
+ <br/>
5
+
6
+ ### Github
7
+
3
8
  ![Build Passing?](https://github.com/ssmichael1/satkit/actions/workflows/build.yml/badge.svg)
4
9
  ![Wheel Passing?](https://github.com/ssmichael1/satkit/actions/workflows/wheels.yml/badge.svg)
5
10
  ![GitHub License](https://img.shields.io/github/license/ssmichael1/satkit)
6
- <br/>
7
- An accurate, high-performance satellite orbital kinematics toolkit, written in Rust with a sensible interface.
11
+
12
+ ### Crates.io
13
+
14
+ ![Crates.io Version](https://img.shields.io/crates/v/satkit)
15
+ ![Crates.io Downloads (recent)](https://img.shields.io/crates/dr/satkit)
16
+
17
+ ### PyPi
18
+
19
+ ![PyPI - Version](https://img.shields.io/pypi/v/satkit)
20
+ ![PyPI - Python Version](https://img.shields.io/pypi/pyversions/satkit)
21
+ ![PyPI - Implementation](https://img.shields.io/pypi/implementation/satkit)
22
+ ![PyPI - Status](https://img.shields.io/pypi/status/satkit)
8
23
 
9
24
  ## Language Bindings
10
25
 
11
26
  - **Native Rust** bindings
12
- - **Python bindings** for compiled rust code ... speed of Rust with convenience of Python
27
+ - **Python bindings** for compiled rust code ... speed of Rust with convenience of Python<br/>
28
+ Install with `pip install satkit`<br/>
29
+ PyPi includes binaries for windows, macos (Intel & arm), and linux
13
30
 
14
31
  ## Features
15
32
 
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "satkit"
7
- version = "0.2.4"
7
+ version = "0.2.5"
8
8
  dependencies = ["numpy>=1.20.0"]
9
9
  requires-python = ">= 3.8"
10
10
  authors = [{ name = "Steven Michael", email = "ssmichael@gmail.com" }]
@@ -176,7 +176,7 @@ def sgp4(
176
176
  tle: satkit.TLE | list[satkit.tle],
177
177
  tm: satkit.time | list[satkit.time] | npt.ArrayLike[satkit.time],
178
178
  **kwargs,
179
- ) -> (npt.ArrayLike[np.float64], npt.ArrayLike[np.float64]):
179
+ ) -> tuple[npt.ArrayLike[np.float64], npt.ArrayLike[np.float64]]:
180
180
  """
181
181
  Run Simplified General Perturbations (SGP)-4 propagator on
182
182
  Two-Line Element Set to
@@ -369,7 +369,7 @@ def gravity(
369
369
 
370
370
  def gravity_and_partials(
371
371
  pos: satkit.itrfcoord | npt.ArrayLike[np.float], **kwargs
372
- ) -> (npt.ArrayLike[np.float], np.arrayLike[np.float]):
372
+ ) -> typing.Tuple[npt.ArrayLike[np.float], np.arrayLike[np.float]]:
373
373
  """
374
374
  gravity_and_partials(pos)
375
375
  --
@@ -539,6 +539,16 @@ class timescale:
539
539
 
540
540
  For details, see:
541
541
  https://stjarnhimlen.se/comp/time.html
542
+
543
+ # Options:
544
+
545
+ * Invalid: Invalid time scale
546
+ * UTC: Universal Time Coordinate
547
+ * TT: Terrestrial Time
548
+ * UT1: UT1
549
+ * TAI: International Atomic Time
550
+ * GPS: Global Positioning System (GPS) time
551
+ * TDB: Barycentric Dynamical Time
542
552
  """
543
553
 
544
554
  @property
@@ -587,6 +597,31 @@ class time:
587
597
  the ability to convert to an from the "datetime" object. However, a separate
588
598
  time representation is needed as the "datetime" object does not allow for
589
599
  conversion between various time epochs (GPS, TAI, UTC, UT1, etc...)
600
+
601
+ Initialization arguments:
602
+
603
+ If no arguments are passed in, the created object represents
604
+ the current time, i.e. the time at which the function was called
605
+
606
+
607
+ If 3 integers are passed in, they represent a UTC date specified
608
+ by the standard Gregorian year, month (1-based), and day of month
609
+ (1-based)
610
+
611
+ if 5 integers and a float are passed in, they represent a UTC
612
+ date and time. The 1st 3 numbers represent the standard
613
+ Gregorian year, month, and day as above. The last 3 represent the
614
+ hour of the day [0,23], the minute of the hour [0,59], and the
615
+ second (including fractional component) of the minute
616
+
617
+ Example 1:
618
+ print(satkit.time(2023, 3, 5, 11, 3,45.453))
619
+ 2023-03-05 11:03:45.453Z
620
+
621
+ Example 2:
622
+ print(satkit.time(2023, 3, 5))
623
+ 2023-03-05 00:00:00.000Z
624
+
590
625
  """
591
626
 
592
627
  def __init__(self, *args):
@@ -645,7 +680,7 @@ class time:
645
680
  Return a time object representing input modified Julian date and time scale
646
681
  """
647
682
 
648
- def to_date(self) -> (int, int, int):
683
+ def to_date(self) -> typing.Tuple[int, int, int]:
649
684
  """
650
685
  Return tuple representing as UTC Gegorian date of the
651
686
  time object. Tuple has 6 elements:
@@ -687,7 +722,7 @@ class time:
687
722
 
688
723
  def to_gregorian(
689
724
  self, scale=satkit.timescale.UTC
690
- ) -> (int, int, int, int, int, float):
725
+ ) -> typing.Tuple[int, int, int, int, int, float]:
691
726
  """
692
727
  Return tuple representing as UTC Gegorian date and time of the
693
728
  time object. Tuple has 6 elements:
@@ -730,16 +765,20 @@ class time:
730
765
  2023-06-03 02:19:34
731
766
  """
732
767
 
733
- def to_mjd(self, scale: satkit.timescale) -> float:
768
+ def to_mjd(self, scale: satkit.timescale = satkit.timescale.UTC) -> float:
734
769
  """
735
770
  Represent time instance as a Modified Julian Date
736
771
  with the provided time scale
772
+
773
+ If no time scale is provided, default is satkit.timescale.UTC
737
774
  """
738
775
 
739
- def to_jd(self, scale: satkit.timescale) -> float:
776
+ def to_jd(self, scale: satkit.timescale = satkit.timescale.UTC) -> float:
740
777
  """
741
778
  Represent time instance as Julian Date with
742
779
  the provided time scale
780
+
781
+ If no time scale is provided, default is satkit.timescale.UTC
743
782
  """
744
783
 
745
784
  def to_unixtime(self) -> float:
@@ -765,15 +804,15 @@ class time:
765
804
  Return an satkit.time object or nunpy array of satkit.time objects
766
805
  representing the input "added to" the current object
767
806
 
768
- Possible inputs and corresponding outputs:
807
+ # Possible inputs and corresponding outputs:
769
808
 
770
- 1. float: return satkit.time object incremented by input number of days
771
- 2. satkit.duration: return satkit.time object incremented by duration
772
- 3. list[float]: return numpy array of satkit.time objects, representing
809
+ * `float` - return satkit.time object incremented by input number of days
810
+ * `satkit.duration` - return satkit.time object incremented by duration
811
+ * `list[float]` - return numpy array of satkit.time objects, representing
773
812
  an element-wise addition of days to the "self"
774
- 4. list[duration]: reuturn numpy array of satkit.time objects, with each
813
+ * `list[duration]` - reuturn numpy array of satkit.time objects, with each
775
814
  object representing an element-wise addition of "duration" to the "self"
776
- 5. numpy.array(float): return numpy array of satkit.time objects, with each
815
+ * `numpy.array(float)` - return numpy array of satkit.time objects, with each
777
816
  object representing an element-wise addition of days to the "self"
778
817
  """
779
818
 
@@ -791,17 +830,17 @@ class time:
791
830
  Return an satkit.time object or numpy array of satkit.time objects
792
831
  representing the input "subtracted from" the current object
793
832
 
794
- Possible inputs and corresponding outputs:
833
+ # Possible inputs and corresponding outputs:
795
834
 
796
- 1. satkit.time: output is duration representing the difference
835
+ * `satkit.time` - output is duration representing the difference
797
836
  between the "other" time and "self"
798
- 2. satkit.duration: output is satkit.time object representing time minus
837
+ * `satkit.duration` - output is satkit.time object representing time minus
799
838
  the input duration
800
- 3. list[float]: return numpy array of satkit.time objects, representing
839
+ * `list[float]` - return numpy array of satkit.time objects, representing
801
840
  an element-wise subtraction of days to the "self"
802
- 4. list[duration]: return numpy array of satkit.time objects, representing
841
+ * `list[duration]` - return numpy array of satkit.time objects, representing
803
842
  an element-wise subtraction of "duration" from the "self"
804
- 5. numpy.array(float): return numpy array of satkit.time objects, with
843
+ * `numpy.array(float)` - return numpy array of satkit.time objects, with
805
844
  each object representing an element-wise subtraction of days from
806
845
  the "self".
807
846
 
@@ -847,11 +886,13 @@ class duration:
847
886
  if "other" is a time, output is a time representing the input
848
887
  time plus the duration
849
888
 
850
- Example 1:
889
+ # Example 1:
890
+
851
891
  print(duration.from_hours(1) + duration.from_minutes(1))
852
892
  Duration: 1 hours, 1 minutes, 0.000 seconds
853
893
 
854
- Example 2:
894
+ # Example 2:
895
+
855
896
  print(duration.from_hours(1) + satkit.time(2023, 6, 4, 11,30,0))
856
897
  2023-06-04 13:30:00.000Z
857
898
 
@@ -936,6 +977,15 @@ class quaternion:
936
977
  have to be normalized.
937
978
  """
938
979
 
980
+ @staticmethod
981
+ def from_rotation_matrix(
982
+ mat: npt.ArrayLike[np.float64],
983
+ ) -> satkit.quaternion:
984
+ """
985
+ Return quaternion representing right-handed rotation
986
+ represented by input 3x3 rotation matrix
987
+ """
988
+
939
989
  @staticmethod
940
990
  def rotx(theta) -> satkit.quaternion:
941
991
  """
@@ -994,7 +1044,7 @@ class quaternion:
994
1044
  Return 3x3 rotation matrix representing equivalent rotation
995
1045
  """
996
1046
 
997
- def to_euler(self) -> (float, float, float):
1047
+ def to_euler(self) -> typing.Tuple[float, float, float]:
998
1048
  """
999
1049
  Return equivalent rotation angle represented as rotation angles:
1000
1050
  ("roll", "pitch", "yaw") in radians:
@@ -1009,7 +1059,7 @@ class quaternion:
1009
1059
  Return the angle in radians of the rotation
1010
1060
  """
1011
1061
 
1012
- def axis(self) -> npt.ArrayLike(np.float64):
1062
+ def axis(self) -> npt.ArrayLike[np.float64]:
1013
1063
  """
1014
1064
  Return the axis of rotation as a unit vector
1015
1065
  """
@@ -1196,13 +1246,13 @@ class itrfcoord:
1196
1246
  """
1197
1247
 
1198
1248
  @property
1199
- def geodetic_rad(self) -> (float, float, float):
1249
+ def geodetic_rad(self) -> typing.Tuple[float, float, float]:
1200
1250
  """
1201
1251
  Tuple with: (latitude_rad, longitude_rad, altitude)
1202
1252
  """
1203
1253
 
1204
1254
  @property
1205
- def geodetic_deg(self) -> (float, float, float):
1255
+ def geodetic_deg(self) -> typing.Tuple[float, float, float]:
1206
1256
  """
1207
1257
  Tuple with (latitude_deg, longitude_deg, altitude)
1208
1258
  """
@@ -1227,7 +1277,7 @@ class itrfcoord:
1227
1277
  to ITRF at this location
1228
1278
  """
1229
1279
 
1230
- def geodesic_distance(self, other: itrfcoord) -> (float, float, float):
1280
+ def geodesic_distance(self, other: itrfcoord) -> typing.Tuple[float, float, float]:
1231
1281
  """
1232
1282
  Use Vincenty formula to compute geodesic distance:
1233
1283
  https://en.wikipedia.org/wiki/Vincenty%27s_formulae
@@ -13,7 +13,7 @@ import satkit
13
13
 
14
14
 
15
15
  @typing.overload
16
- def nrlmsise(itrf: satkit.itrfcoord, time: satkit.time | None) -> (float, float):
16
+ def nrlmsise(itrf: satkit.itrfcoord, time: satkit.time | None) -> typing.Tuple[float, float]:
17
17
  """
18
18
  NRL MSISE-00 Atmosphere Density Model
19
19
 
@@ -44,7 +44,7 @@ def nrlmsise(itrf: satkit.itrfcoord, time: satkit.time | None) -> (float, float)
44
44
  def nrlmsise(altitude_meters: float,
45
45
  latitude_rad: float,
46
46
  longitude_rad: float,
47
- time: satkit.time | None) -> (float, float):
47
+ time: satkit.time | None) -> typing.Tuple[float, float]:
48
48
  """
49
49
  NRL MSISE-00 Atmosphere Density Model
50
50
 
@@ -60,7 +60,7 @@ def barycentric_pos(body: satkit.solarsystem, tm: satkit.time|list[satkit.time]|
60
60
  """
61
61
 
62
62
  def geocentric_state(body: satkit.solarsystem,
63
- tm: satkit.time|list[satkit.time]|npt.ArrayLike[satkit.time]) -> (npt.ArrayLike[np.float64], npt.ArrayLike[np.float64]):
63
+ tm: satkit.time|list[satkit.time]|npt.ArrayLike[satkit.time]) -> typing.Tuple[npt.ArrayLike[np.float64], npt.ArrayLike[np.float64]]:
64
64
  """
65
65
  Return geocentric (Earth-centered) state (position and velocity) for a given solar-system body
66
66
  at the given time or times in the GCRF frame
@@ -88,7 +88,7 @@ def geocentric_state(body: satkit.solarsystem,
88
88
  """
89
89
 
90
90
  def barycentric_state(body: satkit.solarsystem,
91
- tm: satkit.time|list[satkit.time]|npt.ArrayLike[satkit.time]) -> (npt.ArrayLike[np.float64], npt.ArrayLike[np.float64]):
91
+ tm: satkit.time|list[satkit.time]|npt.ArrayLike[satkit.time]) -> typing.Tuple[npt.ArrayLike[np.float64], npt.ArrayLike[np.float64]]:
92
92
  """
93
93
  Return barycentric position and velocity for a given solar-system body
94
94
  at the given time or times. The barycentric coordinate system origin
@@ -234,8 +234,8 @@ class propsettings:
234
234
  """
235
235
 
236
236
  def propagate(
237
- pos: npt.ArrayLike(np.float64),
238
- vel: npt.ArrayLike(np.float64),
237
+ pos: npt.ArrayLike[float],
238
+ vel: npt.ArrayLike[float],
239
239
  start: satkit.time,
240
240
  **kwargs,
241
241
  ) -> PropResult:
@@ -125,7 +125,7 @@ def pos_mod(
125
125
  def rise_set(time: satkit.time,
126
126
  coord: satkit.itrfcoord,
127
127
  sigma: float = 90.0 + 50.0/60.0
128
- ) -> (satkit.time, satkit.time):
128
+ ) -> typing.Tuple[satkit.time, satkit.time]:
129
129
  """
130
130
  Sunrise and sunset times on the day given by input time
131
131
  and at the given location.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: satkit
3
- Version: 0.2.4
3
+ Version: 0.2.5
4
4
  Summary: Satellite Orbital Dynamics Toolkit
5
5
  Author-email: Steven Michael <ssmichael@gmail.com>
6
6
  Maintainer-email: Steven Michael <ssmichael@gmail.com>
@@ -19,16 +19,33 @@ Requires-Dist: numpy>=1.20.0
19
19
 
20
20
  # Satellite Toolkit with Rust
21
21
 
22
+ An accurate, high-performance satellite orbital kinematics toolkit, written in Rust with a sensible interface.
23
+ <br/>
24
+
25
+ ### Github
26
+
22
27
  ![Build Passing?](https://github.com/ssmichael1/satkit/actions/workflows/build.yml/badge.svg)
23
28
  ![Wheel Passing?](https://github.com/ssmichael1/satkit/actions/workflows/wheels.yml/badge.svg)
24
29
  ![GitHub License](https://img.shields.io/github/license/ssmichael1/satkit)
25
- <br/>
26
- An accurate, high-performance satellite orbital kinematics toolkit, written in Rust with a sensible interface.
30
+
31
+ ### Crates.io
32
+
33
+ ![Crates.io Version](https://img.shields.io/crates/v/satkit)
34
+ ![Crates.io Downloads (recent)](https://img.shields.io/crates/dr/satkit)
35
+
36
+ ### PyPi
37
+
38
+ ![PyPI - Version](https://img.shields.io/pypi/v/satkit)
39
+ ![PyPI - Python Version](https://img.shields.io/pypi/pyversions/satkit)
40
+ ![PyPI - Implementation](https://img.shields.io/pypi/implementation/satkit)
41
+ ![PyPI - Status](https://img.shields.io/pypi/status/satkit)
27
42
 
28
43
  ## Language Bindings
29
44
 
30
45
  - **Native Rust** bindings
31
- - **Python bindings** for compiled rust code ... speed of Rust with convenience of Python
46
+ - **Python bindings** for compiled rust code ... speed of Rust with convenience of Python<br/>
47
+ Install with `pip install satkit`<br/>
48
+ PyPi includes binaries for windows, macos (Intel & arm), and linux
32
49
 
33
50
  ## Features
34
51
 
@@ -11,6 +11,78 @@ testvec_dir = os.getenv(
11
11
  "SATKIT_TESTVEC_ROOT", default="." + os.path.sep + "satkit-testvecs" + os.path.sep
12
12
  )
13
13
 
14
+ class TestTime:
15
+ def test_mjd(self):
16
+ """
17
+ Test MJD conversion
18
+ """
19
+ t = sk.time(2021, 1, 1, 0, 0, 0)
20
+ mjd = t.to_mjd(sk.timescale.UTC)
21
+ assert mjd == pytest.approx(59215.0)
22
+
23
+ def test_jd(self):
24
+ """
25
+ Test JD conversion
26
+ """
27
+ t = sk.time(2021, 1, 1, 0, 0, 0)
28
+ jd = t.to_jd(sk.timescale.UTC)
29
+ assert jd == pytest.approx(2459215.5)
30
+
31
+ def test_duration(self):
32
+ """
33
+ Test duration conversion
34
+ """
35
+ d = sk.duration.from_seconds(86400)
36
+ assert d.seconds() == 86400
37
+ assert d.days() == 1.0
38
+
39
+ def test_time_diff(self):
40
+ """
41
+ Test time difference
42
+ """
43
+ t1 = sk.time(2021, 1, 1, 0, 0, 0)
44
+ t2 = sk.time(2021, 1, 2, 0, 0, 0)
45
+ d = t2 - t1
46
+ assert d.days() == 1.0
47
+
48
+ def test_time_add(self):
49
+ """
50
+ Test time addition
51
+ """
52
+ t1 = sk.time(2021, 1, 1, 0, 0, 0)
53
+ d = sk.duration.from_days(1)
54
+ t2 = t1 + d
55
+ assert t2 == sk.time(2021, 1, 2, 0, 0, 0)
56
+
57
+ def test_time_sub(self):
58
+ """
59
+ Test time subtraction
60
+ """
61
+ t1 = sk.time(2021, 1, 1, 0, 0, 0)
62
+ d = sk.duration.from_days(1)
63
+ t2 = t1 - d
64
+ assert t2 == sk.time(2020, 12, 31, 0, 0, 0)
65
+
66
+ def test_time_str(self):
67
+ """
68
+ Test string conversion of time
69
+ """
70
+ t = sk.time(2021, 1, 1, 0, 0, 0)
71
+ assert str(t) == "2021-01-01 00:00:00.000Z"
72
+
73
+ def test_time_gregorian(self):
74
+ """
75
+ Test conversion to Gregorian calendar
76
+ """
77
+ t = sk.time(2021, 1, 1, 0, 0, 0)
78
+ (year, mon, day, hour, minute, sec) = t.to_gregorian()
79
+ assert year == 2021
80
+ assert mon == 1
81
+ assert day == 1
82
+ assert hour == 0
83
+ assert minute == 0
84
+ assert sec == 0
85
+
14
86
  class TestJPLEphem:
15
87
  def test_jplephem_testvecs(self):
16
88
  """
@@ -107,7 +179,6 @@ class TestJPLEphem:
107
179
  calc = (tvel - svel)[coord - 4] / sk.consts.au * 86400.0
108
180
  assert calc == pytest.approx(truth, rel=1e-12)
109
181
 
110
-
111
182
  class TestGravity:
112
183
  def test_gravity(self):
113
184
  """
@@ -341,6 +412,53 @@ class TestQuaternion:
341
412
  m.pi / 2
342
413
  ).to_rotation_matrix() @ zhat == pytest.approx(xhat, 1.0e-10)
343
414
 
415
+ def test_dcm2quaternion(self):
416
+ """
417
+ Test conversion of DCM to quaternion
418
+ """
419
+ xhat = np.array([1.0, 0.0, 0.0])
420
+ yhat = np.array([0.0, 1.0, 0.0])
421
+ zhat = np.array([0.0, 0.0, 1.0])
422
+
423
+ q = sk.quaternion.from_rotation_matrix(sk.quaternion.rotz(m.pi / 2).to_rotation_matrix())
424
+ assert q * xhat == pytest.approx(yhat, 1.0e-10)
425
+
426
+
427
+ def test_quaternion2dcm(self):
428
+ """
429
+ Test conversion of quaternion to DCM
430
+ """
431
+ xhat = np.array([1.0, 0.0, 0.0])
432
+ yhat = np.array([0.0, 1.0, 0.0])
433
+ zhat = np.array([0.0, 0.0, 1.0])
434
+ q = sk.quaternion.from_rotation_matrix(sk.quaternion.rotz(m.pi / 2).to_rotation_matrix())
435
+ dcm = q.to_rotation_matrix()
436
+ assert dcm @ xhat == pytest.approx(yhat, 1.0e-10)
437
+
438
+ def test_quaternion2euler(self):
439
+ """
440
+ Test conversion of quaternion to Euler angles
441
+ """
442
+ q = sk.quaternion.rotz(m.pi/3)
443
+ euler = q.to_euler()
444
+ assert euler[0] == pytest.approx(0.0)
445
+ assert euler[1] == pytest.approx(0.0)
446
+ assert euler[2] == pytest.approx(m.pi/3)
447
+
448
+ q = sk.quaternion.rotx(m.pi/3)
449
+ euler = q.to_euler()
450
+ assert euler[0] == pytest.approx(m.pi/3)
451
+ assert euler[1] == pytest.approx(0.0)
452
+ assert euler[2] == pytest.approx(0.0)
453
+
454
+ q = sk.quaternion.roty(m.pi/3)
455
+ euler = q.to_euler()
456
+ assert euler[0] == pytest.approx(0.0)
457
+ assert euler[1] == pytest.approx(m.pi/3)
458
+ assert euler[2] == pytest.approx(0.0)
459
+
460
+
461
+
344
462
 
345
463
  class TestGeodesicDistance:
346
464
 
@@ -91,6 +91,16 @@ const DELTAAT_OLD: [[f64; 4]; 15] = [
91
91
 
92
92
  /// Time Scales
93
93
  ///
94
+ /// # Enum Values:
95
+ ///
96
+ /// * `UTC` - Univeral Time Coordiante
97
+ /// * `TT` - Terrestrial Time
98
+ /// * `UT1` - UT1
99
+ /// * `TAI` - International Atomic Time
100
+ /// * `GPS` - Global Positioning System
101
+ /// * `TDB` - Barycentric Dynamical Time
102
+ /// * `INVALID` - Invalid
103
+ ///
94
104
  #[derive(PartialEq, Debug)]
95
105
  pub enum Scale {
96
106
  /// Invalid
@@ -173,6 +173,25 @@ pub fn update() -> SKResult<()> {
173
173
  Ok(())
174
174
  }
175
175
 
176
+
177
+ ///
178
+ /// Get Earth Orientation Parameters at given Modified Julian Date (UTC)
179
+ /// Returns None if no data is available for the given date
180
+ ///
181
+ /// # Arguments:
182
+ ///
183
+ /// * `mjd_utc` - Modified Julian Date (UTC)
184
+ ///
185
+ /// # Returns:
186
+ ///
187
+ /// * Vector [f64; 6] with following elements:
188
+ /// * 0 : (UT1 - UTC) in seconds
189
+ /// * 1 : X polar motion in arcsecs
190
+ /// * 2 : Y polar motion in arcsecs
191
+ /// * 3 : LOD: instantaneous rate of change in (UT1-UTC), msec/day
192
+ /// * 4 : dX wrt IAU-2000 Nutation, milli-arcsecs
193
+ /// * 5 : dY wrt IAU-2000 Nutation, milli-arcsecs
194
+ ///
176
195
  pub fn eop_from_mjd_utc(mjd_utc: f64) -> Option<[f64; 6]> {
177
196
  let eop = eop_params_singleton().read().unwrap();
178
197
 
@@ -207,9 +226,9 @@ pub fn eop_from_mjd_utc(mjd_utc: f64) -> Option<[f64; 6]> {
207
226
  ///
208
227
  /// * tm: Instant at which to query parameters
209
228
  ///
210
- /// # Return:
229
+ /// # Returns:
211
230
  ///
212
- /// * Vector [f64; 4] with following elements:
231
+ /// * Vector [f64; 6] with following elements:
213
232
  /// * 0 : (UT1 - UTC) in seconds
214
233
  /// * 1 : X polar motion in arcsecs
215
234
  /// * 2 : Y polar motion in arcsecs