Skip to content

Commit

Permalink
Merge pull request #348 from nyx-space/gh-346-bis
Browse files Browse the repository at this point in the history
Allow 100 nanosecond leeway in querying DAF files
  • Loading branch information
ChristopherRabotin authored Nov 5, 2024
2 parents 2086cc6 + 6f43aa9 commit e5b8d3e
Show file tree
Hide file tree
Showing 18 changed files with 66 additions and 52 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/benchmarks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
wget -O data/de430.bsp http://public-data.nyxspace.com/anise/de430.bsp
wget -O data/de440s.bsp http://public-data.nyxspace.com/anise/de440s.bsp
wget -O data/de440.bsp http://public-data.nyxspace.com/anise/de440.bsp
wget -O data/pck08.pca http://public-data.nyxspace.com/anise/v0.4/pck08.pca
wget -O data/pck08.pca http://public-data.nyxspace.com/anise/v0.5/pck08.pca
wget -O data/gmat-hermite.bsp http://public-data.nyxspace.com/anise/ci/gmat-hermite.bsp
wget -O data/gmat-hermite-big-endian.bsp http://public-data.nyxspace.com/anise/ci/gmat-hermite-big-endian.bsp
wget -O data/variable-seg-size-hermite.bsp http://public-data.nyxspace.com/anise/ci/variable-seg-size-hermite.bsp
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ jobs:
wget -O data/de430.bsp http://public-data.nyxspace.com/anise/de430.bsp
wget -O data/de440s.bsp http://public-data.nyxspace.com/anise/de440s.bsp
wget -O data/de440.bsp http://public-data.nyxspace.com/anise/de440.bsp
wget -O data/pck08.pca http://public-data.nyxspace.com/anise/v0.4/pck08.pca
wget -O data/pck11.pca http://public-data.nyxspace.com/anise/v0.4/pck11.pca
wget -O data/pck08.pca http://public-data.nyxspace.com/anise/v0.5/pck08.pca
wget -O data/pck11.pca http://public-data.nyxspace.com/anise/v0.5/pck11.pca
- uses: actions/setup-python@v5
with:
Expand Down Expand Up @@ -226,8 +226,8 @@ jobs:
wget -O data/de430.bsp http://public-data.nyxspace.com/anise/de430.bsp
wget -O data/de440s.bsp http://public-data.nyxspace.com/anise/de440s.bsp
wget -O data/de440.bsp http://public-data.nyxspace.com/anise/de440.bsp
wget -O data/pck08.pca http://public-data.nyxspace.com/anise/v0.4/pck08.pca
wget -O data/pck11.pca http://public-data.nyxspace.com/anise/v0.4/pck11.pca
wget -O data/pck08.pca http://public-data.nyxspace.com/anise/v0.5/pck08.pca
wget -O data/pck11.pca http://public-data.nyxspace.com/anise/v0.5/pck11.pca
- name: Build sdist
uses: PyO3/maturin-action@v1
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@ jobs:
wget -O data/de440s.bsp http://public-data.nyxspace.com/anise/de440s.bsp
wget -O data/de440.bsp http://public-data.nyxspace.com/anise/de440.bsp
wget -O data/de440_type3.bsp http://public-data.nyxspace.com/anise/de440_type3.bsp
wget -O data/pck08.pca http://public-data.nyxspace.com/anise/v0.4/pck08.pca
wget -O data/pck11.pca http://public-data.nyxspace.com/anise/v0.4/pck11.pca
wget -O data/moon_fk.epa http://public-data.nyxspace.com/anise/v0.4/moon_fk.epa
wget -O data/pck08.pca http://public-data.nyxspace.com/anise/v0.5/pck08.pca
wget -O data/pck11.pca http://public-data.nyxspace.com/anise/v0.5/pck11.pca
wget -O data/moon_fk.epa http://public-data.nyxspace.com/anise/v0.5/moon_fk.epa
wget -O data/moon_pa_de440_200625.bpc http://public-data.nyxspace.com/anise/moon_pa_de440_200625.bpc
wget -O data/gmat-hermite.bsp http://public-data.nyxspace.com/anise/ci/gmat-hermite.bsp
wget -O data/gmat-hermite-big-endian.bsp http://public-data.nyxspace.com/anise/ci/gmat-hermite-big-endian.bsp
Expand Down Expand Up @@ -111,8 +111,8 @@ jobs:
wget -O data/de440s.bsp http://public-data.nyxspace.com/anise/de440s.bsp
wget -O data/de440.bsp http://public-data.nyxspace.com/anise/de440.bsp
wget -O data/de440_type3.bsp http://public-data.nyxspace.com/anise/de440_type3.bsp
wget -O data/pck08.pca http://public-data.nyxspace.com/anise/v0.4/pck08.pca
wget -O data/pck11.pca http://public-data.nyxspace.com/anise/v0.4/pck11.pca
wget -O data/pck08.pca http://public-data.nyxspace.com/anise/v0.5/pck08.pca
wget -O data/pck11.pca http://public-data.nyxspace.com/anise/v0.5/pck11.pca
wget -O data/gmat-hermite.bsp http://public-data.nyxspace.com/anise/ci/gmat-hermite.bsp
wget -O data/gmat-hermite-big-endian.bsp http://public-data.nyxspace.com/anise/ci/gmat-hermite-big-endian.bsp
wget -O data/variable-seg-size-hermite.bsp http://public-data.nyxspace.com/anise/ci/variable-seg-size-hermite.bsp
Expand Down Expand Up @@ -185,8 +185,8 @@ jobs:
wget -O data/de440s.bsp http://public-data.nyxspace.com/anise/de440s.bsp
wget -O data/de440.bsp http://public-data.nyxspace.com/anise/de440.bsp
wget -O data/de440_type3.bsp http://public-data.nyxspace.com/anise/de440_type3.bsp
wget -O data/pck08.pca http://public-data.nyxspace.com/anise/v0.4/pck08.pca
wget -O data/pck11.pca http://public-data.nyxspace.com/anise/v0.4/pck11.pca
wget -O data/pck08.pca http://public-data.nyxspace.com/anise/v0.5/pck08.pca
wget -O data/pck11.pca http://public-data.nyxspace.com/anise/v0.5/pck11.pca
wget -O data/gmat-hermite.bsp http://public-data.nyxspace.com/anise/ci/gmat-hermite.bsp
wget -O data/gmat-hermite-big-endian.bsp http://public-data.nyxspace.com/anise/ci/gmat-hermite-big-endian.bsp
wget -O data/variable-seg-size-hermite.bsp http://public-data.nyxspace.com/anise/ci/variable-seg-size-hermite.bsp
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,9 @@ For convenience, Nyx Space provides a few important SPICE files on a public buck

+ [de440s.bsp](http://public-data.nyxspace.com/anise/de440s.bsp): JPL's latest ephemeris dataset from 1900 until 20250
+ [de440.bsp](http://public-data.nyxspace.com/anise/de440.bsp): JPL's latest long-term ephemeris dataset
+ [pck08.pca](http://public-data.nyxspace.com/anise/v0.4/pck08.pca): planetary constants ANISE (`pca`) kernel, built from the JPL gravitational data [gm_de431.tpc](http://public-data.nyxspace.com/anise/gm_de431.tpc) and JPL's plantary constants file [pck00008.tpc](http://public-data.nyxspace.com/anise/pck00008.tpc)
+ [pck11.pca](http://public-data.nyxspace.com/anise/v0.4/pck11.pca): planetary constants ANISE (`pca`) kernel, built from the JPL gravitational data [gm_de431.tpc](http://public-data.nyxspace.com/anise/gm_de431.tpc) and JPL's plantary constants file [pck00011.tpc](http://public-data.nyxspace.com/anise/pck00011.tpc)
+ [moon_fk.epa](http://public-data.nyxspace.com/anise/v0.4/moon_fk.epa): Euler Parameter ANISE (`epa`) kernel, built from the JPL Moon Frame Kernel `moon_080317.txt`
+ [pck08.pca](http://public-data.nyxspace.com/anise/v0.5/pck08.pca): planetary constants ANISE (`pca`) kernel, built from the JPL gravitational data [gm_de431.tpc](http://public-data.nyxspace.com/anise/gm_de431.tpc) and JPL's plantary constants file [pck00008.tpc](http://public-data.nyxspace.com/anise/pck00008.tpc)
+ [pck11.pca](http://public-data.nyxspace.com/anise/v0.5/pck11.pca): planetary constants ANISE (`pca`) kernel, built from the JPL gravitational data [gm_de431.tpc](http://public-data.nyxspace.com/anise/gm_de431.tpc) and JPL's plantary constants file [pck00011.tpc](http://public-data.nyxspace.com/anise/pck00011.tpc)
+ [moon_fk.epa](http://public-data.nyxspace.com/anise/v0.5/moon_fk.epa): Euler Parameter ANISE (`epa`) kernel, built from the JPL Moon Frame Kernel `moon_080317.txt`

You may load any of these using the `load()` shortcut that will determine the file type upon loading, e.g. `let almanac = Almanac::new("pck08.pca").unwrap();` or in Python `almanac = Almanac("pck08.pca")`. To automatically download remote assets, from the Nyx Cloud or elsewhere, use the MetaAlmanac: `almanac = MetaAlmanac("ci_config.dhall").process()` in Python.

Expand Down
18 changes: 9 additions & 9 deletions anise-gui/src/bpc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,15 @@ pub fn bpc_ui(
ui.label(name);
});

row.col(|ui| match orientation_name_from_id(summary.frame_id) {
Some(name) => {
ui.label(format!("{name} ({})", summary.frame_id));
}
None => {
ui.label(format!("{}", summary.frame_id));
}
});

row.col(|ui| {
if show_unix {
ui.text_edit_singleline(&mut format!(
Expand All @@ -80,15 +89,6 @@ pub fn bpc_ui(
};
});

row.col(|ui| match orientation_name_from_id(summary.frame_id) {
Some(name) => {
ui.label(format!("{name} ({})", summary.frame_id));
}
None => {
ui.label(format!("{}", summary.frame_id));
}
});

row.col(
|ui| match orientation_name_from_id(summary.inertial_frame_id) {
Some(name) => {
Expand Down
2 changes: 1 addition & 1 deletion anise-gui/src/ui.rs
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ impl eframe::App for UiApp {
egui::TopBottomPanel::top("header").show(ctx, |ui| {
ui.horizontal_centered(|ui| {
ui.vertical_centered(|ui| {
ui.heading("ANISE v0.4");
ui.heading("ANISE v0.5");
ui.label("A modern rewrite of NASA's SPICE toolkit");
ui.hyperlink_to("Contact", "https://7ug5imdtt8v.typeform.com/to/neFvVW3p");
ui.hyperlink_to(
Expand Down
2 changes: 1 addition & 1 deletion anise-py/anise.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ The MetaAlmanac will download the DE440s.bsp file, the PCK0008.PCA, the full Moo
# File list
- <http://public-data.nyxspace.com/anise/de440s.bsp>
- <http://public-data.nyxspace.com/anise/v0.4/pck08.pca>
- <http://public-data.nyxspace.com/anise/v0.5/pck08.pca>
- <http://public-data.nyxspace.com/anise/moon_pa_de440_200625.bpc>
- <https://naif.jpl.nasa.gov/pub/naif/generic_kernels/pck/earth_latest_high_prec.bpc>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,10 @@
", uri = \"http://public-data.nyxspace.com/anise/de440s.bsp\"\n",
"}\n",
", { crc32 = Some 2899443223\n",
", uri = \"http://public-data.nyxspace.com/anise/v0.4/pck11.pca\"\n",
", uri = \"http://public-data.nyxspace.com/anise/v0.5/pck11.pca\"\n",
"}\n",
", { crc32 = Some 2133296540\n",
", uri = \"http://public-data.nyxspace.com/anise/v0.4/moon_fk.epa\"\n",
", uri = \"http://public-data.nyxspace.com/anise/v0.5/moon_fk.epa\"\n",
"}\n",
", { crc32 = Some 1817759242\n",
", uri = \"http://public-data.nyxspace.com/anise/moon_pa_de440_200625.bpc\"\n",
Expand Down Expand Up @@ -238,7 +238,7 @@
"name": "stdout",
"output_type": "stream",
"text": [
"MetaAlmanac { files: [MetaFile { uri: \"http://public-data.nyxspace.com/anise/de440s.bsp\", crc32: Some(1921414410) }, MetaFile { uri: \"http://public-data.nyxspace.com/anise/v0.4/pck11.pca\", crc32: Some(2899443223) }, MetaFile { uri: \"http://public-data.nyxspace.com/anise/v0.4/moon_fk.epa\", crc32: Some(2133296540) }, MetaFile { uri: \"http://public-data.nyxspace.com/anise/moon_pa_de440_200625.bpc\", crc32: Some(1817759242) }, MetaFile { uri: \"https://naif.jpl.nasa.gov/pub/naif/generic_kernels/pck/earth_latest_high_prec.bpc\", crc32: None }] }\n"
"MetaAlmanac { files: [MetaFile { uri: \"http://public-data.nyxspace.com/anise/de440s.bsp\", crc32: Some(1921414410) }, MetaFile { uri: \"http://public-data.nyxspace.com/anise/v0.5/pck11.pca\", crc32: Some(2899443223) }, MetaFile { uri: \"http://public-data.nyxspace.com/anise/v0.5/moon_fk.epa\", crc32: Some(2133296540) }, MetaFile { uri: \"http://public-data.nyxspace.com/anise/moon_pa_de440_200625.bpc\", crc32: Some(1817759242) }, MetaFile { uri: \"https://naif.jpl.nasa.gov/pub/naif/generic_kernels/pck/earth_latest_high_prec.bpc\", crc32: None }] }\n"
]
}
],
Expand Down Expand Up @@ -502,7 +502,7 @@
"only_de440s = Almanac(\"../../data/de440s.bsp\").load(\"../../data/pck11.pca\")\n",
"print(only_de440s)\n",
"# Now load a PCA from the Nyx Space cloud\n",
"de440s_and_moon = only_de440s.load_from_metafile(MetaFile(\"http://public-data.nyxspace.com/anise/v0.4/moon_fk.epa\", 2133296540))\n",
"de440s_and_moon = only_de440s.load_from_metafile(MetaFile(\"http://public-data.nyxspace.com/anise/v0.5/moon_fk.epa\", 2133296540))\n",
"print(de440s_and_moon)"
]
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@
"\n",
"Here are the general steps:\n",
"\n",
"1. Load the latest Almanac, and check (by printing it) that it includes both EPA and PCA data. Else, load the moon_fk.epa file from the Nyx Space Cloud using a MetaFile with the URL <http://public-data.nyxspace.com/anise/v0.4/moon_fk.epa>.\n",
"1. Load the latest Almanac, and check (by printing it) that it includes both EPA and PCA data. Else, load the moon_fk.epa file from the Nyx Space Cloud using a MetaFile with the URL <http://public-data.nyxspace.com/anise/v0.5/moon_fk.epa>.\n",
"2. Define a time series over a year with a granularity of 12 hours. This crater is on the South Pole of the Moon, and its visibility is often below the horizon of an object as far north as Paris.\n",
"3. For each epoch, define Paris as an `Orbit` instance from its longitude and latitde (recall that the constants include the mean Earth angular rotation rate), in the IAU_EARTH frame. Also build the crater in the IAU_MOON frame.\n",
"4. Finally, call the AER function of the Almanac with each epoch to compute the AER data. Plot it!"
Expand Down
6 changes: 3 additions & 3 deletions anise/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -183,9 +183,9 @@ For convenience, Nyx Space provides a few important SPICE files on a public buck

+ [de440s.bsp](http://public-data.nyxspace.com/anise/de440s.bsp): JPL's latest ephemeris dataset from 1900 until 20250
+ [de440.bsp](http://public-data.nyxspace.com/anise/de440.bsp): JPL's latest long-term ephemeris dataset
+ [pck08.pca](http://public-data.nyxspace.com/anise/v0.4/pck08.pca): planetary constants ANISE (`pca`) kernel, built from the JPL gravitational data [gm_de431.tpc](http://public-data.nyxspace.com/anise/gm_de431.tpc) and JPL's plantary constants file [pck00008.tpc](http://public-data.nyxspace.com/anise/pck00008.tpc)
+ [pck11.pca](http://public-data.nyxspace.com/anise/v0.4/pck11.pca): planetary constants ANISE (`pca`) kernel, built from the JPL gravitational data [gm_de431.tpc](http://public-data.nyxspace.com/anise/gm_de431.tpc) and JPL's plantary constants file [pck00011.tpc](http://public-data.nyxspace.com/anise/pck00011.tpc)
+ [moon_fk.epa](http://public-data.nyxspace.com/anise/v0.4/moon_fk.epa): Euler Parameter ANISE (`epa`) kernel, built from the JPL Moon Frame Kernel `moon_080317.txt`
+ [pck08.pca](http://public-data.nyxspace.com/anise/v0.5/pck08.pca): planetary constants ANISE (`pca`) kernel, built from the JPL gravitational data [gm_de431.tpc](http://public-data.nyxspace.com/anise/gm_de431.tpc) and JPL's plantary constants file [pck00008.tpc](http://public-data.nyxspace.com/anise/pck00008.tpc)
+ [pck11.pca](http://public-data.nyxspace.com/anise/v0.5/pck11.pca): planetary constants ANISE (`pca`) kernel, built from the JPL gravitational data [gm_de431.tpc](http://public-data.nyxspace.com/anise/gm_de431.tpc) and JPL's plantary constants file [pck00011.tpc](http://public-data.nyxspace.com/anise/pck00011.tpc)
+ [moon_fk.epa](http://public-data.nyxspace.com/anise/v0.5/moon_fk.epa): Euler Parameter ANISE (`epa`) kernel, built from the JPL Moon Frame Kernel `moon_080317.txt`

You may load any of these using the `load()` shortcut that will determine the file type upon loading, e.g. `let almanac = Almanac::new("pck08.pca").unwrap();` or in Python `almanac = Almanac("pck08.pca")`. To automatically download remote assets, from the Nyx Cloud or elsewhere, use the MetaAlmanac: `almanac = MetaAlmanac("ci_config.dhall").process(true)` in Python.

Expand Down
2 changes: 1 addition & 1 deletion anise/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ fn main() {

let embedded_files = [
(
"http://public-data.nyxspace.com/anise/v0.4/pck11.pca",
"http://public-data.nyxspace.com/anise/v0.5/pck11.pca",
format!("{}/../data/pck11.pca", env!("CARGO_MANIFEST_DIR")),
),
(
Expand Down
12 changes: 6 additions & 6 deletions anise/src/almanac/metaload/metaalmanac.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ impl MetaAlmanac {
///
/// # File list
/// - <http://public-data.nyxspace.com/anise/de440s.bsp>
/// - <http://public-data.nyxspace.com/anise/v0.4/pck11.pca>
/// - <http://public-data.nyxspace.com/anise/v0.5/pck11.pca>
/// - <http://public-data.nyxspace.com/anise/moon_pa_de440_200625.bpc>
/// - <https://naif.jpl.nasa.gov/pub/naif/generic_kernels/pck/earth_latest_high_prec.bpc>
///
Expand Down Expand Up @@ -165,7 +165,7 @@ impl MetaAlmanac {
///
/// # File list
/// - <http://public-data.nyxspace.com/anise/de440s.bsp>
/// - <http://public-data.nyxspace.com/anise/v0.4/pck08.pca>
/// - <http://public-data.nyxspace.com/anise/v0.5/pck08.pca>
/// - <http://public-data.nyxspace.com/anise/moon_pa_de440_200625.bpc>
/// - <https://naif.jpl.nasa.gov/pub/naif/generic_kernels/pck/earth_latest_high_prec.bpc>
///
Expand Down Expand Up @@ -238,8 +238,8 @@ impl MetaAlmanac {
///
/// # File list
/// - <http://public-data.nyxspace.com/anise/de440s.bsp>
/// - <http://public-data.nyxspace.com/anise/v0.4/pck11.pca>
/// - <http://public-data.nyxspace.com/anise/v0.4/moon_fk.epa>
/// - <http://public-data.nyxspace.com/anise/v0.5/pck11.pca>
/// - <http://public-data.nyxspace.com/anise/v0.5/moon_fk.epa>
/// - <http://public-data.nyxspace.com/anise/moon_pa_de440_200625.bpc>
/// - <https://naif.jpl.nasa.gov/pub/naif/generic_kernels/pck/earth_latest_high_prec.bpc>
///
Expand All @@ -261,11 +261,11 @@ impl Default for MetaAlmanac {
crc32: Some(0x7286750a),
},
MetaFile {
uri: nyx_cloud_stor.join("v0.4/pck11.pca").unwrap().to_string(),
uri: nyx_cloud_stor.join("v0.5/pck11.pca").unwrap().to_string(),
crc32: Some(0x8213b6e9),
},
MetaFile {
uri: nyx_cloud_stor.join("v0.4/moon_fk.epa").unwrap().to_string(),
uri: nyx_cloud_stor.join("v0.5/moon_fk.epa").unwrap().to_string(),
crc32: Some(0xb93ba21),
},
MetaFile {
Expand Down
4 changes: 2 additions & 2 deletions anise/src/almanac/metaload/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -143,10 +143,10 @@ mod meta_test {
, uri = "http://public-data.nyxspace.com/anise/de440s.bsp"
}
, { crc32 = Some 0x8213b6e9
, uri = "http://public-data.nyxspace.com/anise/v0.4/pck11.pca"
, uri = "http://public-data.nyxspace.com/anise/v0.5/pck11.pca"
}
, { crc32 = Some 0xb93ba21
, uri = "http://public-data.nyxspace.com/anise/v0.4/moon_fk.epa"
, uri = "http://public-data.nyxspace.com/anise/v0.5/moon_fk.epa"
}
, { crc32 = Some 0xcde5ca7d
, uri = "http://public-data.nyxspace.com/anise/moon_pa_de440_200625.bpc"
Expand Down
Loading

0 comments on commit e5b8d3e

Please sign in to comment.