scopeinpython.thermal

Scalar-per-timestep thermal/aerodynamic building blocks used by the SCOPE energy-balance loop (ebal.R, not yet ported). Direct ports of SCOPEinR/R/Monin_ObuKhov.R, SCOPEinR/R/resistances.R, and SCOPEinR/R/heatfluxes.R – the first pieces of the thermal energy-balance chain to be ported.

Note

get_resistances’s rac/rws outputs reproduce a real R quirk: they use the stability-uncorrected eddy diffusivity (the local Kh variable in SCOPEinR::get.resistances), not the stability-corrected value returned as the function’s own Kh output field. Confirmed by direct reading of the R source (the local Kh is never reassigned after the corrected value is written into resist_out[['Kh']]) – reproduced exactly rather than “fixed”, since there’s no independent way to tell whether this was intentional.

Scalar-per-timestep thermal/aerodynamic building blocks used by the SCOPE energy-balance loop (scopeinpython.ebal, not yet ported).

Direct ports of SCOPEinR/R/Monin_ObuKhov.R (get.Monin.Obukhov), SCOPEinR/R/resistances.R (get.resistances + its psim/psih/ phstar stability-correction helpers), and SCOPEinR/R/heatfluxes.R (get.heatfluxes). Unlike the spectral/canopy RTM modules elsewhere in this package, these operate on scalars (one timestep/pixel at a time), matching the R source exactly.

scopeinpython.thermal.stefan_boltzmann(T_C)[source]

Blackbody radiant exitance (W/m2) at temperature(s) T_C (degrees Celsius), via the Stefan-Boltzmann law. Direct port of SCOPEinR::get.Stefan_Boltzmann.

Parameters:

T_C (ndarray)

Return type:

ndarray

scopeinpython.thermal.monin_obukhov(ustar, Ta, H)[source]

Monin-Obukhov length (m), a stability parameter used to correct aerodynamic resistances above the canopy for non-neutral conditions.

Direct port of SCOPEinR::get.Monin.Obukhov. Returns -1e6 (near-neutral stability) where the raw computation is undefined (e.g. H == 0), matching R’s L[is.na(L)] <- -1e6.

Parameters:
  • ustar (float)

  • Ta (float)

  • H (float)

Return type:

float

scopeinpython.thermal.psim(z, L, unstable, stable, x)[source]

Stability correction function for momentum transfer (Paulson 1970). Direct port of SCOPEinR::get.psim. 0 under neutral conditions.

Parameters:
  • z (float)

  • L (float)

  • unstable (bool)

  • stable (bool)

  • x (float)

Return type:

float

scopeinpython.thermal.psih(z, L, unstable, stable, x)[source]

Stability correction function for heat transfer (Paulson 1970). Direct port of SCOPEinR::get.psih.

Parameters:
  • z (float)

  • L (float)

  • unstable (bool)

  • stable (bool)

  • x (float)

Return type:

float

scopeinpython.thermal.phstar(z, zR, d, L, stable, unstable, x)[source]

Stability correction function for the roughness sublayer (Paulson 1970). Direct port of SCOPEinR::get.phstar.

Parameters:
  • z (float)

  • zR (float)

  • d (float)

  • L (float)

  • stable (bool)

  • unstable (bool)

  • x (float)

Return type:

float

class scopeinpython.thermal.ResistanceParams(rbs, Cd, LAI, rwc, z0m, d, hc, leafwidth, z, u, L)[source]

Bases: object

Inputs to get_resistances() (data.soil/data.canopy/ data.meteo subsets in R).

Parameters:
  • rbs (float)

  • Cd (float)

  • LAI (float)

  • rwc (float)

  • z0m (float)

  • d (float)

  • hc (float)

  • leafwidth (float)

  • z (float)

  • u (float)

  • L (float)

rbs: float
Cd: float
LAI: float
rwc: float
z0m: float
d: float
hc: float
leafwidth: float
z: float
u: float
L: float
class scopeinpython.thermal.Resistances(ustar: 'float', uz0: 'float', Kh: 'float', rai: 'float', rar: 'float', rac: 'float', rws: 'float', raa: 'float', rawc: 'float', raws: 'float')[source]

Bases: object

Parameters:
  • ustar (float)

  • uz0 (float)

  • Kh (float)

  • rai (float)

  • rar (float)

  • rac (float)

  • rws (float)

  • raa (float)

  • rawc (float)

  • raws (float)

ustar: float
uz0: float
Kh: float
rai: float
rar: float
rac: float
rws: float
raa: float
rawc: float
raws: float
scopeinpython.thermal.get_resistances(p)[source]

Aerodynamic/boundary-layer resistances between soil, canopy and reference height (Wallace & Verhoef 2000 two-layer scheme, with a Monin-Obukhov stability correction). Direct port of SCOPEinR::get.resistances.

Parameters:

p (ResistanceParams)

Return type:

Resistances

class scopeinpython.thermal.HeatFluxes(lambda_: 'np.ndarray', s: 'np.ndarray', lE: 'np.ndarray', H: 'np.ndarray', ec: 'np.ndarray', Cc: 'np.ndarray')[source]

Bases: object

Parameters:
lambda_: ndarray
s: ndarray
lE: ndarray
H: ndarray
ec: ndarray
Cc: ndarray
scopeinpython.thermal.get_heatfluxes(ra, rs, Tc, ea, Ta, e_to_q, Ca, Ci)[source]

Latent and sensible heat flux of a leaf (or soil surface, called with soil-specific ra/rs). Direct port of SCOPEinR::get.heatfluxes.

Parameters:
Return type:

HeatFluxes