Skip to content

Commit

Permalink
Rename analysis script and add analysis for Hermite test
Browse files Browse the repository at this point in the history
Signed-off-by: Christopher Rabotin <[email protected]>
  • Loading branch information
ChristopherRabotin committed Dec 2, 2022
1 parent 16fa548 commit 42c4862
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 5 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ jobs:
- name: Test (no default features and release)
run: cargo test --no-default-features --release


lints:
name: Lints
runs-on: ubuntu-latest
Expand Down Expand Up @@ -122,17 +121,18 @@ jobs:

- name: Rust-SPICE hermite validation
run: RUST_BACKTRACE=full RUST_LOG=debug cargo test validate_hermite_translation --features validation --release -- --nocapture

# Now analyze the results and create pretty plots
- uses: actions/setup-python@v4
with:
python-version: '3.10'
python-version: "3.10"

- name: Validation analysis
run: |
cd analysis
pip install -r requirements.txt
python de_val_err.py
python spk_type2_jplde_val_err.py
python spk_type13_val_err.py
- name: Save validation artifacts
uses: actions/upload-artifact@v3
Expand Down
36 changes: 36 additions & 0 deletions analysis/spk_type13_val_err.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
import pandas as pd
import plotly.express as px
from os.path import abspath, join, dirname

if __name__ == '__main__':

target_folder = join(abspath(dirname(__file__)), '..', 'target')

for name, filename in [("validation", "type13-validation-test-results"),
("outliers", "type13-validation-outliers")]:

# Load the parquet file
df = pd.read_parquet(f"{target_folder}/{filename}.parquet")

if name == 'validation':
y = 'relative error'
else:
y = 'absolute error'

for kind, columns in [("Position", ["X", "Y", "Z"]),
("Velocity", ["VX", "VY", "VZ"])]:

print(f"== {kind} {name} ==")

subset = df.loc[df.component.isin(columns)]

print(subset.describe())

plt = px.scatter(subset,
x='File delta T (s)',
y=y,
color='source frame')

plt.write_html(
f"{target_folder}/{name}-{kind}-validation.html")
plt.show()
File renamed without changes.

0 comments on commit 42c4862

Please sign in to comment.