Ephemeris File Using Wrong NAIF ID

Post here for assistance in troubleshooting a problem using GMAT

Ephemeris File Using Wrong NAIF ID

Postby salbert » Mon Jun 11, 2018 2:07 pm

I am currently working on outputting an ephemeris file for the final solution from two different optimization scripts and using a third GMAT script to run a spacecraft along those ephemeris files to demonstrate the end-to-end trajectory. The issue I am having is that GMAT seemingly ignores the NAIF ID I specify and uses the ID for a different spacecraft in the script instead. I break down this issue into specifics below. Has anyone had this issue before? Is there somewhere in my script that my original NAIF ID could be getting overwritten?

My script uses #include to define several spacecraft objects in a separate file. In that file, I define two spacecraft, scSpaceProbe and scSpaceProbe_Dummy. The code includes these lines:

Code: Select all
Create Spacecraft scSpaceProbe;
GMAT scSpaceProbe.NAIFId = -12345678;

Create Spacecraft scSpaceProbe_Dummy;
GMAT scSpaceProbe_Dummy.NAIFId = -11000001;

As the name implies, scSpaceProbe_Dummy is used for optimization purposes, not the final solution. For this reason, I specifically want the ephemeris from scSpaceprobe. So, when creating my ephemeris file in the main script, I include the lines below:

Code: Select all
Create EphemerisFile EphemFile;
GMAT EphemFile.FileFormat = SPK;
GMAT EphemFile.Spacecraft = scSpaceProbe;

If I change the code to output a CCSDS-OEM file instead, I can confirm the output is for scSpaceProbe. Despite this, when I use the NAIF SPICE toolkit to run brief on my resulting SPK file, it reports the NAIF ID of scSpaceProbe_Dummy. Also, when I use the SPK file as input in my animation script, the program will only run when I use the dummy NAIF ID, rather than the correct ID I am trying to use.

Please let me know if you've had this issue before, even if you are not yet aware of a solution. I can't upload much code for proprietary reasons, but I can upload snippets by request.

Posts: 1
Joined: Mon Jun 11, 2018 1:47 pm

Return to Troubleshooting

Who is online

Users browsing this forum: No registered users and 1 guest