Readable .dat files?
-
Topic authorHungry4info
- Posts: 1133
- Joined: 11.09.2005
- With us: 19 years 2 months
- Location: Indiana, United States
Readable .dat files?
For fun, I'm making a fictional catalogue of stars using a java program, whose output is to a dat file. When I run the program, it generates the .dat file which I slip into the /extras/ folder.
Celestia doesn't read it =(.
How can I get Celestia to show .dat files that I make?
Celestia doesn't read it =(.
How can I get Celestia to show .dat files that I make?
Current Setup:
Windows 7 64 bit. Celestia 1.6.0.
AMD Athlon Processor, 1.6 Ghz, 3 Gb RAM
ATI Radeon HD 3200 Graphics
Windows 7 64 bit. Celestia 1.6.0.
AMD Athlon Processor, 1.6 Ghz, 3 Gb RAM
ATI Radeon HD 3200 Graphics
Re: Readable .dat files?
You'll probably have to replace the Celestia star.dat file with yours to make them show or turn that .dat file into an .stc file.
I'm just guess of course.
I'm just guess of course.
Re: Readable .dat files?
Celestia only uses a single stars.dat
If your file is in the correct binary format, you can replace the file that comes with Celestia.
Otherwise, create a textual STC file containing your star definitions.
If your file is in the correct binary format, you can replace the file that comes with Celestia.
Otherwise, create a textual STC file containing your star definitions.
Selden
-
Topic authorHungry4info
- Posts: 1133
- Joined: 11.09.2005
- With us: 19 years 2 months
- Location: Indiana, United States
Re: Readable .dat files?
Hmm. How in the world do I make a file in binary format?
Current Setup:
Windows 7 64 bit. Celestia 1.6.0.
AMD Athlon Processor, 1.6 Ghz, 3 Gb RAM
ATI Radeon HD 3200 Graphics
Windows 7 64 bit. Celestia 1.6.0.
AMD Athlon Processor, 1.6 Ghz, 3 Gb RAM
ATI Radeon HD 3200 Graphics
Re: Readable .dat files?
To create a binary file, you run a program which reads a textual input file and writes a binary file.
There is no specific format for binary files in general, each is different depending on the intent of the program's author.
Celestia's stars.dat is created using such a special program. It translates stars.txt into stars.dat
Unfortunately, SourceForge's svn archive is returning a "Bad Gateway" error to me right now,
so I can't point you to the program that's used.
There is no specific format for binary files in general, each is different depending on the intent of the program's author.
Celestia's stars.dat is created using such a special program. It translates stars.txt into stars.dat
Unfortunately, SourceForge's svn archive is returning a "Bad Gateway" error to me right now,
so I can't point you to the program that's used.
Selden
Re: Readable .dat files?
Selden's information is slightly out of date, that was how things worked before I got my hands on the star database and updated it to the new Hipparcos revision.
The program used is a Perl script: src/tools/stardb/buildstardb.pl. It builds stars.dat and stars.txt directly from the Hipparcos catalogue (mostly the new revision of the Hipparcos catalog CDS I/311, but the spectral types are from CDS I/298 since this information is not present in the new Hipparcos catalogue.)
I have described the format of stars.dat on the Celestia Wikibook here.
The program used is a Perl script: src/tools/stardb/buildstardb.pl. It builds stars.dat and stars.txt directly from the Hipparcos catalogue (mostly the new revision of the Hipparcos catalog CDS I/311, but the spectral types are from CDS I/298 since this information is not present in the new Hipparcos catalogue.)
I have described the format of stars.dat on the Celestia Wikibook here.
-
Topic authorHungry4info
- Posts: 1133
- Joined: 11.09.2005
- With us: 19 years 2 months
- Location: Indiana, United States
Re: Readable .dat files?
Is it possible to modify a perl script to take information from me? instead of from the Hipparcos database? Basically, I want to make a few million fictional stars, and I have come to the conclusion that .dat files load faster than .stc files.
While we're on the subject, is there any way to have .ssc files in .dat format?
While we're on the subject, is there any way to have .ssc files in .dat format?
Current Setup:
Windows 7 64 bit. Celestia 1.6.0.
AMD Athlon Processor, 1.6 Ghz, 3 Gb RAM
ATI Radeon HD 3200 Graphics
Windows 7 64 bit. Celestia 1.6.0.
AMD Athlon Processor, 1.6 Ghz, 3 Gb RAM
ATI Radeon HD 3200 Graphics
Re: Readable .dat files?
Yes that would be nice to convert those huge STC files used to populate other galaxies into DAT files. They take forever to load.
Re: Readable .dat files?
Hungry4info wrote:Hmm. How in the world do I make a file in binary format?
You need an HEX editor (there are lot for free on the net). Open the ASCII dat then save it as binary.
For some free HEX editors:
http://www.snapfiles.com/downloadfind.php?action=s&search.x=22&search.y=11&st=hex+editor
Never at rest.
Massimo
Massimo
-
Topic authorHungry4info
- Posts: 1133
- Joined: 11.09.2005
- With us: 19 years 2 months
- Location: Indiana, United States
Re: Readable .dat files?
Okay. I've downloaded AptEdit Pro ... and am uncertain just how to save my ASCII dat file as a bin file.
++++++++++++++
Also, is it possible to have .ssc files like this?
++++++++++++++
Also, is it possible to have .ssc files like this?
Current Setup:
Windows 7 64 bit. Celestia 1.6.0.
AMD Athlon Processor, 1.6 Ghz, 3 Gb RAM
ATI Radeon HD 3200 Graphics
Windows 7 64 bit. Celestia 1.6.0.
AMD Athlon Processor, 1.6 Ghz, 3 Gb RAM
ATI Radeon HD 3200 Graphics
Re: Readable .dat files?
If you figure out how to convert a txt to .DAT let me know please.
Also, how does one combine two .DAT files? For example if I were to convert a large .DAT would I be able to merge it with the one used by celestia?
Also, how does one combine two .DAT files? For example if I were to convert a large .DAT would I be able to merge it with the one used by celestia?
Re: Readable .dat files?
Hello
Searching in the forum I found the answer here.
http://www.shatters.net/forum/viewtopic.php?f=2&t=11625&p=94997&hilit=makestardb#p94997
I am very surprised that you forgot it, Reiko.
Then merging the two text files is easy with a command like:
copy /B stars1.txt + stars2.text stars.txt
Or the equivalent with your OS.
That gives you a merged text file that you can convert into a .dat file using the makestardb.exe utility.
Regards
Searching in the forum I found the answer here.
http://www.shatters.net/forum/viewtopic.php?f=2&t=11625&p=94997&hilit=makestardb#p94997
I am very surprised that you forgot it, Reiko.
Then merging the two text files is easy with a command like:
copy /B stars1.txt + stars2.text stars.txt
Or the equivalent with your OS.
That gives you a merged text file that you can convert into a .dat file using the makestardb.exe utility.
Regards
Re: Readable .dat files?
Oh yeah!! Thanksjogad wrote:Hello
Searching in the forum I found the answer here.
http://www.shatters.net/forum/viewtopic.php?f=2&t=11625&p=94997&hilit=makestardb#p94997
I am very surprised that you forgot it, Reiko.
Then merging the two text files is easy with a command like:
copy /B stars1.txt + stars2.text stars.txt
Or the equivalent with your OS.
That gives you a merged text file that you can convert into a .dat file using the makestardb.exe utility.
Regards
Re: Readable .dat files?
Is there something out there to do this with that isn't a command line utility? Most of the time I can never get them to work properly.
-
Topic authorHungry4info
- Posts: 1133
- Joined: 11.09.2005
- With us: 19 years 2 months
- Location: Indiana, United States
Re: Readable .dat files?
Yeah I'm having trouble getting makestarsdb to work properly. It says I need to specify the number of stars, but I'm unsure how it wants me to do it.
Current Setup:
Windows 7 64 bit. Celestia 1.6.0.
AMD Athlon Processor, 1.6 Ghz, 3 Gb RAM
ATI Radeon HD 3200 Graphics
Windows 7 64 bit. Celestia 1.6.0.
AMD Athlon Processor, 1.6 Ghz, 3 Gb RAM
ATI Radeon HD 3200 Graphics
Re: Readable .dat files?
Hello
Yes Hungry4info. To build a stars datafile you must specify yourself the number of stars in it.
The first line of your text file is the number of stars.
Then each line describes a particular star.
There are two possible formats for that.
The first one is more precise but data are a bit more difficult to interpret by us, poor humans beings, and more difficult to find. Each line contains the following data:
- # catalog HIP
- X Y and Z coordinates in light years
- ABSOLUTE magnitude of the star
- Spectral type
An easiest other way is to provide data as follows:
- # catalog HIP
- Right Ascension in decimal degrees
- Declination in decimal degrees
- Distance in light years
- RELATIVE magnitude of the star
- Spectral type
Data in a line are separated by spaces or tabulations.
In the first case you build your data file with
In the second case with
And for your Reiko I suppose that if you have trouble with command line it is because you operate under Windows.
It is possible to use command line without open a command window and get lost here.
Just put all files that you need in the same directory. Then make a text file witch contains the command line(s) and save it with a name witch ends by .bat. Don’t forget to end the last line of your command file by a carriage return. Double clicking on it will execute the command lines without quitting the GUI.
The command to make a text file from a stars data file is
A+
Yes Hungry4info. To build a stars datafile you must specify yourself the number of stars in it.
The first line of your text file is the number of stars.
Then each line describes a particular star.
There are two possible formats for that.
The first one is more precise but data are a bit more difficult to interpret by us, poor humans beings, and more difficult to find. Each line contains the following data:
- # catalog HIP
- X Y and Z coordinates in light years
- ABSOLUTE magnitude of the star
- Spectral type
An easiest other way is to provide data as follows:
- # catalog HIP
- Right Ascension in decimal degrees
- Declination in decimal degrees
- Distance in light years
- RELATIVE magnitude of the star
- Spectral type
Data in a line are separated by spaces or tabulations.
In the first case you build your data file with
Code: Select all
makestardb textfile datafile
In the second case with
Code: Select all
makestardb –s textfile datafile
And for your Reiko I suppose that if you have trouble with command line it is because you operate under Windows.
It is possible to use command line without open a command window and get lost here.
Just put all files that you need in the same directory. Then make a text file witch contains the command line(s) and save it with a name witch ends by .bat. Don’t forget to end the last line of your command file by a carriage return. Double clicking on it will execute the command lines without quitting the GUI.
The command to make a text file from a stars data file is
Code: Select all
startextfump stardatafile textfile
A+
Re: Readable .dat files?
It's probably better to work with stars.dat itself -- regard stars.txt as a human-readable view into stars.dat, however given the coordinates conversion (from rectangular to polar) and the conversion to decimal, generating stars.dat from stars.txt will probably result in slightly different positions.
I'm personally not convinced we need to keep stars.txt around in v1.6.0 -- it's a holdover from the old generation process; the new star database generation process does not need it at all, and it is a very large file that only serves to duplicate another large file.
I'm personally not convinced we need to keep stars.txt around in v1.6.0 -- it's a holdover from the old generation process; the new star database generation process does not need it at all, and it is a very large file that only serves to duplicate another large file.
Re: Readable .dat files?
Hi
You are perfectly right!
The method is possible but anyhow it is not correct to merge a text file with X, Y and Z coordinates with one containing AR, Dec and Distance.
Only the First format is acceptable. If we have' only AR, Dec, Distance and relative magnitudes, the conversion must be done in X, Y, Z and absolute magnitues before trying to build the data file.
With this method, there is no conversion and thus no precision loss. In fact I noticed a (very) little one, not in the coordinates, but curiously on the magnitude! (on the third decimal place).
But for an add-on it seems that the best method is always to make a stc file witch is human readable and preserves the original stars.
You are perfectly right!
The method is possible but anyhow it is not correct to merge a text file with X, Y and Z coordinates with one containing AR, Dec and Distance.
Only the First format is acceptable. If we have' only AR, Dec, Distance and relative magnitudes, the conversion must be done in X, Y, Z and absolute magnitues before trying to build the data file.
With this method, there is no conversion and thus no precision loss. In fact I noticed a (very) little one, not in the coordinates, but curiously on the magnitude! (on the third decimal place).
But for an add-on it seems that the best method is always to make a stc file witch is human readable and preserves the original stars.
-
- Site Admin
- Posts: 4211
- Joined: 28.01.2002
- With us: 22 years 9 months
- Location: Seattle, Washington, USA
Re: Readable .dat files?
ajtribick wrote:It's probably better to work with stars.dat itself -- regard stars.txt as a human-readable view into stars.dat, however given the coordinates conversion (from rectangular to polar) and the conversion to decimal, generating stars.dat from stars.txt will probably result in slightly different positions.
I'm personally not convinced we need to keep stars.txt around in v1.6.0 -- it's a holdover from the old generation process; the new star database generation process does not need it at all, and it is a very large file that only serves to duplicate another large file.
I agree with you. With the new process for generating stars.dat and the improvements to stc files, stars.txt is unnecessary now.
--Chris
Re: Readable .dat files?
Just a few short questions/suggestions on making a stars.dat for an addon.
I have also a huge load of data that I am currently converting to .STCs (~1200 entries [without a load of binaries])
Do I really need to assign them a HIP number?
I have the data in an X Y Z coordinate system, but I am not sure, if it is the same as used in Celestia. I tried to look that one up, but didn't find its center and orientation (yet).
Can I also define barycenters?
So, from these questions I'd like to edrive the following feature requests for future Celestia versions:
My 2 cents.
Regards,
Guckytos
I have also a huge load of data that I am currently converting to .STCs (~1200 entries [without a load of binaries])
Do I really need to assign them a HIP number?
I have the data in an X Y Z coordinate system, but I am not sure, if it is the same as used in Celestia. I tried to look that one up, but didn't find its center and orientation (yet).
Can I also define barycenters?
So, from these questions I'd like to edrive the following feature requests for future Celestia versions:
- Possibility to add user .dat files (binary or text) with addons
- define barycenters
- Possibility to use modify commands for already existing stars within these .dat files
My 2 cents.
Regards,
Guckytos