satvis
satvis copied to clipboard
question - other than TLE inputs
I'm just starting but it appears the only option for adding object is by loading TLE. Which leads me to believe the software is using SGP4 as the propagator.
I'm working a project where I simulate satellites uising numerical integration, but I propagate state vector (e.g. position, velocity) which I would like to visualize with satvis.
I'm going to keep digging but I wanted to ask if there were opther input options.
I figure worst case I create a dirty-TLE with COEs and update it from my simulation frequently.
Like many other javascript satellite programs, this relies on satellite.js for SGP4 propagation.
https://github.com/Flowm/satvis/blob/b7db88c1c8701f5a2594fa13cb820e452e8bd36d/src/modules/Orbit.js#L25
You could modify that section of the code to use your propagated values instead of the output from satellite.js. I would be very interested in hearing how you are calculating the position and velocity if not using SGP4. I believe this program calculates position and velocity using SGP4 every 1 second (notionally) and then relies on a basic position + velocity * time-since-last-screen-draw , which I think is what you are calling numerical integration.
The explanation and quoted section by @thkruz are exactly the place to start when another propagation method is desired.
Just one additional step: For performance reasons the positions are calculated in advance for the next time period with a sampling interval of 30s and then interpolated with a Cesium SampledPositionProperty every Cesium clock tick: https://github.com/Flowm/satvis/blob/11054d95c4e997f4d6db05ce86d5dd45674b47a2/src/modules/SatelliteProperties.js#L104
So either keep the existing interpolation logic and replace the propagation in https://github.com/Flowm/satvis/blob/11054d95c4e997f4d6db05ce86d5dd45674b47a2/src/modules/Orbit.js#L25
or alternatively directly set the position for the individual entities (e.g. the white point at the position of the satellite) in
https://github.com/Flowm/satvis/blob/73188f2f4d68d4b12b551d2c0e985a51ecf587d4/src/modules/SatelliteEntityWrapper.js#L93
const point = new Cesium.PointGraphics({
position: new Cesium.CallbackProperty((timeAsJulianDate) => {
return satellitePositionPropagatorThatReturnsACesiumCartesian3Object(timeAsJulianDate),
}, false),
pixelSize: 10,
color: Cesium.Color.WHITE,
});
Sry for the slow response. Did you ever get around to add your own propagation algorithm?
I'm glad to see the question. I'm confused about the parameter of samplesFwd and samplesBwd . How to set it and is it related to interval()? I hope you can answer it. Thanks.
The function uses interval (in seconds) as step size between samples and calculates samplesFwd position samples forward and samplesBwd position samples backward with the referenced SGP4 propagation mechanism (through satellitejs).
With the default values this function fills the SampledPositionProperty with the satellites position ranging 60min back (120 samplesBwd * 30s) from the current simulation time and 120min forward (240 samplesFwd * 30s).
This avoids any orbit calculations as long as the simulation time is within this timeframe as it relies on the interpolation of the Cesium SampledPositionProperty for interpolation between theses sample positions. (In reality a bit less as the orbit line also uses this sampled position and is also drawn forward and backward.)
Full code of the updateSampledPosition function for reference: https://github.com/Flowm/satvis/blob/11054d95c4e997f4d6db05ce86d5dd45674b47a2/src/modules/SatelliteProperties.js#L104-L150