Calculate the airmass

Plane-parallel atmosphere

PyAstronomy.pyasl.airmassPP(zangle)

Calculate airmass for plane parallel atmosphere.

Parameters
zanglefloat or array

The zenith angle in degrees.

Returns
Airmassfloat or array

The airmass assuming a plane parallel atmosphere.

Example: Airmass with plane-parallel atmosphere

from __future__ import print_function, division
from PyAstronomy import pyasl

print("Airmass for plane-parallel atmosphere")
for za in range(0,70,10):
  print("Zenith angle: %2d deg, airmass = %7.2f" % \
    (za, pyasl.airmassPP(za)))

Airmass for spherical, homogeneous atmosphere

PyAstronomy.pyasl.airmassSpherical(zangle, obsAltitude, rearth=6371.0, yatm=10.0)

Calculate the airmass for a given zenith angle and observer altitude.

This routine uses a geometric formula for a homogeneous, spherical atmosphere with an elevated observer.

Note

In this model, the airmass is not necessarily one toward the zenith.

Parameters
zanglefloat, array

Zenith angle of an object in deg.

obsAltitudefloat

Elevation of the observer in meter.

rearthfloat, optional

Earth’s radius in km.

yatmfloat, optional

Height of the atmosphere in km.

Returns
Airmassfloat or array

The airmass.

Example: Airmass with homogeneous, spherical atmosphere

from __future__ import print_function, division
from PyAstronomy import pyasl

obsAlt = 2400.0

for za in range(0,90,10):
  print("Zenith angle: %2d, airmass = %7.2f" % \
    (za, pyasl.airmassSpherical(za, obsAlt)))