bsrn.qc.wrapper.run_qc#
- bsrn.qc.wrapper.run_qc(df, station_code=None, lat=None, lon=None, elev=None, tests=('ppl', 'erl', 'closure', 'diff_ratio', 'k_index', 'tracker'))[source]#
Run a suite of QC tests on a BSRN DataFrame with optimized geometry calculations [1] [2].
- Parameters:
df (pd.DataFrame) – Input BSRN data containing irradiance ($G_h, B_n, D_h, L_d$) and/or meteorological ($T, RH, P$) columns.
station_code (str, optional) – BSRN station code to retrieve coordinates.
lat (float, optional) – Latitude ($phi$). [degrees]
lon (float, optional) – Longitude ($lambda$). [degrees]
elev (float, optional) – Elevation ($H$). [m]
tests (tuple of str, optional) – List of tests to run (e.g., ‘ppl’, ‘erl’, ‘closure’). Default is all.
- Returns:
df – DataFrame with added QC flag columns (0 = Pass, 1 = Fail).
- Return type:
pd.DataFrame
- Raises:
ValueError – If the index is not a
DatetimeIndexor metadata resolution fails (see_get_metadata()).
References