captest.calcparams.absolute_airmass

captest.calcparams.absolute_airmass(data, apparent_zenith=None, pressure=None, pressure_scale=100, airmass_model='kastenyoung1989', verbose=True)

Compute absolute (pressure-corrected) airmass from apparent zenith.

Uses pvlib.atmosphere.get_relative_airmass() with the kastenyoung1989 model by default, then passes the result to pvlib.atmosphere.get_absolute_airmass(). If pressure is None the pvlib default (101325 Pa) is used; otherwise the column data[pressure] is scaled by pressure_scale (default 100 to convert hPa/mbar to Pa) and passed through.

When a pressure column is supplied, the scaled pressure values are sanity-checked against global surface-pressure records (PRESSURE_MIN_MBARPRESSURE_MAX_MBAR). The 5th and 95th percentiles are used to ignore isolated outliers from bad data. A UserWarning is emitted if the central 90% of values falls outside that band, which typically indicates a unit mismatch between data[pressure] and pressure_scale.

Parameters:
  • data (DataFrame) – DataFrame containing the apparent_zenith (and optionally pressure) columns.

  • apparent_zenith (str) – Column name for apparent zenith angle (degrees).

  • pressure (str or None, default None) – Column name for station pressure. None falls back to pvlib’s default sea-level pressure.

  • pressure_scale (numeric, default 100) – Multiplier applied to data[pressure] before passing to pvlib. Default converts hPa/mbar to Pa.

  • airmass_model (str, default 'kastenyoung1989') – Model passed to pvlib.atmosphere.get_relative_airmass().

  • verbose (bool, default True) – Set to False to suppress the explanatory print message.

Returns:

Absolute airmass indexed like data.index.

Return type:

Series