TheDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/maxiricalde/ProfeLedesma/llms.txt
Use this file to discover all available pages before exploring further.
QC class (in helpers/QualityControl.py) modifies a GHI DataFrame in place, appending flag columns and a final Acepted boolean column. Three physical plausibility filters are applied sequentially — one upper-bound check during daytime, one nighttime polynomial check, and one clearness-index range check. Only rows passing all three are marked as accepted.
Constructor
Parameters
A pandas DataFrame that must already contain the following columns:
Typically built by merging raw GHI measurements with the output of
| Column | Source | Description |
|---|---|---|
ghi | raw data | Measured global horizontal irradiance (W/m²) |
SZA | Geo.df | Solar zenith angle in degrees |
CTZ | Geo.df | Cosine of the solar zenith angle |
TZ | Geo.df | Solar zenith angle in radians |
TOA | Geo.df | Top-of-atmosphere irradiance (W/m²) |
Geo(...).df on the date column.Side effects — columns added to df
The constructor returns no value; it modifies df in place by appending the columns below.
| Column added | Type | Description |
|---|---|---|
filtro1 | bool | Upper bound (daytime): when SZA < 90°, True if ghi < 1.5 × 1361.7 × CTZ^1.2 + 100; always True when SZA ≥ 90°. |
filtro2 | bool | Nighttime polynomial check: when SZA > 90°, True if ghi > (6.5331 − 0.065502×TZ + 1.8312×10⁻⁴×TZ²) / (1 + 0.01113×TZ); always True when SZA ≤ 90°. |
kt | float | Clearness index: ghi / TOA when TOA > 0; 0 otherwise. |
filtro3 | bool | Clearness index bound: True when 0 < kt < 1.4. |
Acepted | bool | True when filtro1 AND filtro2 AND filtro3 all hold simultaneously. |
Filter Logic Detail
Filter 1 — Physically Possible Upper Limit (BSRN)
Filter 2 — Nighttime Polynomial Check
SZA > 90°), a row passes (filtro2 = True) only when the measured GHI exceeds the polynomial threshold in TZ (radians). Rows that fall below this threshold at night are flagged False and will be excluded by Acepted.
Filter 3 — Clearness Index Range
(0, 1.4) indicates either a negative reading, a zero reading during daytime, or an unrealistically high value.
Usage Example
The column name
Acepted uses the single-c spelling as defined in the source code. Use df['Acepted'] — not df['Accepted'] — when accessing the column programmatically.