ImperialCollegeLondon / pyrealm

Development of the pyrealm package, providing an integrated toolbox for modelling plant productivity, growth and demography using Python.
https://pyrealm.readthedocs.io/
MIT License
19 stars 8 forks source link

Write a test for `PModel environment` to check for any abrupt outputs #191

Open surbhigoel77 opened 6 months ago

surbhigoel77 commented 6 months ago

Fixed in #153

The PModel environment module takes in environmental forcing variables (tc, patm, co2, vpd) and produce photosynthesis variables (ca, kmm, gammastar, ns_star). There are hard bounds on the forcing variables values that should ideally not generate any photosynthsis variables that are out of bound within their own ranges.

We need to check if there are any cases where the valid forcing variables produce any out-of-bound outputs.

davidorme commented 5 months ago

The co2 to ca conversion is very straightforward, then kmm, gammastar and ns_star are complex functions of tc and patm only. vpd is passed straight through to the OptimalChiABC subclasses. So using np.meshgrid to get some inputs for combinations of tc and patm should do it. I think it's very likely that the random values of the forcing variables within bounds selected in the benchmarking data would fill that grid space pretty well, but this would be more explicit.

Does that sound right?