NavList:
A Community Devoted to the Preservation and Practice of Celestial Navigation and Other Methods of Traditional Wayfinding
Re: Astronomical Refraction: Computational Method for All Zenith Angles
From: Marcel Tschudin
Date: 2005 Aug 19, 15:51 +0300
From: Marcel Tschudin
Date: 2005 Aug 19, 15:51 +0300
Fred, you wrote > I mentioned the "other planet" possibilities just for fun -- I hope you understood my comment > "OK, my thoughts were more related to our good old planet earth, ...? the same way.. Refering to your > I mentioned the "other planet" possibilities just ... to indicate the > generality of the result. That is also how I undertood it. Refering to your > Sticking to the terrestrial atmosphere, there are > still some options. Notice that the integration does not force you to use > any > particular index of refraction. All it requires is that you specify the > index > of refraction as a function of height --as in the function "getmu" in my > sample code. So for example, you could include variability of humidity > with > height if you consider that important (it's not important in navigational > applications but it might be in high precision astronomical simulations). I do completely agree with you. But to write a program correct and knowing what results to expect of it, depending on the data entered, is one thing, to have a low probability that those entered data correspond to the actual situation - as in the case of refraction at low altitudes - is an other. It is for this reason that I try to make my program as much correct as reasonably possible and add a warning that due to the actual conditions the results may differ. > You can > also look at what happens all across the visible spectrum. Consider the > case of > the star Sirius at 2 degrees altitude as seen from sea level. Its light is > white, so there are more or less equal contributions of red, green, and > blue. > Run the integration for three values of the "zero level" index of > refraction > for the three frequencies corresponding to those colors and see what you > get. > You should find that the image of Sirius is considerably stretched out. > It > becomes a little vertical spectral "stripe", 20 to 30 arcseconds in > length. > Setting aside the large variability in refraction at such low altitudes, > this is > another reason why there's no use fussing over a couple of tenths of a > minute in refraction tables very close to the horizon. It is acually for this reason that I changed there your code slighly by defining the refractive index used in "getmu" as an input variable to the program. > By the way, not too surprisingly, my code lost its nice neat indentation > for > the two loops when it went through the list processor. I assume it is > still > comprehensible although a little less readable. Let me know if you have > any > difficulty translating from the version of Basic I used. The transcription was no problem thanks to the detailed comments you added in your code. There was only one little change necessary. This relates to the radius r and rnew in relation to the "getr loop": In Basic: .. r = REarth + 20000 'a fairly arbitrary seed value... DO 'getr loop follows: DO ... rnew = r - F / dFdr IF ABS(rnew - r) < drtest THEN EXIT DO r = rnew LOOP dlmdlr = (r / mu) * dmudr ... psi = psi + dpsi LOOP UNTIL psi >= psi0 ..... Which became in Delphi: ... rnew := REarth + 20000.0; // a fairly arbitrary seed value... repeat // Start: P S I - L o o p // getr loop follows: repeat // Start: g e t R - L o o p r := rnew; ... rnew := r - F / dFdr; until ABS(rnew - r) < drtest; // End : g e t R - L o o p dlmdlr := (r / mu) * dmudr; .... psi := psi + dpsi; until (psi >= psi0); // End : P S I - L o o p ..... The program works with the simplified atmospheric model "getmu" and the results look "reasonable". It remains now trying to introduce the atmospheric model as described in the paper. > I also use Delphi/Pascal, though less often now... The next-to-last > version of the > "CentenniaHistorical Atlas" (see my web site) was coded in Delphi. The components you used on your Web page look really very familiar... It is only for those dialogues with the user that I started to use this Delphi, otherwise I would have preferred to go on with Fortran, which I used previously for a long time. Now, having used Delphi for numbers of years, I would have difficulties to switch back to Fortran. Marcel