Skip to content

Commit e257d35

Browse files
committed
Some more additions and tweaks for CIRS handling
1 parent 7eac5ed commit e257d35

File tree

4 files changed

+340
-219
lines changed

4 files changed

+340
-219
lines changed

README-headless.md

+89-60
Original file line numberDiff line numberDiff line change
@@ -216,23 +216,14 @@ being unset in `config.mk`).
216216
<a name="examples"></a>
217217
## Basic usage examples
218218

219-
The IAU 2000 and 2006 resolutions have completely overhauled the system of astronomical coordinate transformations
220-
to enable higher precision astrometry. (Super)NOVAS supports coordinate calculations both in the old (pre IAU 2000)
221-
ways, and in the new IAU standard.
222-
223-
| Concept | Old standard | New IAU standard |
224-
| ========================== | ============================= | ================================================= |
225-
| Catalog coordinates | J2000 or B1950 | International Celestial Reference System (ICRS) |
226-
| Dynamical system | True of Date (TOD) | Celestial Intermediate Reference System (CIRS) |
227-
| Dynamical R.A. origin | true equinox of date | Celestial Intermediate Origin (CIO) |
228-
| Precession, nutation, bias | separate, no tidal terms | IAU 2006 precession/nutation model |
229-
| Celestial Pole offsets | d&psi;, d&epsilon; | _dx_, _dy_ |
230-
| Earth rotation measure | Greenwich Sidereal Time (GST) | Earth Rotation Angle (ERA) |
231-
| Fixed Earth System | WGS84 | International Terrestrial Reference System (ITRS) |
219+
- [Calculating positions for a sidereal source](#sidereal-example)
220+
- [Calculating positions for a Solar-system source](#solsys-example)
221+
- [Reduced accuracy shortcuts](#accuracy-notes)
222+
- [Performance considerations](#performance-note)
223+
- [Note on alternative methodologies](#methodologies)
232224

233-
See the various enums and constands defined in `novas.h`, as well as the descriptions on the various NOVAS routines
234-
on how they are appropriate for the old and new systems respectively.
235225

226+
<a name="sidereal-example"></a>
236227
### Calculating positions for a sidereal source
237228

238229
Sidereal sources may be anything beyond the solar-system with 'fixed' catalog coordinates. It may be a star, or a
@@ -286,8 +277,7 @@ measured based on Terrestrial Time (TT) or Barycentric Time (TDB) or UT1. So
286277
287278
// Calculate the Terrestrial Time (TT) based Julian date of observation (in days)
288279
// Let's say on 2024-02-06 at 14:53:06 UTC.
289-
double jd_tt = julian_date(2024, 2, 6, 14.885)
290-
+ get_utc_to_tt(leap_seconds) / 86400.0;
280+
double jd_tt = julian_date(2024, 2, 6, 14.885) + get_utc_to_tt(leap_seconds) / 86400.0;
291281
292282
// We'll also need the TT - UT1 difference, which we can obtain from what we already
293283
// defined above
@@ -318,7 +308,7 @@ distance (e.g. for apparent-to-physical size conversion):
318308
sky_pos pos; // We'll return the observable positions in this structure
319309
320310
// Calculate the apparent (CIRS) topocentric positions for the above configuration
321-
int status = place_cirs(jd_tt, &source, &obs, ut1_to_tt, NOVAS_FULL_ACCURACY, &pos);
311+
int status = place(jd_tt, &source, &obs, ut1_to_tt, NOVAS_CIRS, NOVAS_FULL_ACCURACY, &pos);
322312
323313
// You should always check that the calculation was successful...
324314
if(status) {
@@ -327,49 +317,34 @@ distance (e.g. for apparent-to-physical size conversion):
327317
}
328318
```
329319

330-
Finally, we may want to calculate the azimuth and elevation at which the source is visible from the ground at the
331-
specified observing location (with or without refraction correction):
320+
Finally, we may want to calculate the astrometric zenith distance (= 90&deg; - azimuth) and elevation angles of the source
321+
at the specified observing location (without refraction correction):
332322

333323
```c
334324

335325
// Zenith distance and azimuth (in degrees) to populate...
336326
double zd, az;
337327

338-
// Convert to horizontal using the pole offsets, and a standard atmpsphere for
339-
// the refraction. (We don't care to return refracted RA and dec coordinates).
340-
equ2hor(jd_tt - ut1_to_tt, ut1_to_tt, NOVAS_FULL_ACCURACY, dx, dy, &obs.on_surf,
341-
pos.ra, pos.dec, NOVAS_STANDARD_ATMOSPHERE, &zd, &az, NULL, NULL);
328+
// Convert CIRS to horizontal using the pole offsets.
329+
cirs_to_hor(jd_tt - ut1_to_tt, ut1_to_tt, NOVAS_FULL_ACCURACY, dx, dy, &obs.on_surf, pos.ra, pos.dec,
330+
&zd, &az);
342331
```
343332
344333
In the example above we first calculated the apparent coordinates in the Celestial Intermediate Reference System
345-
(CIRS). Then we used `equ2hor()` function then convert first it to the Earth-fixed International Terrestrial
334+
(CIRS). Then we used `cirs_to_hor()` function then convert first it to the Earth-fixed International Terrestrial
346335
Reference system (ITRS) using the small (arcsec-level) measured variation of the pole (dx, dy) provided explicitly
347-
since `equ2hor()` does not use the values previously set via `cel_pole()`. Finally, `equ2hor()` converts the ITRS
348-
coordinates to the horizontal system at the observer location, and applies the requested optical refraction
349-
correction for a standard atmosphere.
350-
351-
#### Reduced accuracy
352-
353-
When one does not need positions at the microarcsecond level, some shortcuts can be made to the recipe above:
354-
355-
- You can use `NOVAS_REDUCED_ACCURACY` instead of `NOVAS_FULL_ACCURACY` for the calculations. This typically has an
356-
effect at the milliarcsecond level only, but may be much faster to calculate.
357-
- You can skip the J2000 to ICRS conversion and use J2000 coordinates directly as a fair approximation (at the
358-
&lt;~ 22 mas level).
359-
- You might skip the pole offsets dx, dy. These are tenths of arcsec, typically.
360-
361-
#### Note on performance
336+
since `cirs_to_hor()` does not use the values previously set via `cel_pole()`. Finally, `cirs_to_hor()` converts the
337+
ITRScoordinates to the horizontal system at the observer location.
362338
363-
Some of the calculations involved can be expensive from a computational perspective. For the most typical use case
364-
however, NOVAS (and SuperNOVAS) has a trick up its sleve: it caches the last result of intensive calculations so they
365-
may be re-used if the call is made with the same environmental parameters again (such as JD time and accuracy).
366-
Therefore, when calculating positions for a large number of sources at different times:
339+
You can additionally apply an optical refraction correction for the astrometric (unrefracted) zenith angle, if you
340+
want, e.g.:
367341
368-
- It is best to iterate over the sources while keeping the time fixed in the inner loop.
369-
- You probably want to stick to one accuracy morde (`NOVAS_FULL_ACCURACY` or `NOVAS_REDUCED_ACCURACY`) to prevent
370-
re-calculating the same quantities repeatedly to alternating precision.
342+
```c
343+
zd -= refract_astro(&obs.on_surf, NOVAS_STANDARD_ATMOSPHERE, zd);
344+
```
371345

372346

347+
<a name="solsys-example"></a>
373348
### Calculating positions for a Solar-system source
374349

375350
Solar-system sources work similarly to the above with a few important differences.
@@ -417,14 +392,60 @@ more generic ephemeris handling via a user-provided `novas_ephem_reader_func`. E
417392
Other than that, it's the same spiel as before. E.g.:
418393
419394
```c
420-
int status = place_cirs(jd_tt, &mars, &obs, ut1_to_tt, NOVAS_FULL_ACCURACY, &pos);
395+
int status = place(jd_tt, &mars, &obs, ut1_to_tt, NOVAS_CIRS, NOVAS_FULL_ACCURACY, &pos);
421396
if(status) {
422397
// Ooops, something went wrong...
423398
...
424399
}
425400
```
426401

427402

403+
<a name="accuracy-notes"></a>
404+
#### Reduced accuracy shortcuts
405+
406+
When one does not need positions at the microarcsecond level, some shortcuts can be made to the recipe above:
407+
408+
- You can use `NOVAS_REDUCED_ACCURACY` instead of `NOVAS_FULL_ACCURACY` for the calculations. This typically has an
409+
effect at the milliarcsecond level only, but may be much faster to calculate.
410+
- You can skip the J2000 to ICRS conversion and use J2000 coordinates directly as a fair approximation (at the
411+
&lt;~ 22 mas level).
412+
- You might skip the pole offsets dx, dy. These are tenths of arcsec, typically.
413+
414+
<a name="performance-note"></a>
415+
#### Performance considerations
416+
417+
Some of the calculations involved can be expensive from a computational perspective. For the most typical use case
418+
however, NOVAS (and SuperNOVAS) has a trick up its sleve: it caches the last result of intensive calculations so they
419+
may be re-used if the call is made with the same environmental parameters again (such as JD time and accuracy).
420+
Therefore, when calculating positions for a large number of sources at different times:
421+
422+
- It is best to iterate over the sources while keeping the time fixed in the inner loop.
423+
- You probably want to stick to one accuracy morde (`NOVAS_FULL_ACCURACY` or `NOVAS_REDUCED_ACCURACY`) to prevent
424+
re-calculating the same quantities repeatedly to alternating precision.
425+
- If super-high accuracy is not required `NOVAS_REDUCED_ACCURACY` mode offers much faster calculations, in general.
426+
427+
428+
429+
<a name="methodologies"></a>
430+
### Note on alternative methodologies
431+
432+
The IAU 2000 and 2006 resolutions have completely overhauled the system of astronomical coordinate transformations
433+
to enable higher precision astrometry. (Super)NOVAS supports coordinate calculations both in the old (pre IAU 2000)
434+
ways, and in the new IAU standard method.
435+
436+
| Concept | Old standard | New IAU standard |
437+
| -------------------------- | ----------------------------- | ------------------------------------------------- |
438+
| Catalog coordinate system | J2000 or B1950 | International Celestial Reference System (ICRS) |
439+
| Dynamical system | True of Date (TOD) | Celestial Intermediate Reference System (CIRS) |
440+
| Dynamical R.A. origin | true equinox of date | Celestial Intermediate Origin (CIO) |
441+
| Precession, nutation, bias | separate, no tidal terms | IAU 2006 precession/nutation model |
442+
| Celestial Pole offsets | d&psi;, d&epsilon; | _dx_, _dy_ |
443+
| Earth rotation measure | Greenwich Sidereal Time (GST) | Earth Rotation Angle (ERA) |
444+
| Fixed Earth System | WGS84 | International Terrestrial Reference System (ITRS) |
445+
446+
See the various enums and constands defined in `novas.h`, as well as the descriptions on the various NOVAS routines
447+
on how they are appropriate for the old and new methodologies respectively.
448+
428449
-----------------------------------------------------------------------------
429450

430451

@@ -453,6 +474,10 @@ Other than that, it's the same spiel as before. E.g.:
453474
- SuperNOVAS prototypes declare function pointer arguments as `const` whenever the function does not modify the
454475
data content being pointed at. This supports better programming practices that generally aim to avoid unintended
455476
data modifications.
477+
478+
- New `cirs_to_hor()` function similar to the existing `equ2hor()`. Whereas the latter converts from TOD to
479+
to local horizontal (old methodology), the new function does the same from CIRS (new IAU standard methodology).
480+
As such it can be used after `place()` is called with `NOVAS_CIRS` as the coordinate system.
456481

457482
- Runtime configurability:
458483

@@ -489,36 +514,40 @@ Other than that, it's the same spiel as before. E.g.:
489514
<a name="precision"></a>
490515
## Notes on precision
491516

492-
The SuperNOVAS library is in principle capable of calculating positions and velocities to sub-microarcsecond precision
493-
for all types of celestial sources. However, there are certain pre-requisites and practical considerations before that
494-
level of accuracy is reached.
517+
The SuperNOVAS library is in principle capable of calculating positions to sub-microarcsecond, and velocities to mm/s
518+
precision for all types of celestial sources. However, there are certain pre-requisites and practical considerations
519+
before that level of accuracy is reached.
520+
495521

522+
1. __IAU 2000/2006 conventions__: High precision calculations will generally require that you use SuperNOVAS with the
523+
new IAU standard quantities and methods. The old ways were simply not suited for precisions much below the
524+
milliarcsecond level.
496525

497-
1. __Earth's polar motion__: Calculating precise positions for any Earth-based observations requires precise
526+
2. __Earth's polar motion__: Calculating precise positions for any Earth-based observations requires precise
498527
knowledge of Earth orientation at the time of observation. The pole is subject to predictable precession and
499528
nutation, but also small irregular variations in the orientation of the rotational axis and the rotation period
500529
(a.k.a polar wobble). The [IERS Bulletins](https://www.iers.org/IERS/EN/Publications/Bulletins/bulletins.html)
501530
provide up-to-date measurements, historical data, and near-term projections for the polar offsets and the UT1-UTC
502531
(DUT1) time difference and leap-seconds (UTC-TAI). In SuperNOVAS you can use `cel_pole()` and `get_ut1_to_tt()`
503-
functions to apply / use the published values from these to improve the astrometic precision of calls such as
504-
`calc_pos()`, or `topo_star()`. Without setting and using the actual polar offset values for the time of
532+
functions to apply / use the published values from these to improve the astrometic precision of Earth-orientation
533+
based coordinate calculations. Without setting and using the actual polar offset values for the time of
505534
observation, positions for Earth-based observations will be accurate at the arcsecond level only.
506535

507-
2. __Solar-system sources__: Precise calculations for Solar-system sources requires precise ephemeris data for both
536+
3. __Solar-system sources__: Precise calculations for Solar-system sources requires precise ephemeris data for both
508537
the target object as well as for Earth, and the Sun vs the Solar-system barycenter. For the highest precision
509538
calculations you also need positions for all major planets to calculate gravitational deflection precisely. By
510-
default SuperNOVAS can only provide approximate positions for the Earth and Sun (see `earth_sun_calc()` in
511-
`solsys3.c`), but certainly not at the sub-microarcsecond level, and not for other solar-system sources. You will
539+
default SuperNOVAS can only provide approximate positions for the Earth and Sun (see `earth_sun_calc()` in
540+
`solsys3.c`), but certainly not at the sub-microarcsecond level, and not for other solar-system sources. You will
512541
need to provide a way to interface SuperNOVAS with a suitable ephemeris source (such as the CSPICE toolkit from
513542
JPL) if you want to use it to obtain precise positions for Solar-system bodies. See the
514543
[section below](#solarsystem)for more information how you can do that.
515544

516-
3. __Refraction__: Ground based observations are also subject to atmospheric refraction. SuperNOVAS offers the
545+
4. __Refraction__: Ground based observations are also subject to atmospheric refraction. SuperNOVAS offers the
517546
option to include _optical_ refraction corrections in `equ2hor()` either for a standard atmosphere or more
518547
precisely using the weather parameters defined in the `on_surface` data structure that specifies the observer
519-
locations. Note, that refraction at radio wavelengths is notably different from the included optical value. In
548+
locations. Note, that refraction at radio wavelengths is notably different from the included optical model. In
520549
either case you may want to skip the refraction corrections offered in this library, and instead implement your
521-
own as appropriate.
550+
own as appropriate (or not at all).
522551

523552

524553
-----------------------------------------------------------------------------

0 commit comments

Comments
 (0)