From b5d9adfcf94e30f6617b9d3a48f3afda972ea3a9 Mon Sep 17 00:00:00 2001 From: Carlo Russo Date: Fri, 15 Nov 2024 13:14:10 +0100 Subject: [PATCH] minor changes for aquastat field name --- .../water-demand-historic/step3a_industrial_demand.py | 2 +- .../water-demand-historic/step4_livestock_demand.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/lisfloodutilities/water-demand-historic/step3a_industrial_demand.py b/src/lisfloodutilities/water-demand-historic/step3a_industrial_demand.py index 618738d..e310907 100644 --- a/src/lisfloodutilities/water-demand-historic/step3a_industrial_demand.py +++ b/src/lisfloodutilities/water-demand-historic/step3a_industrial_demand.py @@ -368,7 +368,7 @@ def main(): for jj in np.arange(country_codes.shape[0]): country_code = country_codes.iloc[jj]['country-code'] for ii in np.arange(len(years)): - sel = (aquastat['Area Id']==country_code) & (aquastat['Variable Name']=='Industrial water withdrawal') & (aquastat['Year']==years[ii]) + sel = (aquastat['M49']==country_code) & (aquastat['Variable Name']=='Industrial water withdrawal') & (aquastat['Year']==years[ii]) if np.sum(sel)==0: continue table_aquastat_industry_withdrawal[jj,ii] = aquastat['Value'][sel].values # km3/year diff --git a/src/lisfloodutilities/water-demand-historic/step4_livestock_demand.py b/src/lisfloodutilities/water-demand-historic/step4_livestock_demand.py index e556f1b..fb21459 100644 --- a/src/lisfloodutilities/water-demand-historic/step4_livestock_demand.py +++ b/src/lisfloodutilities/water-demand-historic/step4_livestock_demand.py @@ -106,10 +106,10 @@ def main(): for jj in np.arange(country_codes.shape[0]): country_code = country_codes.iloc[jj]['country-code'] for ii in np.arange(len(years)): - sel_ir = (aquastat['Area Id']==country_code) & (aquastat['Variable Name']=='Irrigation water withdrawal') & (aquastat['Year']==years[ii]) + sel_ir = (aquastat['M49']==country_code) & (aquastat['Variable Name']=='Irrigation water withdrawal') & (aquastat['Year']==years[ii]) if np.sum(sel_ir)>0: table_aquastat_irrigation_withdrawal[jj,ii] = aquastat['Value'][sel_ir].values # km3/year - sel_ag = (aquastat['Area Id']==country_code) & (aquastat['Variable Name']=='Agricultural water withdrawal') & (aquastat['Year']==years[ii]) + sel_ag = (aquastat['M49']==country_code) & (aquastat['Variable Name']=='Agricultural water withdrawal') & (aquastat['Year']==years[ii]) if np.sum(sel_ag)>0: table_aquastat_agriculture_withdrawal[jj,ii] = aquastat['Value'][sel_ag].values # km3/year