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_clear are not on df, used with add_clearsky_columns() so the tracker row matches run_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_sunshine only 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_clear like run_qc (not the GHIE-only fallback). Pass station_code so Linke turbidity matches the registry; if only lat / lon / elev are available, clear-sky is still computed but turbidity defaults may differ from run_qc with a named station. TRACKERrun_qc 相同采用 Ineichen 晴空;建议传 station_code 以匹配注册表 Linke;仅坐标时浑浊度默认可能与命名站点略有差异。