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.

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. Mutates df in place for irradiance values. When flag_remove is True (default), standard run_qc() flag columns are dropped afterward.

Parameters:
  • df (pandas.DataFrame) – Frame that already contains run_qc flag columns.

  • flag_remove (bool, optional) – If True (default), drop QC flag columns after masking.

Returns:

df (same object), updated in place.

Return type:

pandas.DataFrame

Notes

Call this after run_qc() when you want failed minutes cleared; run_qc() does not invoke it automatically.

To keep an unmodified copy, run mask_failed_irradiance(df.copy(), ...).

Does not clear auxiliary columns (e.g. ghi_clear, zenith).