NavList:
A Community Devoted to the Preservation and Practice of Celestial Navigation and Other Methods of Traditional Wayfinding
Ephemeris & positional astronomy Windows DLL
From: Paul Hirose
Date: 2006 Jul 19, 01:47 -0500
I have a Windows DLL which may be useful to programmers who need
ephemeris and positional astronomy routines. It has three main components:
• IAU SOFA library, latest release (Sept. 2005). The SOFA documentation
says, "SOFA stands for 'Standards Of Fundamental Astronomy'. The SOFA
software libraries are a collection of subprograms, in source-code form,
which implement official IAU algorithms for fundamental-astronomy
computations. The subprograms at present comprise 69 'astronomy'
routines supported by 52 'vector/matrix' routines, all written in Fortran."
http://www.iau-sofa.rl.ac.uk/
• NASA Jet Propulsion Laboratory planetary and lunar ephemeris
functions. From 1984 the positions of the planets, Sun, and Moon in the
Astronomical Almanac have come from the JPL DE/LE ephemerides. These are
data files and not part of the DLL. However, after you download the
ASCII files from the JPL site, the DLL can convert them to binary format
and compute positions to full accuracy.
http://ssd.jpl.nasa.gov/?ephemerides#planets
• Hipparcos catalog data for the 150 brightest stars (all stars mag. 2.8
and brighter), and all the navigational stars. The US Naval Observatory
says of the Hipparcos catalog, "The positional accuracies of 1 to 3 mas
[milli arc second] at epoch 1991.25 are unsurpassed in the optical.
Proper motion accuracies, of around 1 to 2 mas/yr, remain state of the
art." I've converted a subset of the data (available at the Hipparcos
web site) to a built-in star catalog.
http://www.rssd.esa.int/Hipparcos/
In addition, the DLL has supplementary functions for time scales,
coordinate systems, apparent place, refraction, etc. Notably, UTC, as
the most widely distributed precise time scale, is given the respect it
deserves. There are adequate functions to convert between UTC and the
usual TT and TDB astronomical time scales. These functions work
correctly even in obscure corners of UTC, for example, during (not only
before and after) a leap second. They are controlled by a table which
contains all leap seconds, and prior to 1972, the fractional second step
adjustments and rate offsets. The table can be updated from a text file
supplied by the user.
The package includes C language source code for a demonstration program.
A successful compile and run verifies that you are able to link to the
DLL. The source code provides numerous examples of DLL usage, from
elementary time scale conversions to rigorous reductions.
In general, the demonstration follows the same sequence as the Almanac:
calendars and time scales, Earth orientation (sidereal time, obliquity,
nutation), planetary, solar, and stellar apparent place reductions, Moon
and Sun coordinates, planetary coordinates, and bright star coordinates.
When practical, the examples print the expected value (from the Almanac
or some other authoritative source) below the computed data for
comparison. In every case they agree within 1 digit in the last place.
The program also shows how to use the DLL star catalog. It has functions
to input additional stars from user-provided files, and to write the
catalog to disk. The file format is text with comma separated values,
compatible with most databases and spreadsheets.
To extract data from the catalog you must have the star's Hipparcos
catalog (HIP) number, so the DLL includes an index which cross
references star names to HIP. Stars may be looked up by proper name
(some have more than one variant), Bayer designation, Flamsteed number,
or navigation number. Designations follow the conventions of the CDS
SIMBAD online database: "NAME ARCTURUS", "* alf Boo", "* 16 Boo", and
"NAV 37" all refer to HIP 69673. You can customize this index; it has
the same file read/write functions as the star catalog. E.g., you
could add "SAO 100944" as another designator for Arcturus.
The default star catalog and name index are embedded in the DLL and both
are automatically present at startup. When you augment them with
additional data from disk, self-expanding data structures automatically
acquire storage from the operating system as needed. Maximum size is
limited only by system resources.
Star positions are corrected for proper motion to the target epoch. The
star does not have to be in the catalog. If you have the coordinates,
parallax, and proper motion of any real or imaginary star at a known
epoch and coordinate frame (e.g., mean equator at some date), that will
work just as well. The catalog just saves you the trouble of supplying
those values.
The output coordinates may have their origin at the solar system
barycenter, the geocenter, or the topocenter, as you wish. In the latter
two cases, annual parallax is applied. If apparent place is selected,
annual and dinural aberration and relativistic light deflection by the
Sun's gravity are applied too.
The coordinate frame may be oriented to the ICRS or GCRS, the true
equator and equinox, the true equator and intermediate origin, the mean
equator and equinox, the ecliptic and equinox (mean or true), the
terrestrial reference system (geodetic equator and prime meridian), or
the observer's local horizontal. (The latter two orientations make sense
for terrestrial origins only.) Frame epoch is independent of the star's
epoch. For example, you can express a present-day star position in the
true equatorial frame of some past or future date.
The mean equator may be based on the IAU 1976 or IAU 2000 precession
model. The true equator may be based on the IAU 1980 nutation model
(used in MICA), IAU 2000A (1400 terms, accurate to .2 mas, used in the
Astronomical Almanac), or the simpler IAU 2000B (accurate to 1 mas).
For Earth-fixed frames the polar motion or "Chandler wobble" (amplitude
.3 arc sec) is significant in precise work; you can input the x and y
coordinates of the pole, available online from the IERS. For a
horizontal frame you can input the deflection of the vertical. (The
National Geodetic Survey has an online calculator covering U.S. territory.)
Planet, Sun, and Moon computations have the same features, plus
correction for geocentric parallax, and the option to include or exclude
light time. That is, you can get the body's geometric, astrometric, or
apparent place.
All apparent place computions use the rigorous vector and matrix
algorithms in the Astronomical Almanac.
This DLL will be easiest for C or C++ programmers. The demo program is
written in C. All the needed .h files are supplied with extensive
comments. (In fact, the demo program and .h files are the DLL's
"documentation".) I've also provided the .lib file that your linker will
need.
It's possible to call the DLL from other languages, because it uses the
"stdcall" function call convention. That's the Windows API convention
too, so Windows programs which can call outside routines invariably
support stdcall.
I've successfully compiled and run the demonstration program under
Windows XP with MinGW (a Windows port of the GNU compiler), and
Microsoft Visual C++ Express. It also compiles and runs perfectly under
Windows 98 SE with an old Metrowerks C++ compiler.
Although the DLL was built with a port of the GNU compiler, for
technical reasons the usual GNU software terms are not applicable. It's
explained at the MinGW site.
I'm not releasing the complete source code at this time, though I may do
so later. The SOFA and JPL source code is online at their web sites already.
With this DLL, precise computations are much easier, but "easier" does
not equal "easy"! I learned that many times while writing the
demonstration program, to my chagrin. And don't expect too much from
that program. It's a set of examples which run in sequence without
pausing, and write their output to the screen. There's no user
interaction. However, it is designed so you will often be able to get a
quick and dirty solution by copying the appropriate function and
modifying it.
The DLL was written primarily for my personal use. I'm not marketing a
product and I have no ambitions of building a user community. However,
you're welcome to use the DLL for free. My copyright terms allow you to
use, distribute, and modify the sofware, as long as I get credit and
it's not for profit. Because the IAU SOFA code is a key component,
you're also bound by their license, which is about the same deal.
Reply by direct email if you want the DLL. Do not send your message to
the NavList unless you have a question or comment which may be
interesting to other members. And please don't quote this whole message.
If you simply ask me to send "the DLL" I will understand what you want.
Expect an email with a .zip file attached. It will include the DLL and
related files (the demonstration program source code etc.), total size
about 500 k.
--
I block messages that contain attachments or HTML.
--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to NavList@fer3.com
To , send email to NavList-@fer3.com
-~----------~----~----~----~------~----~------~--~---
From: Paul Hirose
Date: 2006 Jul 19, 01:47 -0500
I have a Windows DLL which may be useful to programmers who need
ephemeris and positional astronomy routines. It has three main components:
• IAU SOFA library, latest release (Sept. 2005). The SOFA documentation
says, "SOFA stands for 'Standards Of Fundamental Astronomy'. The SOFA
software libraries are a collection of subprograms, in source-code form,
which implement official IAU algorithms for fundamental-astronomy
computations. The subprograms at present comprise 69 'astronomy'
routines supported by 52 'vector/matrix' routines, all written in Fortran."
http://www.iau-sofa.rl.ac.uk/
• NASA Jet Propulsion Laboratory planetary and lunar ephemeris
functions. From 1984 the positions of the planets, Sun, and Moon in the
Astronomical Almanac have come from the JPL DE/LE ephemerides. These are
data files and not part of the DLL. However, after you download the
ASCII files from the JPL site, the DLL can convert them to binary format
and compute positions to full accuracy.
http://ssd.jpl.nasa.gov/?ephemerides#planets
• Hipparcos catalog data for the 150 brightest stars (all stars mag. 2.8
and brighter), and all the navigational stars. The US Naval Observatory
says of the Hipparcos catalog, "The positional accuracies of 1 to 3 mas
[milli arc second] at epoch 1991.25 are unsurpassed in the optical.
Proper motion accuracies, of around 1 to 2 mas/yr, remain state of the
art." I've converted a subset of the data (available at the Hipparcos
web site) to a built-in star catalog.
http://www.rssd.esa.int/Hipparcos/
In addition, the DLL has supplementary functions for time scales,
coordinate systems, apparent place, refraction, etc. Notably, UTC, as
the most widely distributed precise time scale, is given the respect it
deserves. There are adequate functions to convert between UTC and the
usual TT and TDB astronomical time scales. These functions work
correctly even in obscure corners of UTC, for example, during (not only
before and after) a leap second. They are controlled by a table which
contains all leap seconds, and prior to 1972, the fractional second step
adjustments and rate offsets. The table can be updated from a text file
supplied by the user.
The package includes C language source code for a demonstration program.
A successful compile and run verifies that you are able to link to the
DLL. The source code provides numerous examples of DLL usage, from
elementary time scale conversions to rigorous reductions.
In general, the demonstration follows the same sequence as the Almanac:
calendars and time scales, Earth orientation (sidereal time, obliquity,
nutation), planetary, solar, and stellar apparent place reductions, Moon
and Sun coordinates, planetary coordinates, and bright star coordinates.
When practical, the examples print the expected value (from the Almanac
or some other authoritative source) below the computed data for
comparison. In every case they agree within 1 digit in the last place.
The program also shows how to use the DLL star catalog. It has functions
to input additional stars from user-provided files, and to write the
catalog to disk. The file format is text with comma separated values,
compatible with most databases and spreadsheets.
To extract data from the catalog you must have the star's Hipparcos
catalog (HIP) number, so the DLL includes an index which cross
references star names to HIP. Stars may be looked up by proper name
(some have more than one variant), Bayer designation, Flamsteed number,
or navigation number. Designations follow the conventions of the CDS
SIMBAD online database: "NAME ARCTURUS", "* alf Boo", "* 16 Boo", and
"NAV 37" all refer to HIP 69673. You can customize this index; it has
the same file read/write functions as the star catalog. E.g., you
could add "SAO 100944" as another designator for Arcturus.
The default star catalog and name index are embedded in the DLL and both
are automatically present at startup. When you augment them with
additional data from disk, self-expanding data structures automatically
acquire storage from the operating system as needed. Maximum size is
limited only by system resources.
Star positions are corrected for proper motion to the target epoch. The
star does not have to be in the catalog. If you have the coordinates,
parallax, and proper motion of any real or imaginary star at a known
epoch and coordinate frame (e.g., mean equator at some date), that will
work just as well. The catalog just saves you the trouble of supplying
those values.
The output coordinates may have their origin at the solar system
barycenter, the geocenter, or the topocenter, as you wish. In the latter
two cases, annual parallax is applied. If apparent place is selected,
annual and dinural aberration and relativistic light deflection by the
Sun's gravity are applied too.
The coordinate frame may be oriented to the ICRS or GCRS, the true
equator and equinox, the true equator and intermediate origin, the mean
equator and equinox, the ecliptic and equinox (mean or true), the
terrestrial reference system (geodetic equator and prime meridian), or
the observer's local horizontal. (The latter two orientations make sense
for terrestrial origins only.) Frame epoch is independent of the star's
epoch. For example, you can express a present-day star position in the
true equatorial frame of some past or future date.
The mean equator may be based on the IAU 1976 or IAU 2000 precession
model. The true equator may be based on the IAU 1980 nutation model
(used in MICA), IAU 2000A (1400 terms, accurate to .2 mas, used in the
Astronomical Almanac), or the simpler IAU 2000B (accurate to 1 mas).
For Earth-fixed frames the polar motion or "Chandler wobble" (amplitude
.3 arc sec) is significant in precise work; you can input the x and y
coordinates of the pole, available online from the IERS. For a
horizontal frame you can input the deflection of the vertical. (The
National Geodetic Survey has an online calculator covering U.S. territory.)
Planet, Sun, and Moon computations have the same features, plus
correction for geocentric parallax, and the option to include or exclude
light time. That is, you can get the body's geometric, astrometric, or
apparent place.
All apparent place computions use the rigorous vector and matrix
algorithms in the Astronomical Almanac.
This DLL will be easiest for C or C++ programmers. The demo program is
written in C. All the needed .h files are supplied with extensive
comments. (In fact, the demo program and .h files are the DLL's
"documentation".) I've also provided the .lib file that your linker will
need.
It's possible to call the DLL from other languages, because it uses the
"stdcall" function call convention. That's the Windows API convention
too, so Windows programs which can call outside routines invariably
support stdcall.
I've successfully compiled and run the demonstration program under
Windows XP with MinGW (a Windows port of the GNU compiler), and
Microsoft Visual C++ Express. It also compiles and runs perfectly under
Windows 98 SE with an old Metrowerks C++ compiler.
Although the DLL was built with a port of the GNU compiler, for
technical reasons the usual GNU software terms are not applicable. It's
explained at the MinGW site.
I'm not releasing the complete source code at this time, though I may do
so later. The SOFA and JPL source code is online at their web sites already.
With this DLL, precise computations are much easier, but "easier" does
not equal "easy"! I learned that many times while writing the
demonstration program, to my chagrin. And don't expect too much from
that program. It's a set of examples which run in sequence without
pausing, and write their output to the screen. There's no user
interaction. However, it is designed so you will often be able to get a
quick and dirty solution by copying the appropriate function and
modifying it.
The DLL was written primarily for my personal use. I'm not marketing a
product and I have no ambitions of building a user community. However,
you're welcome to use the DLL for free. My copyright terms allow you to
use, distribute, and modify the sofware, as long as I get credit and
it's not for profit. Because the IAU SOFA code is a key component,
you're also bound by their license, which is about the same deal.
Reply by direct email if you want the DLL. Do not send your message to
the NavList unless you have a question or comment which may be
interesting to other members. And please don't quote this whole message.
If you simply ask me to send "the DLL" I will understand what you want.
Expect an email with a .zip file attached. It will include the DLL and
related files (the demonstration program source code etc.), total size
about 500 k.
--
I block messages that contain attachments or HTML.
--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to NavList@fer3.com
To , send email to NavList-@fer3.com
-~----------~----~----~----~------~----~------~--~---