RUFAS.routines.field.crop.crop_data module#
- class RUFAS.routines.field.crop.crop_data.PlantCategory(*values)#
Bases:
Enum
Enumeration of all plant types supported by RuFaS.
Attributes#
- WARM_ANNUAL_LEGUMEstr
Represents warm climate annual legumes.
- COOL_ANNUAL_LEGUMEstr
Represents cool climate annual legumes.
- PERENNIAL_LEGUMEstr
Represents perennial legumes.
- WARM_ANNUALstr
Represents warm climate annual non-legume plants.
- COOL_ANNUALstr
Represents cool climate annual non-legume plants.
- PERENNIALstr
Represents perennial non-legume plants.
- TREEstr
Represents tree-type plants.
- WARM_ANNUAL_LEGUME = 'warm_annual_legume'#
- COOL_ANNUAL_LEGUME = 'cool_annual_legume'#
- PERENNIAL_LEGUME = 'perennial_legume'#
- WARM_ANNUAL = 'warm_annual'#
- COOL_ANNUAL = 'cool_annual'#
- PERENNIAL = 'perennial'#
- TREE = 'tree'#
- class RUFAS.routines.field.crop.crop_data.CropData(*, name: str | None = 'default generic annual crop', rufas_ids: list[int] = <factory>, id: ~typing.Any | None = None, plant_category: ~RUFAS.routines.field.crop.crop_data.PlantCategory | None = PlantCategory.COOL_ANNUAL, is_perennial: bool | None = False, is_nitrogen_fixer: bool = False, field_proportion: float = 1.0, is_alive: bool = True, crop_category: ~RUFAS.data_structures.crop_soil_to_feed_storage_connection.CropCategory = CropCategory.SMALL_GRAIN, crop_type: ~RUFAS.data_structures.crop_soil_to_feed_storage_connection.CropType = CropType.GRAIN, storage_type: ~RUFAS.data_structures.crop_soil_to_feed_storage_connection.StorageType = StorageType.DRY, planting_year: int = 0, planting_day: int = 100, lignin_dry_matter_percentage: float = 1.518, use_heat_scheduling: bool = False, harvest_heat_fraction: float = 1.1, optimal_harvest_index: float = 0.5, minimum_harvest_index: float = 0.3, yield_phosphorus_fraction: float | None = 0.0, crude_protein_percent: float = 12.481, non_protein_nitrogen: float = 2.518, starch: float = 72.586, adf: float = 3.934, ndf: float = 6.134, sugar: float = 2.235, ash: float = 2.496, minimum_temperature: float = 0, optimal_temperature: float = 25, max_leaf_area_index: float = 4.0, first_heat_fraction_point: float = 0.15, first_leaf_fraction_point: float = 0.01, second_heat_fraction_point: float = 0.5, second_leaf_fraction_point: float = 0.95, senescent_heat_fraction: float = 0.9, yield_nitrogen_fraction: float | None = 0.2, leaf_area_index: float = 0.0, biomass: float = 0, growth_factor: float = 1.0, root_fraction: float = 0.3333333333333333, biomass_growth_max: float = 0.0, above_ground_biomass: float = 0.1, root_biomass: float | None = 0.0, light_use_efficiency: float = 30, nitrogen: float = 0.0, optimal_nitrogen: float = 0.0, phosphorus: float = 0.0, optimal_phosphorus: float = 0.0, potential_heat_units: float = 800, accumulated_heat_units: float = 0, is_growing: bool = True, is_dormant: bool = False, max_canopy_height: float = 2.5, emergence_nitrogen_fraction: float = 0.05, half_mature_nitrogen_fraction: float = 0.02, mature_nitrogen_fraction: float = 0.01, half_mature_heat_fraction: float = 0.5, mature_heat_fraction: float = 1.0, root_depth: float = 1, optimal_nitrogen_fraction: float | None = 0.001, total_soil_layers: int | None = 2, accessible_soil_layers: int | None = 1, inaccessible_soil_layers: int | None = 1, emergence_phosphorus_fraction: float = 0.005, half_mature_phosphorus_fraction: float = 0.003, mature_phosphorus_fraction: float = 0.002, max_root_depth: float = 2000, root_distribution_param_da: float, root_distribution_param_c: float, cumulative_evaporation: float = 0.0, cumulative_transpiration: float = 0.0, cumulative_potential_evapotranspiration: float = 0.0, water_deficiency: float | None = 0, max_transpiration: float | None = 0, canopy_water: float = 0, max_canopy_water_capacity: float = 0.8, water_uptake: float = 0.0, cumulative_water_uptake: float = 0.0, dry_matter_percentage: float = 85.689, optimal_phosphorus_fraction: float = 0.073, user_harvest_index: float | None = None, dormancy_loss_fraction: float | None = None)#
Bases:
object
Data class containing crop variables based on SWAT database.
Attributes#
- nameOptional[str]
The name of this specific crop instance.
- rufas_idslist[RUFAS_ID]
List of RUFAS IDs that harvests from this crop may be fed as.
- idOptional[Any]
The unique identifier for this crop instance.
- rufas_idslist[RUFAS_ID]
List of RuFaS Feed IDs that harvests of this crop may be fed as.
- plant_categoryOptional[PlantCategory]
Classification of the plant (Reference SWAT crop.dat file, IDC variable).
- is_perennialOptional[bool]
Indicates if this plant is perennial.
- is_nitrogen_fixerbool
Indicates if the plant is a nitrogen fixer.
- field_proportionfloat
Proportion of the field occupied by this crop.
- is_alivebool
Indicates if the crop is currently alive in the field.
- crop_categoryCropCategory
Broad category into which this crop type falls.
- crop_typeCropType
Sub type of this crop.
- storage_typeStorageType
Method of storage for this crop when harvested.
- planting_yearint
Year of planting for this crop.
- planting_dayint
Julian day of planting for this crop.
- lignin_dry_matter_percentagefloat, default 1.518
Percentage of dry matter yield that is lignin (unitless). This value is the default for Sorghum harvested as a grain.
- use_heat_schedulingbool
If heat unit scheduling is used for harvesting.
- harvest_heat_fractionfloat
Fraction of potential heat units for optimal growth stage for harvest.
- optimal_harvest_indexfloat
Optimal harvest index under ideal growth conditions (unitless).
- minimum_harvest_indexfloat
Minimum harvest index under drought conditions (unitless).
- yield_phosphorus_fractionOptional[float]
Fraction of phosphorus in yield (unitless).
- crude_protein_percentfloat
Percentage of dry matter mass that is dietary crude protein (unitless).
- non_protein_nitrogenfloat
Percentage of dry matter mass that is non-protein nitrogen (unitless).
- starchfloat
Percentage of dry matter mass that is starch (unitless).
- adffloat
Percentage of dry matter mass that is acid detergent fiber (unitless).
- ndffloat
Percentage of dry matter mass that is neutral detergent fiber (unitless).
- sugarfloat
Percentage of dry matter mass that is labile carbohydrate (unitless).
- ashfloat
Percentage of dry matter mass that is ash (unitless).
- minimum_temperaturefloat
Minimum temperature for plant growth (Celsius).
- optimal_temperaturefloat
Ideal temperature for maximum plant growth (Celsius). See SWAT Appendix A - Model Databases, Table A-3 for species specific values (https://swat.tamu.edu/media/69419/Appendix-A.pdf).
- max_leaf_area_indexfloat
Maximum leaf area index for the plant (unitless).
- first_heat_fraction_pointfloat
Fraction of growing season for the first point on leaf development curve (unitless).
- first_leaf_fraction_pointfloat
Fraction of max leaf area index at first point on leaf development curve (unitless).
- second_heat_fraction_pointfloat
Fraction of growing season for the second point on leaf development curve (unitless).
- second_leaf_fraction_pointfloat
Fraction of max leaf area index at second point on leaf development curve (unitless).
- senescent_heat_fractionfloat
Fraction of potential heat units for plant senescence (unitless).
- light_use_efficiencyfloat
Light use efficiency of the plant (dg/MJ). Reference SWAT Appendix A - Model Databases, Table A-5 for these values (https://swat.tamu.edu/media/69419/Appendix-A.pdf).
- minimum_cover_management_factorfloat
Minimum cover and management factor for water erosion (unitless).
- yield_nitrogen_fractionOptional[float]
Fraction of nitrogen in yield (unitless).
- leaf_area_indexfloat
Leaf area index of the plant (unitless).
- biomassfloat
Total plant biomass (kg/ha).
- growth_factorfloat
Growth factor multiplier for the plant (unitless).
- root_fractionfloat
Proportion of biomass in roots (unitless).
- biomass_growth_maxfloat, default 0.0
Upper limit of biomass accumulation for the day (kg/ha).
- above_ground_biomassfloat
Above ground plant biomass excluding roots (kg/ha).
- root_biomassOptional[float]
Biomass stored in roots (kg/ha).
- nitrogenfloat, default 0.0
Nitrogen stored in plant biomass (kg/ha).
- optimal_nitrogenfloat, default 0.0
Optimal amount of nitrogen for current growth stage (kg/ha).
- phosphorusfloat, default 0.0
Phosphorus stored in plant biomass (kg/ha).
- optimal_phosphorusfloat, default 0.0
Optimal amount of phosphorus for current growth stage (kg/ha).
- potential_heat_unitsfloat
Total heat units required for maturity (unitless).
- accumulated_heat_unitsfloat
Heat units accumulated to date (unitless).
- is_growingbool
If the crop is currently growing.
- is_dormantbool
If the crop is currently dormant.
- emergence_nitrogen_fractionfloat, default 0.05
Nitrogen fraction of biomass at emergence (unitless).
- half_mature_nitrogen_fractionfloat, default 0.02
Nitrogen fraction of biomass at half-maturity (unitless).
- mature_nitrogen_fractionfloat, default 0.01
Nitrogen fraction of biomass at maturity (unitless).
- half_mature_heat_fractionfloat
Fraction of potential heat units for half maturity (unitless).
- mature_heat_fractionfloat
Fraction of potential heat units for maturity (unitless).
- root_depthfloat
Current depth of plant roots in soil (mm).
- optimal_nitrogen_fractionOptional[float]
Optimal nitrogen proportion in biomass for current stage (unitless).
- total_soil_layersOptional[int]
Total number of layers in the soil profile (unitless).
- accessible_soil_layersOptional[int]
Number of soil layers accessible to plant roots (unitless).
- inaccessible_soil_layersOptional[int]
Number of soil layers inaccessible to plant roots (unitless).
- emergence_phosphorus_fractionfloat, default 0.005
Phosphorus fraction of biomass at emergence (unitless).
- half_mature_phosphorus_fractionfloat, default 0.003
Phosphorus fraction of biomass at half-maturity (unitless).
- mature_phosphorus_fractionfloat, default 0.002
Phosphorus fraction of biomass at maturity (unitless).
- max_root_depthfloat, default 2000
Maximum depth of roots in the soil (mm).
- root_distribution_param_da: float
Empirical root distribution parameter d_a (mm). Reference: Fan, Jianling, et al. “Root distribution by depth for temperate agricultural crops.” Field Crops
Research 189 (2016): 68-74, table 1. Note that the value has been converted to mm.
- root_distribution_param_c: float
Empirical root distribution parameter c (unitless). Reference: Fan, Jianling, et al. “Root distribution by depth for temperate agricultural crops.” Field Crops
Research 189 (2016): 68-74, table 1.
- cumulative_evaporationfloat, default 0.0
Total water lost to evaporation by the plant during the growing season (mm).
- cumulative_transpirationfloat, default 0.0
Total water lost to transpiration by the plant during the growing season (mm).
- cumulative_potential_evapotranspirationfloat, default 0.0
Total expected maximum water loss by the plant during the growing season (mm).
- water_deficiencyOptional[float], default None
Water deficiency factor for the plant (unitless).
- max_transpirationOptional[float], default None
Maximum transpiration on a given day (mm).
- canopy_waterfloat, default 0
Amount of water currently held in the canopy (mm).
- max_canopy_water_capacityfloat, default 0.8
Maximum amount of water that can be trapped in the canopy on a given day when fully developed (mm). References: SWAT Theoretical documentation eqn. 2:2.1.1 (see also SWAT Input file .HRU (“CANMX” page 233). Note: this default is super arbitrary. It comes from the paper:
‘Holder AJ, Rowe R, McNamara NP, Donnison IS, McCalmont JP. Soil & Water Assessment Tool (SWAT) simulated hydrological impacts of land use change from temperate grassland to energy crops: A case study in western UK. GCB Bioenergy. 2019;11:1298–1317. https ://doi.org/10.1111/gcbb.12628’ which cites the following paper that I could not find:
- ‘Wang, D., Li, J. S., & Rao, M. J. (2006). Winter wheat canopy interception under sprinkler irrigation.
Scientia Agricultura Sinica, 39(9), 1859–1864.’
- water_uptakefloat, default 0.0
Total amount of water the plant took from the soil on the current day (mm).
- cumulative_water_uptakefloat, default 0.0
Cumulative sum of water taken up by the plant over the course of its lifetime (mm).
- dry_matter_percentagefloat, default 85.689
Percentage of fresh yield that is dry matter (unitless). This value is the default for Sorghum harvested as a grain.
- optimal_phosphorus_fractionfloat, default 0.073
Optimal proportion of the plant’s biomass comprised of nitrogen for the current growth stage (unitless).
- user_harvest_indexOptional[float], default None
A user-specified harvest index (unitless). If given, ‘harvest-index-override’ is triggered.
- dormancy_loss_fractionOptional[float], default None
Fraction of biomass the crop loses when it goes dormant (unitless). Fraction of biomass the crop loses when it goes dormant. Default 0.1 for perennials, 0.3 for trees. Reference: SWAT Theoretical 5:1.2, and crop.dat BIO_LEAF description
The crop quality attributes listed in the base CropData class use the values for Sorghum harvested as a grain.
- name: str | None = 'default generic annual crop'#
- id: Any | None = None#
- rufas_ids: list[int]#
- plant_category: PlantCategory | None = 'cool_annual'#
- is_perennial: bool | None = False#
- is_nitrogen_fixer: bool = False#
- field_proportion: float = 1.0#
- is_alive: bool = True#
- crop_category: CropCategory = 'Small grain'#
- storage_type: StorageType = 'Dry'#
- planting_year: int = 0#
- planting_day: int = 100#
- lignin_dry_matter_percentage: float = 1.518#
- use_heat_scheduling: bool = False#
- harvest_heat_fraction: float = 1.1#
- optimal_harvest_index: float = 0.5#
- minimum_harvest_index: float = 0.3#
- yield_phosphorus_fraction: float | None = 0.0#
- crude_protein_percent: float = 12.481#
- non_protein_nitrogen: float = 2.518#
- starch: float = 72.586#
- adf: float = 3.934#
- ndf: float = 6.134#
- sugar: float = 2.235#
- ash: float = 2.496#
- minimum_temperature: float = 0#
- optimal_temperature: float = 25#
- max_leaf_area_index: float = 4.0#
- first_heat_fraction_point: float = 0.15#
- first_leaf_fraction_point: float = 0.01#
- second_heat_fraction_point: float = 0.5#
- second_leaf_fraction_point: float = 0.95#
- senescent_heat_fraction: float = 0.9#
- yield_nitrogen_fraction: float | None = 0.2#
- leaf_area_index: float = 0.0#
- biomass: float = 0#
- growth_factor: float = 1.0#
- root_fraction: float = 0.3333333333333333#
- biomass_growth_max: float = 0.0#
- above_ground_biomass: float = 0.1#
- root_biomass: float | None = 0.0#
- light_use_efficiency: float = 30#
- nitrogen: float = 0.0#
- optimal_nitrogen: float = 0.0#
- phosphorus: float = 0.0#
- optimal_phosphorus: float = 0.0#
- potential_heat_units: float = 800#
- accumulated_heat_units: float = 0#
- is_growing: bool = True#
- is_dormant: bool = False#
- max_canopy_height: float = 2.5#
- emergence_nitrogen_fraction: float = 0.05#
- half_mature_nitrogen_fraction: float = 0.02#
- mature_nitrogen_fraction: float = 0.01#
- half_mature_heat_fraction: float = 0.5#
- mature_heat_fraction: float = 1.0#
- root_depth: float = 1#
- optimal_nitrogen_fraction: float | None = 0.001#
- total_soil_layers: int | None = 2#
- accessible_soil_layers: int | None = 1#
- inaccessible_soil_layers: int | None = 1#
- emergence_phosphorus_fraction: float = 0.005#
- half_mature_phosphorus_fraction: float = 0.003#
- mature_phosphorus_fraction: float = 0.002#
- max_root_depth: float = 2000#
- root_distribution_param_da: float#
- root_distribution_param_c: float#
- cumulative_evaporation: float = 0.0#
- cumulative_transpiration: float = 0.0#
- cumulative_potential_evapotranspiration: float = 0.0#
- water_deficiency: float | None = 0#
- max_transpiration: float | None = 0#
- canopy_water: float = 0#
- max_canopy_water_capacity: float = 0.8#
- water_uptake: float = 0.0#
- cumulative_water_uptake: float = 0.0#
- dry_matter_percentage: float = 85.689#
- optimal_phosphorus_fraction: float = 0.073#
- user_harvest_index: float | None = None#
- dormancy_loss_fraction: float | None = None#
- property is_mature: bool#
Checks if maturity has been reached based on the fraction of potential heat units accumulated.
References#
SWAT Theoretical documentation section 5:2.1.4
- property in_growing_season: bool#
Indicates if the plant is in its growing season.
Returns#
- bool
True if the plant is in its growing season, False otherwise.
- property do_harvest_index_override: bool#
Checks if a user-defined harvest index is given, which triggers a harvest index override.
Returns#
- bool
True if a user-defined harvest index is given, False otherwise.
- property is_in_senescence: bool#
Check if the plant is in senescence.
Returns#
- bool
True if the plant is in senescence, False otherwise.
- property water_canopy_storage_capacity: float#
Calculate the maximum amount of water that can be held in the canopy.
Returns#
- float
Maximum water storage capacity of the canopy, measured in millimeters (mm).
References#
SWAT Theoretical documentation eqn. 2:2.1.1
- __init__(*, name: str | None = 'default generic annual crop', rufas_ids: list[int] = <factory>, id: ~typing.Any | None = None, plant_category: ~RUFAS.routines.field.crop.crop_data.PlantCategory | None = PlantCategory.COOL_ANNUAL, is_perennial: bool | None = False, is_nitrogen_fixer: bool = False, field_proportion: float = 1.0, is_alive: bool = True, crop_category: ~RUFAS.data_structures.crop_soil_to_feed_storage_connection.CropCategory = CropCategory.SMALL_GRAIN, crop_type: ~RUFAS.data_structures.crop_soil_to_feed_storage_connection.CropType = CropType.GRAIN, storage_type: ~RUFAS.data_structures.crop_soil_to_feed_storage_connection.StorageType = StorageType.DRY, planting_year: int = 0, planting_day: int = 100, lignin_dry_matter_percentage: float = 1.518, use_heat_scheduling: bool = False, harvest_heat_fraction: float = 1.1, optimal_harvest_index: float = 0.5, minimum_harvest_index: float = 0.3, yield_phosphorus_fraction: float | None = 0.0, crude_protein_percent: float = 12.481, non_protein_nitrogen: float = 2.518, starch: float = 72.586, adf: float = 3.934, ndf: float = 6.134, sugar: float = 2.235, ash: float = 2.496, minimum_temperature: float = 0, optimal_temperature: float = 25, max_leaf_area_index: float = 4.0, first_heat_fraction_point: float = 0.15, first_leaf_fraction_point: float = 0.01, second_heat_fraction_point: float = 0.5, second_leaf_fraction_point: float = 0.95, senescent_heat_fraction: float = 0.9, yield_nitrogen_fraction: float | None = 0.2, leaf_area_index: float = 0.0, biomass: float = 0, growth_factor: float = 1.0, root_fraction: float = 0.3333333333333333, biomass_growth_max: float = 0.0, above_ground_biomass: float = 0.1, root_biomass: float | None = 0.0, light_use_efficiency: float = 30, nitrogen: float = 0.0, optimal_nitrogen: float = 0.0, phosphorus: float = 0.0, optimal_phosphorus: float = 0.0, potential_heat_units: float = 800, accumulated_heat_units: float = 0, is_growing: bool = True, is_dormant: bool = False, max_canopy_height: float = 2.5, emergence_nitrogen_fraction: float = 0.05, half_mature_nitrogen_fraction: float = 0.02, mature_nitrogen_fraction: float = 0.01, half_mature_heat_fraction: float = 0.5, mature_heat_fraction: float = 1.0, root_depth: float = 1, optimal_nitrogen_fraction: float | None = 0.001, total_soil_layers: int | None = 2, accessible_soil_layers: int | None = 1, inaccessible_soil_layers: int | None = 1, emergence_phosphorus_fraction: float = 0.005, half_mature_phosphorus_fraction: float = 0.003, mature_phosphorus_fraction: float = 0.002, max_root_depth: float = 2000, root_distribution_param_da: float, root_distribution_param_c: float, cumulative_evaporation: float = 0.0, cumulative_transpiration: float = 0.0, cumulative_potential_evapotranspiration: float = 0.0, water_deficiency: float | None = 0, max_transpiration: float | None = 0, canopy_water: float = 0, max_canopy_water_capacity: float = 0.8, water_uptake: float = 0.0, cumulative_water_uptake: float = 0.0, dry_matter_percentage: float = 85.689, optimal_phosphorus_fraction: float = 0.073, user_harvest_index: float | None = None, dormancy_loss_fraction: float | None = None) None #