supy.util.attribute

Contents

Tip

  1. Need help? Please let us know in the SUEWS Community.

  2. Please report issues with the manual on GitHub Issues (or use Report Issue for This Page for page-specific feedback).

  3. Please cite SUEWS with proper information from our Zenodo page.

6.3.7.1. supy.util.attribute#

supy.util.attribute(df_output_A: DataFrame, df_output_B: DataFrame, variable: Literal['T2', 'q2', 'U10'] = 'T2', **kwargs) AttributionResult[source]#

Generic attribution function for near-surface variables.

Dispatches to variable-specific implementation internally.

Parameters:
  • df_output_A (pd.DataFrame) – SUEWS output DataFrame for scenario A (reference/baseline)

  • df_output_B (pd.DataFrame) – SUEWS output DataFrame for scenario B (modified/test)

  • variable (str, optional) – Variable to attribute: ‘T2’ (temperature), ‘q2’ (humidity), or ‘U10’ (10m wind speed). Default ‘T2’.

  • **kwargs – Additional keyword arguments passed to the specific function. - For T2: hierarchical (bool), min_flux (float), df_forcing_A/B - For q2: min_flux (float), df_forcing_A/B - For U10: z_ref (float), min_ustar (float)

Returns:

Attribution decomposition results.

Return type:

AttributionResult

Examples

>>> result = attribute(df_baseline, df_scenario, variable="T2")
>>> print(result)
>>> result = attribute(df_baseline, df_scenario, variable="q2")
>>> print(result)
>>> result = attribute(df_baseline, df_scenario, variable="U10")
>>> print(result)