This formula will work up to a zenith angle of 80 degrees after which the computation id not done. UT - Time, in hours to add to JD to get the correct Universal Time. ALT - Optional return of the altitude for each airmass. LHA - Optional return of the local hour angle. LST - Optional return of the local sidereal time.
Return value is the airmass in single precision.
Any input may be a vector. If more than one is a vector then the lengths must match. The return will have the same dimensions as the input. Hardie is still included as an option. Also added refraction to the calculation which added numerous inputs.