RUFAS.routines.field.crop.leaf_area_index module#

class RUFAS.routines.field.crop.leaf_area_index.LeafAreaIndex(crop_data: CropData | None = None, lai_shapes: float | None = None, optimal_leaf_area_fraction: float | None = None, canopy_height: float | None = None, leaf_area_added: float | None = None, optimal_leaf_area_change: float | None = None, previous_leaf_area_index: float | None = None, previous_optimal_leaf_area_fraction: float | None = None)#

Bases: object

Manages the leaf area index (LAI) for crops, based on the ‘Canopy Cover and Height’ section of SWAT (5:2.1.2).

Parameters#

crop_dataOptional[CropData], optional

A CropData instance containing crop specifications and attributes. Defaults to a new instance of CropData if not provided.

max_canopy_heightfloat, default None

Maximum canopy height for the plant (m).

lai_shapesOptional[float], default None

Shape coefficients for calculating leaf area index (unitless).

optimal_leaf_area_fractionOptional[float], default None

Fraction of max leaf area index for current heat fraction (unitless).

canopy_heightOptional[float], default None

Current height of the plant (m).

leaf_area_addedOptional[float], default None

Leaf area index change during the day (unitless).

optimal_leaf_area_changeOptional[float], default None

Leaf area index added under ideal conditions (unitless).

previous_leaf_area_indexOptional[float], default None

Leaf area index on the previous day (unitless).

previous_optimal_leaf_area_fractionOptional[float], default None

Optimal leaf area fraction on the previous day (unitless).

Attributes#

dataCropData

Reference to the provided CropData instance or a new default instance.

max_canopy_heightfloat

Maximum canopy height for the plant (m).

lai_shapesOptional[float]

Shape coefficients for calculating leaf area index (unitless).

optimal_leaf_area_fractionOptional[float]

Fraction of max leaf area index for current heat fraction (unitless).

canopy_heightOptional[float]

Current height of the plant (m).

leaf_area_addedOptional[float]

Leaf area index change during the day (unitless).

optimal_leaf_area_changeOptional[float]

Leaf area index added under ideal conditions (unitless).

previous_leaf_area_indexOptional[float]

Leaf area index on the previous day (unitless).

previous_optimal_leaf_area_fractionOptional[float]

Optimal leaf area fraction on the previous day (unitless).

__init__(crop_data: CropData | None = None, lai_shapes: float | None = None, optimal_leaf_area_fraction: float | None = None, canopy_height: float | None = None, leaf_area_added: float | None = None, optimal_leaf_area_change: float | None = None, previous_leaf_area_index: float | None = None, previous_optimal_leaf_area_fraction: float | None = None) None#
grow_canopy() None#

Main leaf area index function.

shift_leaf_area_time() None#

Shifts the time window by one step for leaf area attributes.

Notes#

This method updates the historical record of leaf area indices by shifting the current leaf area index and optimal leaf area fraction to their respective ‘previous’ attributes. This is typically done to prepare for a new day’s growth calculations.

check_previous_leaf_area_values() None#

Check for previous LAI values and set them to 0 if none are present.

Notes#

This function is used to handle the initial time point in the simulation. It ensures that the previous LAI values are initialized to 0 if they haven’t been set yet, providing a baseline for the start of the simulation.

determine_leaf_area_added() None#

Sets the actual leaf area added, adjusted for the plant growth factor.

References#

SWAT 5:3.2.2

add_leaf_area() None#

Adds new leaf area to the plant.

References#

SWAT 5:2.1.18

static determine_canopy_height(max_canopy_height: float, optimal_leaf_area_fraction: float) float#

Sets the current height of the canopy, measured in meters.

Parameters#

max_canopy_heightfloat

The maximum height that the canopy can reach (meters).

optimal_leaf_area_fractionfloat

The fraction of the maximum leaf area index corresponding to the current heat fraction (unitless).

Returns#

float

The current height of the canopy (meters).

References#

SWAT 5:2.1.14

Raises#

ValueError

If negative Max_canopy_height is provided. If optimal_leaf_area_fraction is negative or greater than 1.

static _determine_lai_shapes(first_heat_fraction: float, second_heat_fraction: float, first_leaf_fraction: float, second_leaf_fraction: float) List[float]#

Calculates the shape coefficients for the optimal Leaf Area Index (LAI) formula.

Parameters#

first_heat_fractionfloat

Fraction of the growing season corresponding to the first point on the optimal leaf development curve.

second_heat_fractionfloat

Fraction of the growing season corresponding to the second point on the optimal leaf development curve.

first_leaf_fractionfloat

Fraction of maximum leaf area index corresponding to the first point on the optimal leaf development curve.

second_leaf_fractionfloat

Fraction of maximum leaf area index corresponding to the second point on the optimal leaf development curve.

Returns#

List[float]

A list of shape coefficients used in the optimal LAI formula.

static _determine_optimal_leaf_area_fraction(heat_fraction: float, shape1: float, shape2: float) float#

Calculates the leaf area index fraction from the optimal leaf area development curve for the initial period of plant growth.

Parameters#

heat_fractionfloat

Fraction of potential heat units accumulated by the plant.

shape1float

The first shape coefficient of the leaf area development curve.

shape2float

The second shape coefficient of the leaf area development curve.

Returns#

float

The fraction of the plant’s maximum leaf area index corresponding to the given fraction of potential heat units, constrained to be bounded at zero.

Notes#

This method is particularly focused on the initial growth period of the plant.

References#

SWAT 5:2.1.10

static _determine_max_leaf_area_change(leaf_area_fraction: float, previous_leaf_area_fraction: float, max_leaf_area_index: float, previous_leaf_area_index: float) float#

Calculates the maximum leaf area added during the day.

Parameters#

leaf_area_fractionfloat

Optimal leaf area fraction for the day (unitless).

previous_leaf_area_fractionfloat

Previous day’s optimal leaf area fraction (unitless).

max_leaf_area_indexfloat

The maximum leaf area index achievable by the plant (unitless).

previous_leaf_area_indexfloat

The previous day’s leaf area index (unitless).

Returns#

float

The maximum leaf area added during the day.

Notes#

Actual leaf area index (LAI) is corrected for growth constraints, so the previous day’s optimal leaf area fraction may not be the same as the previous day’s LAI divided by the max LAI. This method replaces the ‘calc_max_leaf_area_change’ method and calculates the potential increase in leaf area index based on current and previous day’s leaf area fractions and the maximum leaf area index achievable by the plant.

References#

SWAT 5:2.1.16

static _determine_senescent_leaf_area_index(heat_fraction: float, senescent_heat_fraction: float, optimal_leaf_area_fraction: float) float#

Calculates a plant’s leaf area index during senescence.

Parameters#

heat_fractionfloat

The current fraction of potential heat units accumulated by the plant (unitless).

senescent_heat_fractionfloat

The fraction of potential heat units at which senescence begins for the plant (unitless).

optimal_leaf_area_fractionfloat

The optimal leaf area fraction for the plant (unitless).

Returns#

float

The calculated leaf area index of the plant during its senescence phase.

Notes#

This method replaces the ‘calc_senescent_leaf_area_index’ method. It determines the leaf area index for a plant as it undergoes senescence, based on the current heat unit accumulation and the onset of senescence in terms of heat units.

References#

SWAT 5:2.1.19

static _calc_shape_log(heat_fraction: float, leaf_area_fraction: float) float#

Calculates the logarithmic term of the LAI shape parameter function.

Parameters#

heat_fractionfloat

Fraction of heat units accumulated by the plant; must be greater than zero (unitless).

leaf_area_fractionfloat

Fraction of the plant’s maximum leaf area; must be greater than zero, less than one, and not equal to the heat_fraction (unitless).

Notes#

This function is primarily used by the determine_lai_shapes method. Error handling for the input parameters is conducted within determine_lai_shapes.