aggregateNormFillingsToFarmLevel
@svenvw/fdm-source / fdm-calculator/src / aggregateNormFillingsToFarmLevel
Function: aggregateNormFillingsToFarmLevel()
aggregateNormFillingsToFarmLevel(
input):AggregatedNormFillingsToFarmLevel
Defined in: fdm-calculator/src/norms/farm.ts:168
Aggregates the norm filling values from individual fields to the farm level. This function takes the output per field of the norm filling calculation, multiplies each norm filling by the field's area, and sums these values across all fields to provide total norm fillings for the farm.
The result are three objects (manure, nitrogen, phosphate) each containing the total normFilling and combined applicationFillings, expressed as totals, not per hectare.
Parameters
input
InputAggregateNormFillingsToFarmLevel
An array of field data, each containing field ID, area, and calculated norm fillings.
Returns
AggregatedNormFillingsToFarmLevel
An object containing the total aggregated norm fillings for manure, nitrogen, and phosphate for the farm.