Skip to content

Commit

Permalink
README: add section on runtime debug support (site update)
Browse files Browse the repository at this point in the history
  • Loading branch information
attipaci committed Sep 22, 2024
1 parent 19746dd commit aa50be9
Showing 1 changed file with 23 additions and 1 deletion.
24 changes: 23 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ This document has been updated for the `v1.1` release.
- [Notes on precision](#precision)
- [SuperNOVAS specific features](#supernovas-features)
- [External Solar-system ephemeris data or services](#solarsystem)
- [Runtime debug support](#debug-support)
- [Release schedule](#release-schedule)


Expand Down Expand Up @@ -579,7 +580,7 @@ calculated. The argument can have one of two values, which correspond to typical
| `enum novas_accuracy` value | Typical precision |
| ---------------------------- | -------------------------------- |
| `NOVAS_REDUCED_ACCURTACY` | ~ 1 milli-arcsecond (mas) |
| `NOVAS_REDUCED_ACCURACY` | ~ 1 milli-arcsecond (mas) |
| `NOVAS_FULL_ACCURACY` | below 1 micro-arcsecond (μas) |
Note, that some functions will not support full accuracy calculations, unless you have provided a high-precision
Expand Down Expand Up @@ -1008,6 +1009,27 @@ most generic way to add your preferred implementations while also providing some
_other users_ of the library, who may not need _your_ ephemeris service, or have no need for planet data beyond the
approximate positions for the Earth and Sun.
-----------------------------------------------------------------------------
<a name="debug-support"></a>
## Runtime debug support
You can enable or disable debugging output to `stderr` with `novas_debug(enum novas_debug_mode)`, where the argument
is one of the defined constants from `novas.h`:
| `novas_debug_mode` value | Description |
| -------------------------- | -------------------------------------------------- |
| `NOVAS_DEBUG_OFF` | No debugging output (_default_) |
| `NOVAS_DEBUG_ON` | Prints error messages and traces to `stderr` |
| `NOVAS_DEBUG_EXTRA` | Same as above but with stricter error checking |
The main difference between `NOVAS_DEBUG_ON` and `NOVAS_DEBUG_EXTRA` is that the latter will treat minor issues as
errors also, while the former may ignore them. For example, `place()` will return normally by default if it cannot
calculate gravitational bending around massive planets in full accuracy mode. It is unlikely that this omission would
significantly alter the result in most cases, except for some very specific ones when observing in a direction close
to a major planet. Thus, with `NOVAS_DEBUG_ON`, `place()` go about as usual even if the Jupiter's position is not
known. However, `NOVAS_DEBUG_EXTRA` will not give it a free pass, and will make `place()` return an error (and print
the trace) if it cannot properly account for gravitational bending around the major planets as it is expected to.
-----------------------------------------------------------------------------
Expand Down

0 comments on commit aa50be9

Please sign in to comment.