captest.calcparams.apparent_zenith
- captest.calcparams.apparent_zenith(data, site=None, altitude_override=0, verbose=True)
Compute apparent solar zenith angle at each timestamp in
data.Wraps
pvlib.location.Location.get_solarposition()and returns theapparent_zenithcolumn aligned todata.index. Designed for use inside aCapData.regression_colscalc tuple:siteis auto-injected byCapData.custom_paramfromcd.site.Per the pvlib First Solar spectral-correction reference, the absolute airmass is computed against zenith at sea level.
altitude_overridedefaults to 0 so a deep copy ofsitehas itsloc.altitudeforced to 0 before theLocationis instantiated. The caller’ssitedict is not mutated.Night-time rows (
apparent_zenith > 90) are set to NaN so downstream airmass / spectral-factor calls do not emit pvlib warnings on invalid geometry.- Parameters:
data (DataFrame) – DataFrame with a DatetimeIndex. The index may be tz-naive or tz-aware.
site (dict) – Nested
{"loc": {...}, "sys": {...}}dict as produced byload_data(site=...). Only thelocsub-dict is consumed here. Auto-injected fromcd.sitebycustom_paramwhen used in aregression_colscalc tuple.altitude_override (numeric, default 0) – Altitude (in meters) to use when building the
pvlib.Location. Set toNoneto respectsite['loc']['altitude']unchanged.verbose (bool, default True) – Set to False to suppress the explanatory print message.
- Returns:
Apparent zenith angle (degrees) indexed like
data.indexwith a tz-naive index. NaN where the sun is below the horizon.- Return type:
Series