Make your own free website on

Welcome to the Asteroid Database (ASTORB.DAT) converter!

Where can I find asteroid data on the web?

Where can I find the ASTORB.DAT catalog?

How can I cut it down to size?

Patience! Patience!

This attempt at documentation briefly describes the purpose and use of AST2BIN.EXE.

First a little history...

Well, I had this asteroid locator program, see, that I wrote in the 80's and it needed updating. There was just one teeny-weeny thing wrong with it... All the asteroids were in the wrong place!

After some perusal of the source code (written with the Mark Williams LETS C compiler if you're interested)
(nah, I didn't think so)
I found I needed a source of RECENT asteroid elements to plot the positions of asteroids against a starry sky. The planet and asteroid elements I had were vintage 1980's stuff and woefully out of date.

Then I heard about the ASTORB.DAT file and Lowell Observatory...

And I said to myself...
"I just gotta get me one of those."

So I did. Via internet FTP
More than 3 megs of it. Ungzipped to 12 megs!.

Next problem concerned getting this information down to a more managable size.
So I wrote a program to search the database for asteroids of the right magnitude range that I could actually SEE in my 25cm reflector and put them in a binary file compatiable with my asteroid finder.

Then my hard disk crashed BIG TIME.

So I downloaded the catalog all over again. (sigh)

After I was done, I realised that others might like to do something similar.
Hence this release to the general public.

Don't all clap at once...

The Asteroid Orbital Elements Database

ASTORB.DAT is an ASCII file of high-precision osculating orbital elements, ephemeris uncertainties, and some additional data for all the numbered asteroids and the vast majority of unnumbered asteroids for which it is possible to make reasonably determinate computations. It is currently about 13 Mb gzipped and will take up over 30Mb of your precious hard disc space. The downloadable file (astorb.dat.gz), is based on astrometric observations from the Minor Planet Center, occupies one 265-column record for EACH asteroid.

That is one humungous file!

Downloading astorb.dat

Some of the following information was shamelessly pinched from Lowell Observatory web site...

The file may be obtained by the following means:

Find and run gzip.exe or gunzip.exe to produce the text file and rename (if necessary) to *.dat.
You should have: astorb.dat on your hard disc!




AST2BIN is my program that reads in ASTRORB.DAT and outputs a binary file suitable for use in my asteroid locator. This is version 1.0 of the program. It is an MSDOS program using Turbo C 2. (Oldie but goodie)

If it will not run on your WIN9x system, let me know and I can send a protected mode version written with DJGPP...


The version available here after March 12, 1999, fixes a bug introduced when ASTORB was altered slightly to account for asteroid numbers larger than 9,999. The extra digit fouled up my simple method (or short-sighted method) of reading the date string. Download the new version to use AST2BIN with a recent copy of astorb.dat.


ast2bin [catalog] [outfile] [format] [Limits] [Max]

Example: ast2bin astorb.dat astdat.bin jpath 13.0 1024

Note: the parameters are optional, but (if used) MUST be in the above order!

[catalog] The asteroid elements filename. Default is astorb.dat
[outfile] The output file name. default is astdat.bin
[format] The required format of the output file. Default is jph (see below)
[Limits] Magnitude limit, Hmag of asteroid. default is 99.0 (reads all entries).
[Max] Maximum number of asteroids to process.

AST2BIN with no parameters will use astorb.dat to create astdat.bin
with a list of all asteroids found of the file in binary format.

AST2BIN will provide default values for unused parameters, as shown in the example command line above.


The output format is user-specified by including a format string of characters (without spaces). AST2BIN recognises the following characters:

p . . Include my bodgy data for planets Mercury to Pluto as the first 8 entries.

a . .Append this data to an existing binary file.

t . . Text enable. An Additional text file is produced. (ast000.txt)

h . . Header. A 4 byte header is placed in the output file (Number of asteroids)

j . . Julian Opt for Epoc storage as a julian Day i.e 2450700 istead of 19970909.

[Limits...] If not specified, the default magnitude will accept all entries. To search the data for asteroids of a specified Hmag parameter or brighter, use a Limit of (say) 14.0 after the filenames and format code.

[Max] Maximum number of asteroids to store in the file.


Example 1:
To obtain all asteroids in astorb.dat and store them in an output file named astdat.bin...


Example 2:
To generate a text file as well, list asteroids with a Hmag parameter of 13.0 or brighter with the Epoc stored as a julian day number and a 4 byte header with the number of asteroids stored in the file...

ast2bin astorb.dat myfile.bin pthj 13.0

The text file will be called ast000.txt

Note: To generate a listing in other formats, please email me at and I will make a special version for you as time is available.


This is used in the new (coming soon, I promise!) version of asteroid.exe.

Each record is 84 bytes as used in ASTDAT.BIN
Some parameters are calculated and stored for quick reference.

long num;. . asteroids number (0 if unnumbered.)
char name[20]; what's it called?
long epoc; jdate of elements, ecliptic 2000, either 19970909 or 2450700
float p; (calculated) ORBITAL PERIOD
float g; mag slope factor
float bv; mag colour B-V
float diam; diameter km
float t; (calculated) time of peri passage
float h; std brightness Hmag
float m; mean anomaly at epoc, degrees
float w; argument of perihelion
float a; longitude of Asc. node
float i; inclination
float e; eccentricity
float n; (calculated) deg/day
float s; semi-major axis AU
float o; spare

OPTION D (latest revision)

Will store m, w, a, i, e, n, s as doubles (8 byte floating point) instead of 4 byte floats.
This will add 28 bytes to each record. Useful if the data has more than seven significant digits.

If you wish, I can use a "convert-to-long" kludge (OPTION K) to preserve precision without extending the file size.

Curious Visitors since July 2005

Return to Home Page

Asteroid Locator program

SPACE FX Animator