Comments (2)
chbint.c should work!
from anise.
Woop! This works, I just had to figure out where exactly to fetch the data. The velocity is still wrong, but the position is as good as what the other test has!
let interval_length: f64 = exb_states.window_duration;
let epoch_jde = epoch.as_jde_tdb_days();
let delta_jde = epoch_jde - start_mod_julian_f64;
let index_f = (delta_jde / interval_length).floor();
// let mut offset = delta_jde - index_f * interval_length;
// let index_f = (delta_jde / interval_length).floor();
let mut offset = delta_jde - delta_jde.floor();
// let mut offset = delta_jde - (delta_jde / interval_length).floor() * interval_length;
let mut index = (delta_jde / interval_length).floor() as usize;
if index == exb_states.position.len() {
index -= 1;
offset = interval_length;
} else if index > exb_states.position.len() {
return Err(NyxError::NoInterpolationData(format!(
"No interpolation data for date {}",
epoch
)));
}
let pos_coeffs = &exb_states.position[index];
let rcrd_radius_s = interval_length / 2.0;
let s = (epoch_jde - (start_mod_julian_f64 + index_f * interval_length + rcrd_radius_s))
/ rcrd_radius_s;
let s2 = 2.0 * s;
let mut j = coefficient_count;
let mut w = [0.0_f64; 3];
let mut dw = [0.0_f64; 3];
while j > 1 {
w[2] = w[1];
w[1] = w[0];
w[0] = pos_coeffs.x[j - 1] + (s2 * w[1] - w[2]);
dw[2] = dw[1];
dw[1] = dw[0];
dw[0] = w[1] * 2. + dw[1] * s2 - dw[2];
j -= 1;
}
let x = pos_coeffs.x[0] + (s * w[0] - w[1]);
let vx = w[0] + s * dw[0] - dw[1];
With code above, for X and VX:
[src/cosmic/cosm.rs:1120] ven2ear_state.x - 2.051_262_195_720_077_5e8 = -0.0004665851593017578
[src/cosmic/cosm.rs:1121] ven2ear_state.vx - 3.605_137_427_817_783e1 = 258.123891015126
Nominal code:
running 1 test
[src/cosmic/cosm.rs:1115] ven2ear_state.x - 2.051_262_195_720_077_5e8 = -0.0004665553569793701
[src/cosmic/cosm.rs:1116] ven2ear_state.vx - 3.605_137_427_817_783e1 = 1.9305446130601922e-10
test cosmic::cosm::tests::test_debug ... ok
from anise.
Related Issues (20)
- Python interface HOT 1
- Trajectory structure and event finding
- Load a metakernel from its path
- Remote loads from MetaAlmanac hang forever in Python HOT 1
- Small velocity errors in light time correction and stellar aberration
- ANISE Notebook tutorials for getting started
- [Python] Documentation notebook for Orbit (and Keplerian elements) and AER computations
- Python needs a `MetaAlmanac::default()` equivalent
- Moon frame simplifications
- Expose rotation parameters to Python
- Modify and truncate DAF files
- README tutorial not working HOT 5
- Query almanac for validity domain
- Allow loading from MetaFile
- Github language statistics are skewed by Jupyter Notebook files HOT 3
- IAU rotations of Neptune and Uranus do not match SPICE
- Solar "observer" angle calculation HOT 1
- Nyx usability alterations
- Add universal gravitational constant to constants.rs HOT 10
- Clone and modify data sets of all kind HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from anise.