How to change CSpice initial velocity from an Asteroid SPK file?

In summary, the conversation discusses using cspice to change the initial velocity of asteroid 7482 (1994 PC1) in order to predict its position in the future. The speaker mentions using Newton's calculations but experiencing errors over time, and then finding a solution through modifying c++ code from a GitHub link. They also mention the importance of unit conversion and using specific bsp files.
  • #1
forofo
4
1
TL;DR Summary
Change spice spk file velocity to determinate the position of an asteroid
Hello, I've made a SPK file for asteroid 7482 (1994 PC1) with Horizon. I wan't to change the initial velocity with cspice, because I want to know where it will be in a future time at the speed changed. (now I'm using Newtons calc but is slow an error increases with time). This is for calculating NEO's asteroid position desviation.
 
Astronomy news on Phys.org
  • #2
I found the answer: In this link https://github.com/fding/nbody (Newtonian mechanics and a four-order symplectic Candy-Rozmus integration), there is c++ code and phyton. I've modify the c++, so now I calc the inital positions and speeds with cspice and pass then to Newton candy with other asteroid speed. Then I run both to the future to see the asteroid distance to any planet. Just take care about units conversion, cspice frame(ECLIPJ2000) and obverser naif Solar System(0), Used de440.bsp and 2007482(1994 PC1).bsp
 
  • Informative
Likes berkeman
  • #3
You might want have APK Editor in your tool kit.
 

FAQ: How to change CSpice initial velocity from an Asteroid SPK file?

How do I access the initial velocity data from an Asteroid SPK file using CSpice?

To access the initial velocity data from an Asteroid SPK file using CSpice, you will need to use the spkgeo_c function. This function takes in the SPK file name, target body ID, and the time of interest as inputs and returns the state vector, which includes the initial velocity, of the target body at that time.

Can I change the initial velocity data in an Asteroid SPK file using CSpice?

Yes, you can change the initial velocity data in an Asteroid SPK file using CSpice. You will need to use the spkgeo_c function to retrieve the state vector, modify the velocity component, and then use the spkw08_c function to write the updated state vector back into the SPK file.

Do I need any additional information to change the initial velocity in an Asteroid SPK file?

Yes, in addition to the SPK file, you will also need the target body ID and the time of interest in order to change the initial velocity in an Asteroid SPK file using CSpice.

Is there a limit to how much I can change the initial velocity in an Asteroid SPK file using CSpice?

There is no limit to how much you can change the initial velocity in an Asteroid SPK file using CSpice. However, it is important to ensure that the new velocity values make physical sense and do not result in unrealistic trajectories.

Can I use CSpice to change the initial velocity of multiple asteroids in an SPK file at once?

Yes, you can use CSpice to change the initial velocity of multiple asteroids in an SPK file at once. You will need to loop through each asteroid and use the spkgeo_c and spkw08_c functions to retrieve and update the state vectors for each asteroid.

Back
Top