RUFAS.routines.field.crop.crop module#
- class RUFAS.routines.field.crop.crop.Crop(crop_data: CropData | None = None)#
Bases:
object
A class representing a crop, encapsulating various processes and components related to crop growth and development throughout a simulation.
Parameters#
- crop_dataOptional[CropData], optional
A CropData object containing the attributes tracked throughout the simulation. If not provided, default specifications are used.
Attributes#
- _dataCropData
Reference to the crop data; tracks all crop variables through the simulation.
- _growth_constraintsGrowthConstraints
Process component controlling growth constraints, limits plant growth as a function of stressors.
- _biomass_allocationBiomassAllocation
Process component controlling allocation of plant biomass as a function of growth and photosynthesis.
- _water_dynamicsWaterDynamics
Process component controlling plant water dynamics.
- _water_uptakeWaterUptake
Process component controlling water uptake from soil.
- _nitrogen_uptakeNitrogenUptake
Process component controlling plant nitrogen incorporation, including uptake and fixation.
- _phosphorus_uptakePhosphorusUptake
Process component controlling plant phosphorus uptake and incorporation.
- _heat_unitsHeatUnits
Process component controlling plant heat accumulation.
- _leaf_area_indexLeafAreaIndex
Process component controlling canopy growth, including leaf area index.
- _root_developmentRootDevelopment
Process component controlling plant root development.
- _crop_managementCropManagement
Process component controlling calculation of end-of-season production.
- _dormancyDormancy
Process component performing dormancy operations.
Notes#
This class integrates multiple subcomponents that manage different aspects of the crop’s lifecycle, including growth constraints, biomass allocation, water dynamics, nutrient incorporation, heat accumulation, and more. It is designed to be a central part of a crop growth simulation, integrating data and methods from various subcomponents to simulate the entire lifecycle of a crop.
- property growth_constraints: GrowthConstraints#
Provides access to the GrowthConstraints object.
- property biomass_allocation: BiomassAllocation#
Provides access to the BiomassAllocation object.
- property nitrogen_uptake: NitrogenUptake#
Provides access to the NitrogenUptake object.
- property leaf_area_index: LeafAreaIndex#
Provides access to the LeafAreaIndex object.
- property water_dynamics: WaterDynamics#
Provides access to the WaterDynamics object.
- property crop_management: CropManagement#
Provides access to the CropManagement object.
- property phosphorus_incorporation: PhosphorusUptake#
Provides access to the PhosphorusUptake object.
- perform_daily_crop_update(current_conditions: CurrentDayConditions, field_data: FieldData, soil_data: SoilData, time: RufasTime) None #
Updates the crop for the current day.
Parameters#
- current_conditionsCurrentDayConditions
Object containing the environment conditions on this day.
- field_dataFieldData
The FieldData object that tracks field properties.
- soil_dataSoilData
The SoilData object that tracks soil properties.
- cycle_water_for_crop(actual_evaporation: float, full_evapotranspirative_demand: float, soil_data: SoilData) None #
Executes the daily water cycling for crops on a field.
Parameters#
- actual_evaporationfloat
Evaporation on a given day (mm).
- full_evapotranspirative_demandfloat
Potential evapotranspiration on a given day (mm).
- soil_dataSoilData
An instance of the SoilData class (unitless).
- handle_water_in_canopy(available_precipitation: float) float #
Handles the water addition to the crop’s canopy and calculates excess water.
Parameters#
- available_precipitationfloat
Amount of water available to reach the soil after considering other crops (mm).
Returns#
- tuple
Amount of precipitation that reaches the soil after this crop (mm).
- evaporate_from_canopy(evapotranspirative_demand: float) float #
Wrapper for the canopy evaporation routine.
- should_harvest_based_on_heat() bool #
Checks if any of the active plants in the field should be harvested based on their heat schedule.
- manage_crop_harvest(harvest_op: HarvestOperation, field_name: str, field_size: float, time: RufasTime, soil_data: SoilData) HarvestedCropStorageType | None #
Wrapper function for the Crop’s CropManagement harvesting operation.
Parameters#
- harvest_opHarvestOperation
The operation to be executed on this crop.
- field_namestr
The name of the field that contains this crop.
- field_sizefloat
Size of the field that contains this crop (ha)
- timeRufasTime
RufasTime instance containing the current time of the simulation.
- soil_dataSoilData
The object tracking the attributes of the soil profile.
Returns#
- HarvestedCropStorageType | None
Harvested Crop and the type of storage it will go in if the crop harvest produced a yield, otherwise None.
- set_maximum_transpiration(evapotranspirative_demand: float) None #
Wrapper method for setting the max transpiration for a crop.
- assess_dormancy(daylength: float, dormancy_threshold_daylength: float, rainfall: float, soil_data: SoilData, soil: Soil) None #
Assess and manage dormancy status based on the daylength.
Parameters#
- daylengthfloat
Length of time from sunup to sundown on the current day (hours).
- dormancy_threshold_daylengthfloat
The threshold daylength below which the crop should enter dormancy.
- rainfallfloat
Amount of rain that fell on the current day (mm).
- soil_dataSoilData
The soil data relevant for dormancy and biomass partitioning.
- soilSoil
The soil profile.
- enter_dormancy(rainfall: float, soil_data: SoilData, soil: Soil) None #
Puts the crop into dormancy and handles biomass partitioning and residue addition.
Parameters#
- rainfallfloat
Amount of rain that fell on the current day (mm).
- soil_dataSoilData
The soil data relevant for dormancy and biomass partitioning.
- soilSoil
The soil profile.
- exit_dormancy() None #
Brings the crop out of dormancy.
- classmethod create_crop(crop_reference: str, use_heat_scheduled_harvesting: bool, time: RufasTime) Crop #
Factory method to create a crop instance based on the crop reference.
Parameters#
- crop_referencestr
The reference for the crop to be planted.
- use_heat_scheduled_harvestingbool
Whether heat-scheduled harvesting should be used.
- timeRufasTime
The current time in the simulation.
Returns#
- Crop
A fully initialized Crop instance.
Notes#
This method starts by trying to determine if the crop is of a supported species, if so it passes it to the supported crop creation method. If not, it passes it to the custom crop creation method.
- set_crop_planting_attributes(crop_reference: str, use_heat_scheduled_harvesting: bool, time: RufasTime) None #
Initializes the crop’s attributes related to planting.
Parameters#
- crop_referencestr
The reference for the crop to be planted.
- use_heat_scheduled_harvestingbool
Whether heat-scheduled harvesting should be used.
- timeRufasTime
The current time in the simulation.