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]. 使用优化的几何计算对 BSRN DataFrame 运行一系列 QC 测试。

Parameters:
  • df (pd.DataFrame) – Input BSRN data containing irradiance ($G_h, B_n, D_h, L_d$) and/or meteorological ($T, RH, P$) columns. 包含辐照度 ($G_h, B_n, D_h, L_d$) 或气象 ($T, RH, P$) 观测列的输入 BSRN 数据。

  • station_code (str, optional) – BSRN station code to retrieve coordinates. 用于检索坐标的 BSRN 站点代码。

  • lat (float, optional) – Latitude ($phi$). [degrees] / 纬度 ($phi$)。[度]

  • lon (float, optional) – Longitude ($lambda$). [degrees] / 经度 ($lambda$)。[度]

  • elev (float, optional) – Elevation ($H$). [m] / 海拔 ($H$)。[米]

  • tests (tuple of str, optional) – List of tests to run (e.g., ‘ppl’, ‘erl’, ‘closure’). Default is all. 要运行的测试列表(例如 ‘ppl’、’erl’、’closure’)。默认为全部。

Returns:

df – DataFrame with added QC flag columns (0 = Pass, 1 = Fail). 增加了 QC 标记列的 DataFrame(0 = 通过,1 = 失败)。

Return type:

pd.DataFrame

Raises:
  • TypeError – If df is not a DataFrame. df 非 DataFrame 时。

  • ValueError – If the index is not a DatetimeIndex or metadata resolution fails (see _get_metadata()). 索引非 DatetimeIndex,或元数据解析失败(见 _get_metadata())时。

References