calculateOrganicMatterBalance
@svenvw/fdm-source / fdm-calculator/src / calculateOrganicMatterBalance
Function: calculateOrganicMatterBalance()
calculateOrganicMatterBalance(
organicMatterBalanceInput):Promise<OrganicMatterBalanceNumeric>
Defined in: fdm-calculator/src/balance/organic-matter/index.ts:34
Calculates the organic matter balance for a farm, aggregating results from all its fields.
This function serves as the main entry point for the organic matter balance calculation. It takes a comprehensive set of input data for a farm, processes each field in batches to calculate its individual balance, and then aggregates these results into a single, farm-level balance. The final output is a numeric representation of the balance, suitable for display or further analysis.
Parameters
organicMatterBalanceInput
The complete dataset required for the calculation, including all fields, fertilizer catalogues, and cultivation catalogues for the farm.
Returns
Promise<OrganicMatterBalanceNumeric>
A promise that resolves to the aggregated OrganicMatterBalanceNumeric object for the farm.
Throws
Throws an error if the calculation process fails for any reason.