bsrn.qc.wrapper.mask_failed_irradiance#
- bsrn.qc.wrapper.mask_failed_irradiance(df, *, flag_remove=True)[source]#
Set shortwave / longwave irradiance columns to NaN where QC flags fail.
在 QC 标记为失败处将短波/长波辐照度列置为 NaN。
Uses the same flag-to-column mapping as
run_qc()outputs: each single-flag column (e.g.flagPPLGHI) clears only its component; closure, diffuse-ratio, k-index, and tracker groups clear the components those tests share. Mutatesdfin place for irradiance values. Whenflag_removeis True (default), standardrun_qc()flag columns are dropped afterward.与
run_qc()输出采用相同的标记→列映射:单列标记只清除对应分量; 闭合、散射比、k-index、跟踪器组合清除各测试共用的分量。辐照度值**原地**修改。flag_remove为 True(默认)时,随后删除默认测试套件产生的标准标记列。- Parameters:
df (pandas.DataFrame) – Frame that already contains
run_qcflag columns. 已含run_qc()标记列的 DataFrame。flag_remove (bool, optional) – If True (default), drop QC flag columns after masking. 为 True(默认)时,掩膜后删除 QC 标记列。
- Returns:
df(same object), updated in place. ``df``(同一对象),原地更新。- Return type:
Notes
Call this after
run_qc()when you want failed minutes cleared;run_qc()does not invoke it automatically. 需在清除失败分钟时于run_qc()**之后**调用;run_qc()不会自动执行。To keep an unmodified copy, run
mask_failed_irradiance(df.copy(), ...). 若需保留未修改副本,先mask_failed_irradiance(df.copy(), ...)。Does not clear auxiliary columns (e.g.
ghi_clear,zenith). 不清除辅助列(如ghi_clear、zenith)。