Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
helgee committed Nov 12, 2024
1 parent 243b029 commit c039ea4
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 2 deletions.
3 changes: 3 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions crates/lox-ephem/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,9 @@ repository.workspace = true
lox-math.workspace = true

nom.workspace = true
pyo3 = { workspace = true, optional = true }
numpy = { workspace = true, optional = true }
thiserror.workspace = true

[features]
python = ["dep:pyo3", "dep:numpy"]
2 changes: 2 additions & 0 deletions crates/lox-ephem/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
use lox_math::types::julian_dates::Epoch;

#[cfg(feature = "python")]
pub mod python;
pub mod spk;

pub(crate) type Position = (f64, f64, f64);
Expand Down
7 changes: 7 additions & 0 deletions crates/lox-orbits/src/python.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
use std::convert::TryFrom;

use glam::DVec3;
use lox_ephem::python::PySpk;
use numpy::{PyArray1, PyArray2, PyArrayMethods};
use pyo3::types::PyType;
use pyo3::{
Expand Down Expand Up @@ -380,6 +381,12 @@ impl PyState {
self.to_frame_generated(frame, provider)
}

fn to_origin(&self, target: &Bound<'_, PyAny>, ephemeris: &Bound<'_, PySpk>) -> PyResult<Self> {
let target = PyBody::try_from(target)?;
let spk = ephemeris.borrow();
todo!()
}

fn to_keplerian(&self) -> PyResult<PyKeplerian> {
if self.0.reference_frame() != PyFrame::Icrf {
return Err(PyValueError::new_err(
Expand Down
6 changes: 4 additions & 2 deletions crates/lox-space/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,10 @@ crate-type = ["lib", "cdylib"]

[dependencies]
lox-bodies.workspace = true
lox-ephem.workspace = true
lox-math.workspace = true
lox-orbits.workspace = true
lox-time.workspace = true
lox-math.workspace = true

pyo3 = { workspace = true, optional = true }

Expand All @@ -25,9 +26,10 @@ default = ["python"]
python = [
"dep:pyo3",
"lox-bodies/python",
"lox-ephem/python",
"lox-math/python",
"lox-orbits/python",
"lox-time/python",
"lox-math/python",
]

[dev-dependencies]
Expand Down
2 changes: 2 additions & 0 deletions crates/lox-space/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
*/

use lox_bodies::python::{PyBarycenter, PyMinorBody, PyPlanet, PySatellite, PySun};
use lox_ephem::python::PySpk;
use lox_orbits::python::{
elevation, find_events, find_windows, visibility, PyEvent, PyFrame, PyGroundLocation,
PyGroundPropagator, PyKeplerian, PyObservables, PySgp4, PyState, PyTopocentric, PyTrajectory,
Expand Down Expand Up @@ -48,5 +49,6 @@ fn lox_space(m: &Bound<'_, PyModule>) -> PyResult<()> {
m.add_class::<PyTopocentric>()?;
m.add_class::<PySeries>()?;
m.add_class::<PyObservables>()?;
m.add_class::<PySpk>()?;
Ok(())
}

0 comments on commit c039ea4

Please sign in to comment.