From e600a2f91be92f0edd04e704ec292f5f5f2af7e3 Mon Sep 17 00:00:00 2001 From: Helen Root Date: Fri, 13 Oct 2023 20:32:35 +0200 Subject: [PATCH] Add wood product flux columns to biomass growth file; and units for flux 2 file --- scripts/csv-generation-flux-separate-files.js | 25 ++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/scripts/csv-generation-flux-separate-files.js b/scripts/csv-generation-flux-separate-files.js index 067e5341..b1387099 100644 --- a/scripts/csv-generation-flux-separate-files.js +++ b/scripts/csv-generation-flux-separate-files.js @@ -87,16 +87,16 @@ ALL_TYPES.forEach((fromGt) => { }) VALUE_HEADERS.push({ id: `${fromGt}_to_${toGt}_groundFlux`, - title: `${fromGt}_vers_${toGt}_sol` // _flux_unitaire_tCO2e_ha-1_an-1 + title: `${fromGt}_vers_${toGt}_sol_tCO2e_ha-1` }) VALUE_HEADERS.push({ id: `${fromGt}_to_${toGt}_biomassFlux`, - title: `${fromGt}_vers_${toGt}_biomasse` + title: `${fromGt}_vers_${toGt}_biomasse_tCO2e_ha-1` }) if (fromGt.startsWith('forĂȘt') || toGt.startsWith('forĂȘt')) { VALUE_HEADERS.push({ id: `${fromGt}_to_${toGt}_forestLitterFlux`, - title: `${fromGt}_vers_${toGt}_litiere` + title: `${fromGt}_vers_${toGt}_litiere_tCO2e_ha-1` }) } }) @@ -123,6 +123,15 @@ forestStockIds.forEach((gt) => { ]) }) +BIOMASS_GROWTH_HEADERS.push(...[ + { id: 'bo_harvest_annualFluxEquivalent', title: 'bo_recolte_flux_tCO2e_an-1' }, + { id: 'bi_harvest_annualFluxEquivalent', title: 'bi_recolte_flux_tCO2e_an-1' }, + { id: 'total_harvest_annualFluxEquivalent', title: 'total_recolte_flux_tCO2e_an-1' }, + { id: 'bo_population_annualFluxEquivalent', title: 'bo_consommation_flux_tCO2e_an-1' }, + { id: 'bi_population_annualFluxEquivalent', title: 'bi_consommation_flux_tCO2e_an-1' }, + { id: 'total_population_annualFluxEquivalent', title: 'total_consommation_flux_tCO2e_an-1' } +]) + function createRecordForCommune (commune) { const record = communeData[commune.insee] // fill in geographical data not in extended commune data @@ -178,6 +187,16 @@ function addFluxRecords (records, record) { } } } + + record.bo_harvest_annualFluxEquivalent = fluxes.woodSummary.bo.co2e + record.bi_harvest_annualFluxEquivalent = fluxes.woodSummary.bi.co2e + record.total_harvest_annualFluxEquivalent = fluxes.summary['produits bois']?.totalSequestration + + const consumptionFluxes = getAnnualFluxes([record], { woodCalculation: 'consommation' }) + record.bo_population_annualFluxEquivalent = consumptionFluxes.woodSummary.bo.co2e + record.bi_population_annualFluxEquivalent = consumptionFluxes.woodSummary.bi.co2e + record.total_population_annualFluxEquivalent = consumptionFluxes.summary['produits bois']?.totalSequestration + record.co2e = fluxes.total records.push(record) }