Accessing .xyzv Files From .cel Scripts

Post requests, images, descriptions and reports about work in progress here.
Topic author
adamod
Posts: 10
Joined: 14.05.2006
Age: 71
With us: 18 years 6 months
Location: Houston, TX

Accessing .xyzv Files From .cel Scripts

Post #1by adamod » 13.12.2009, 03:00

I'm using Celestia v1.6.0 with Mac OS X v10.4.11. I have a .cel script running with a .ssc file referencing a .xyz file using the statement SampledOrbit "apollo11fr.xyz". When I replace this statement with SampledTrajectory { Source "apollo11fr.xyzv" }, the spacecraft I'm trying to define no longer registers with Celestia. The .xyzv file has records with the following format.

2440419.17699340 6342.390 -2652.075 -1515.881 2.073760979 8.839564755 5.423678269

I'd really like to take advantage of .xyzv files to fly customized trajectories, but they don't appear interchangeable with .xyz files in spite of indications from the Cassini extras-standard/ example that they are. What am I missing?

-Dan
Dan Adamo

Avatar
selden
Developer
Posts: 10192
Joined: 04.09.2002
With us: 22 years 3 months
Location: NY, USA

Re: Accessing .xyzv Files From .cel Scripts

Post #2by selden » 13.12.2009, 13:47

xyzv trajectory files are used by Celestia v1.6.0 to describe the trajectories of the Cassini and Huygens Saturn probes. They're in the extras-standard directory. They're used in a Timeline structure, but hopefully you can modify that appropriately.
Selden

Topic author
adamod
Posts: 10
Joined: 14.05.2006
Age: 71
With us: 18 years 6 months
Location: Houston, TX

Re: Accessing .xyzv Files From .cel Scripts

Post #3by adamod » 13.12.2009, 15:57

Thanks for the suggestion, Seldon. Using the Cassini script example, which runs beautifully BTW, I constructed the appended .ssc file. It registers the apollo11fr spacecraft successfully. When I disable the SampledOrbit command and enable the SampledTrajectory command, however, the spacecraft fails to register. I remain stumped.

Code: Select all

"apollo11fr" "Sol/Earth"
{
   Class "spacecraft"
   Mesh "apollo.3ds"
#   Radius 0.011 # Actual dimension when attitude is known
   Radius 0.000000001 # Microscopic

Timeline [

   {

   Beginning "1969 07 16 16:18:13"
        Ending    "1969 07 22 14:40:00"

   OrbitFrame { EquatorJ2000 { Center "Sol/Earth" } }
#   SampledTrajectory { Source "apollo11fr.xyzv" }
   SampledOrbit "apollo11fr.xyz"
   FixedRotation { Inclination 70 AscendingNode -90 }

   }

   ]

}
Dan Adamo

Avatar
selden
Developer
Posts: 10192
Joined: 04.09.2002
With us: 22 years 3 months
Location: NY, USA

Re: Accessing .xyzv Files From .cel Scripts

Post #4by selden » 13.12.2009, 16:11

Have you looked at Celestia's "console log"?
It might have a useful error message.
Type a tilde (~) to toggle it, up- and down-arrows to navigate.
Selden

Topic author
adamod
Posts: 10
Joined: 14.05.2006
Age: 71
With us: 18 years 6 months
Location: Houston, TX

Re: Accessing .xyzv Files From .cel Scripts

Post #5by adamod » 13.12.2009, 16:49

Thanks again, Seldon. Appended is what the Console showed as my .ssc file was loading with the SampledTrajectory command enabled. Looks like I'm missing an "orbit" in my timeline, but I don't know what that means in terms of syntax. Does this lead to a diagnosis?

Loading solar system catalog: extras/apollo11fr.ssc
Could not load sampled trajectory from 'apollo11fr.xyzv'
Error: missing orbit in timeline phase.
Error in timeline of 'apollo11fr', phase 1
Dan Adamo

Avatar
selden
Developer
Posts: 10192
Joined: 04.09.2002
With us: 22 years 3 months
Location: NY, USA

Re: Accessing .xyzv Files From .cel Scripts

Post #6by selden » 13.12.2009, 17:19

"It works fine for me."

Are you putting the xyzv file in your addon's own \data\ subdirectory?

I used this test_xyzv.ssc

Code: Select all

"apollo11fr" "Sol/Earth"
{
   Class "spacecraft"
   Mesh "apollo.3ds"
   Radius 0.011 # Actual dimension when attitude is known

   OrbitFrame { EquatorJ2000 { Center "Sol/Earth" } }
   SampledTrajectory { Source "apollo11fr.xyzv" }
#   SampledOrbit "apollo11fr.xyz"
   FixedRotation { Inclination 70 AscendingNode -90 }
}

and this apollo11fr.xyzv

Code: Select all

2440419.17699340 6342.390 -2652.075 -1515.881 2.073760979 8.839564755 5.423678269
2440419.17699341 6342.391 -2652.076 -1515.882 2.073760979 8.839564755 5.423678269


I put test_xyzv.ssc in the folder
extras\test_xyzv\
I put apollo11fr.xyzv in the folder
extras\test_xyzv\data\
I put apollo.3ds in the folder
extras\test_xyzv\models\

And using this URL
cel://Follow/Sol:Earth:apollo11fr/2009- ... rc=0&ver=3
It looks like this:
Selden

Topic author
adamod
Posts: 10
Joined: 14.05.2006
Age: 71
With us: 18 years 6 months
Location: Houston, TX

Re: Accessing .xyzv Files From .cel Scripts

Post #7by adamod » 13.12.2009, 18:24

From what you've given me, Seldon, my problem is definitely confined to the format of .xyzv files created on my computer. The records you supplied in your last posting work when copied and pasted into my .xyzv file. If I use records created on my computer, apollo11fr fails to register. Is there some record termination format requirement for .xyzv files that's not shared with .xyz files? My records currently terminate with a single CR (ASCII code 13 decimal) byte, but I can program anything that works if I know what that is.
Dan Adamo

Avatar
selden
Developer
Posts: 10192
Joined: 04.09.2002
With us: 22 years 3 months
Location: NY, USA

Re: Accessing .xyzv Files From .cel Scripts

Post #8by selden » 13.12.2009, 18:57

If you have bare CarriageReturns as line terminators, that's because you're running on a Mac. (Although that that should not make any difference.) I'm wondering if there's a difference in the I/O runtime library which is causing problems, since you're the first to report this kind of problem.

My understanding was that line terminators are supposed to be irrelevant in Celestia's data files, except insofar as they act as terminators for numeric elements. You might try inserting a space after the last number on a line to see if that helps, since "white space" is a terminator for numeric strings. I'd guess that a bare LineFeed should act as both numeric and line terminator, too, since it's defined to be the ASCII "new line" code, and is what is used in Unix and Linux.
Selden

Topic author
adamod
Posts: 10
Joined: 14.05.2006
Age: 71
With us: 18 years 6 months
Location: Houston, TX

Re: Accessing .xyzv Files From .cel Scripts

Post #9by adamod » 13.12.2009, 21:46

I just tried appending a space to all the Z-velocity components, as the CR byte does immediately follow them in the original .xyzv file. That failed to clear the problem. If pointed at the pertinent Celestia code, I'd be happy to try diagnosing what's going on.
Dan Adamo

Topic author
adamod
Posts: 10
Joined: 14.05.2006
Age: 71
With us: 18 years 6 months
Location: Houston, TX

Re: Accessing .xyzv Files From .cel Scripts

Post #10by adamod » 13.12.2009, 22:50

Microsoft to the rescue! I used Word to save the original .xyzv file with LF-only record termination, and apollo11fr registers with Celestia OK. I still can't say why my .xyz files register OK with CR-only record termination, but I appear to have a .xyzv workaround under Mac OS.
Dan Adamo


Return to “Add-on development”