FREQCOR_functions.ReadLUT

FREQCOR_functions.ReadLUT(Var, LUT, mxcl, gss, var0=None)[source]

Read a LUT class index from a look-up table.

This helper supports two cases: - 1D LUT access when var0 is None. - 2-level LUT access (first by WD/RH, then by wind speed) when var0 is given.

Parameters:
  • Var (float) – Query value for the second-level variable (typically wind speed).

  • LUT (pandas.DataFrame or dict) – Look-up table.

  • mxcl (int) – Number of classes for 1D LUT access (ignored for 2-level access).

  • gss (int) – Gas species selector.

  • var0 (float, optional) – First-level query value (wind direction for CO2 or relative humidity for H2O).

Returns:

  • VarI (int or float) – Index of the selected wind-speed class (0-based). Returns NaN if inputs are not finite.

  • clrh (int or float) – Selected first-level class key (WD/RH class). Returns NaN when var0 is None or not finite.