Make refraction more robust if altitude is `nan`

From https://www.clearskyinstitute.com/xephem/contrib/contrib.html where
the patch is dated 2020 September.
This commit is contained in:
Lutz Mändle 2021-02-12 11:48:22 -05:00 committed by Brandon Rhodes
parent 16c59109d9
commit 099dc04e6c
1 changed files with 5 additions and 0 deletions

View File

@ -62,6 +62,11 @@ refract (double pr, double tr, double ta, double *aa)
double d, t, t0, a;
if (isnan (ta)) {
*aa = ta;
return;
}
/* first guess of error is to go backwards.
* make use that we know delta-apparent is always < delta-true.
*/