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. 计算每日 QC 统计信息和日照时数。
- Parameters:
df (pd.DataFrame) – BSRN data archive. BSRN 数据存档。
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). 站点缩写。若df上无晴空列,则用于生成与run_qc一致的跟踪器参考。
- 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. 各测试输入列为 BSRN 缺失码(-999、-99.9、-99.99)或 NaN 的分钟不计入该测试的失败累计;is_sunshine仅在 BNI 有效且超阈值时计数。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. TRACKER 与run_qc相同采用 Ineichen 晴空;建议传station_code以匹配注册表 Linke;仅坐标时浑浊度默认可能与命名站点略有差异。