bsrn.utils.quality.get_daily_stats#
- bsrn.utils.quality.get_daily_stats(df, lat, lon, elev, station_code=None)[source]#
Calculate daily QC statistics and sunshine duration.
- Parameters:
df (pd.DataFrame) – BSRN data archive.
lat (float) – Latitude. [degrees]
lon (float) – Longitude. [degrees]
elev (float) – Elevation. [m]
station_code (str, optional) – BSRN station abbreviation. If
ghi_clear/bni_clearare not ondf, used withadd_clearsky_columns()so the tracker row matchesrun_qc()(Ineichen references).
- Returns:
daily_df – Daily counts of flags and sunshine duration metrics.
- Return type:
pd.DataFrame
Notes
Minutes with BSRN missing codes (
-999,-99.9,-99.99) or NaN in the relevant input column do not add to per-test failure sums.is_sunshineonly counts minutes with a valid (non-missing) BNI value above the threshold.TRACKER uses Ineichen
ghi_clear/bni_clearlikerun_qc(not the GHIE-only fallback). Passstation_codeso Linke turbidity matches the registry; if onlylat/lon/elevare available, clear-sky is still computed but turbidity defaults may differ fromrun_qcwith a named station.