Skip to content

Commit

Permalink
Update docs to include examples, plots, and scrape examples
Browse files Browse the repository at this point in the history
  • Loading branch information
ChristopherRabotin committed Aug 2, 2024
1 parent c3d3129 commit f917080
Show file tree
Hide file tree
Showing 13 changed files with 36 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,16 @@ jobs:
uses: dtolnay/rust-toolchain@master
with:
toolchain: nightly
- run: cargo doc --no-deps -Zunstable-options -Zrustdoc-scrape-examples
- run: cargo doc --no-deps --examples -Z rustdoc-scrape-examples
- name: Copy plots directories
run: |
for example_dir in examples/*; do
if [ -d "$example_dir/plots" ]; then
example_name=$(basename $example_dir)
mkdir -p target/doc/$example_name/plots
cp -r $example_dir/plots/* target/doc/$example_name/plots/
fi
done
- uses: FirebaseExtended/action-hosting-deploy@v0
with:
repoToken: '${{ secrets.GITHUB_TOKEN }}'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,16 @@ jobs:
uses: dtolnay/rust-toolchain@master
with:
toolchain: nightly
- run: cargo doc --no-deps -Zunstable-options -Zrustdoc-scrape-examples
- run: cargo doc --no-deps --examples -Z rustdoc-scrape-examples
- name: Copy plots directories
run: |
for example_dir in examples/*; do
if [ -d "$example_dir/plots" ]; then
example_name=$(basename $example_dir)
mkdir -p target/doc/$example_name/plots
cp -r $example_dir/plots/* target/doc/$example_name/plots/
fi
done
- uses: FirebaseExtended/action-hosting-deploy@v0
with:
repoToken: '${{ secrets.GITHUB_TOKEN }}'
Expand Down
5 changes: 5 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -104,19 +104,24 @@ cargo-args = ["-Zunstable-options", "-Zrustdoc-scrape-examples"]
[[example]]
name = "01_orbit_prop"
path = "examples/01_orbit_prop/main.rs"
doc-scrape-examples = true

[[example]]
name = "02_jwst"
path = "examples/02_jwst_covar_monte_carlo/main.rs"
doc-scrape-examples = true

[[example]]
name = "03_geo_drift"
path = "examples/03_geo_analysis/drift.rs"
doc-scrape-examples = true

[[example]]
name = "03_geo_raise"
path = "examples/03_geo_analysis/raise.rs"
doc-scrape-examples = true

[[example]]
name = "03_geo_sk"
path = "examples/03_geo_analysis/stationkeeping.rs"
doc-scrape-examples = true
6 changes: 3 additions & 3 deletions examples/01_orbit_prop/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ The force models used here are akin to STK's "HPOP" propagator. Specifically, th

In two body propagation, all orbital elements remain constant apart from the true anomaly. In real life, the oblateness of the Earth causes the right ascension of the ascending node to drift with time (red line below). The other force models also affect the overall orbit.

![RAAN, AOP, INC over time](./cubesat-angles-v-time.png)
![RAAN, AOP, INC over time](./plots/cubesat-angles-v-time.png)

![SMA (km) over time](./cubesat-sma-v-time.png)
![SMA (km) over time](./plots/cubesat-sma-v-time.png)

![ECC over time](./cubesat-ecc-v-time.png)
![ECC over time](./plots/cubesat-ecc-v-time.png)

_Note_: These plots were generated with an SRP area of that was ten times larger than the correct value, hence you may notice slightly different Keplerian orbital elements, notably for the change in the shape of the orbit.
1 change: 1 addition & 0 deletions examples/01_orbit_prop/main.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#![doc = include_str!("./README.md")]
extern crate log;
extern crate nyx_space as nyx;
extern crate pretty_env_logger as pel;
Expand Down
1 change: 1 addition & 0 deletions examples/02_jwst_covar_monte_carlo/main.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#![doc = include_str!("./README.md")]
extern crate log;
extern crate nyx_space as nyx;
extern crate pretty_env_logger as pel;
Expand Down
1 change: 1 addition & 0 deletions examples/03_geo_analysis/drift.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#![doc = include_str!("./README.md")]
extern crate log;
extern crate nyx_space as nyx;
extern crate pretty_env_logger as pel;
Expand Down
1 change: 1 addition & 0 deletions examples/03_geo_analysis/raise.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#![doc = include_str!("./README.md")]
extern crate log;
extern crate nyx_space as nyx;
extern crate pretty_env_logger as pel;
Expand Down
1 change: 1 addition & 0 deletions examples/03_geo_analysis/stationkeeping.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#![doc = include_str!("./README.md")]
extern crate log;
extern crate nyx_space as nyx;
extern crate pretty_env_logger as pel;
Expand Down
6 changes: 3 additions & 3 deletions src/dynamics/orbital.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ pub struct OrbitalDynamics {
}

impl OrbitalDynamics {
/// Initialize point mass dynamics given the EXB IDs and a Cosm
/// Initializes the point masses gravities with the provided list of bodies
pub fn point_masses(celestial_objects: Vec<i32>) -> Self {
// Create the point masses
Self::new(vec![PointMasses::new(celestial_objects)])
Expand Down Expand Up @@ -176,15 +176,15 @@ pub struct PointMasses {
}

impl PointMasses {
/// Initializes the multibody point mass dynamics with the provided list of bodies
/// Initializes the point masses gravities with the provided list of bodies
pub fn new(celestial_objects: Vec<i32>) -> Arc<Self> {
Arc::new(Self {
celestial_objects,
correction: None,
})
}

/// Initializes the multibody point mass dynamics with the provided list of bodies, and accounting for some light time correction
/// Initializes the point masses gravities with the provided list of bodies, and accounting for some light time correction
pub fn with_correction(celestial_objects: Vec<i32>, correction: Aberration) -> Self {
Self {
celestial_objects,
Expand Down

0 comments on commit f917080

Please sign in to comment.