; ---------------------------------------------------------------------- ; Compute apparent zenith angle at 4000 Angstroms, given the ; true zenith angle in degrees. Return -99. if the true angle is ; too large (>80) to do an accurate calculation. Assume pressure=760 mm Hg ; and T=15 deg Celius, dry air, from CRC and other sources ; Returns apparent zenith angle in degrees. -tab 10oct2012 ; function gal_apparent_zenith_angle, tzd if ((tzd lt 0.)||(tzd gt 80.)) then return,-99. deg = !dpi / 180.d ;> azd=deg*(tzd) i=0 differr=1.0 ; while ((i lt 40)&&(differr gt 1.e-10)) do begin i = i + 1 oldazd = azd r = tan(azd) r = (58.16 * r) - (0.067 * r * r * r) azd = deg*(tzd) - deg*(r / 3600.) differr = ABS(( oldazd - azd )) endwhile if (i gt 39) then begin print,"===warning: gal_apparent_zenith_angle: too many iterations." return,-99. endif return, (azd)/deg end