Skip to content

Commit

Permalink
Merge pull request #50 from wri/feature/IPCC_Tier1_RF_update_v2
Browse files Browse the repository at this point in the history
Feature/ipcc tier1 rf update v2
  • Loading branch information
melrose-wri authored Oct 27, 2023
2 parents 4e29674 + a392f43 commit 9fea776
Showing 1 changed file with 29 additions and 29 deletions.
58 changes: 29 additions & 29 deletions constants_and_names.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
######## ########

# Model version
version = '1.2.3'
version = '1.2.4'
version_filename = version.replace('.', '_')


Expand Down Expand Up @@ -147,7 +147,7 @@
### Model extent
######
pattern_model_extent = 'model_extent'
model_extent_dir = os.path.join(s3_base_dir, 'model_extent/standard/20230315/')
model_extent_dir = os.path.join(s3_base_dir, 'model_extent/standard/20230815/')

######
### Biomass tiles
Expand Down Expand Up @@ -196,7 +196,7 @@
pixel_area_dir = 's3://gfw2-data/analyses/area_28m/'

# Spreadsheet with annual removals rates
gain_spreadsheet = 'gain_rate_continent_ecozone_age_20220914.xlsx'
gain_spreadsheet = 'gain_rate_continent_ecozone_age_20230821.xlsx'
gain_spreadsheet_dir = os.path.join(s3_base_dir, 'removal_rate_tables/')

# Annual Hansen loss tiles (2001-2022)
Expand Down Expand Up @@ -339,7 +339,7 @@

# Age categories over entire model extent, as a precursor to assigning IPCC default removal rates
pattern_age_cat_IPCC = 'forest_age_category_IPCC__1_young_2_mid_3_old'
age_cat_IPCC_dir = os.path.join(s3_base_dir, 'forest_age_category_IPCC/standard/20230315/')
age_cat_IPCC_dir = os.path.join(s3_base_dir, 'forest_age_category_IPCC/standard/20230815/')


### US-specific removal precursors
Expand Down Expand Up @@ -398,31 +398,31 @@

# Annual aboveground biomass removals rate using IPCC default removal rates
pattern_annual_gain_AGB_IPCC_defaults = 'annual_removal_factor_AGB_Mg_ha_IPCC_defaults_all_ages'
annual_gain_AGB_IPCC_defaults_dir = os.path.join(s3_base_dir, 'annual_removal_factor_AGB_IPCC_defaults_all_ages/standard/20230315/')
annual_gain_AGB_IPCC_defaults_dir = os.path.join(s3_base_dir, 'annual_removal_factor_AGB_IPCC_defaults_all_ages/standard/20230815/')

# Annual aboveground biomass removals rate using IPCC default removal rates
pattern_annual_gain_BGB_IPCC_defaults = 'annual_removal_factor_BGB_Mg_ha_IPCC_defaults_all_ages'
annual_gain_BGB_IPCC_defaults_dir = os.path.join(s3_base_dir, 'annual_removal_factor_BGB_IPCC_defaults_all_ages/standard/20230315/')
annual_gain_BGB_IPCC_defaults_dir = os.path.join(s3_base_dir, 'annual_removal_factor_BGB_IPCC_defaults_all_ages/standard/20230815/')

### Annual composite removal factor

# Annual aboveground removals rate for all forest types
pattern_annual_gain_AGC_all_types = 'annual_removal_factor_AGC_Mg_ha_all_forest_types'
annual_gain_AGC_all_types_dir = os.path.join(s3_base_dir, 'annual_removal_factor_AGC_all_forest_types/standard/20230315/')
annual_gain_AGC_all_types_dir = os.path.join(s3_base_dir, 'annual_removal_factor_AGC_all_forest_types/standard/20230815/')

# Annual belowground removals rate for all forest types
pattern_annual_gain_BGC_all_types = 'annual_removal_factor_BGC_Mg_ha_all_forest_types'
annual_gain_BGC_all_types_dir = os.path.join(s3_base_dir, 'annual_removal_factor_BGC_all_forest_types/standard/20230315/')
annual_gain_BGC_all_types_dir = os.path.join(s3_base_dir, 'annual_removal_factor_BGC_all_forest_types/standard/20230815/')

# Annual aboveground+belowground removals rate for all forest types
pattern_annual_gain_AGC_BGC_all_types = 'annual_removal_factor_AGC_BGC_Mg_ha_all_forest_types'
annual_gain_AGC_BGC_all_types_dir = os.path.join(s3_base_dir, 'annual_removal_factor_AGC_BGC_all_forest_types/standard/20230315/')
annual_gain_AGC_BGC_all_types_dir = os.path.join(s3_base_dir, 'annual_removal_factor_AGC_BGC_all_forest_types/standard/20230815/')

### Removal forest types (sources)

# Forest type used in removals model
pattern_removal_forest_type = 'removal_forest_type'
removal_forest_type_dir = os.path.join(s3_base_dir, 'removal_forest_type/standard/20230315/')
removal_forest_type_dir = os.path.join(s3_base_dir, 'removal_forest_type/standard/20230815/')

# Removal model forest type codes
mangrove_rank = 6
Expand All @@ -437,26 +437,26 @@

# Number of removals years for all forest types
pattern_gain_year_count = 'gain_year_count_all_forest_types'
gain_year_count_dir = os.path.join(s3_base_dir, 'gain_year_count_all_forest_types/standard/20230315/')
gain_year_count_dir = os.path.join(s3_base_dir, 'gain_year_count_all_forest_types/standard/20230815/')


### Cumulative gross carbon dioxide removals

# Gross aboveground removals for all forest types
pattern_cumul_gain_AGCO2_all_types = f'gross_removals_AGCO2_Mg_ha_all_forest_types_2001_{loss_years}'
cumul_gain_AGCO2_all_types_dir = os.path.join(s3_base_dir, 'gross_removals_AGCO2_all_forest_types/standard/per_hectare/20230315/')
cumul_gain_AGCO2_all_types_dir = os.path.join(s3_base_dir, 'gross_removals_AGCO2_all_forest_types/standard/per_hectare/20230815/')

# Gross belowground removals for all forest types
pattern_cumul_gain_BGCO2_all_types = f'gross_removals_BGCO2_Mg_ha_all_forest_types_2001_{loss_years}'
cumul_gain_BGCO2_all_types_dir = os.path.join(s3_base_dir, 'gross_removals_BGCO2_all_forest_types/standard/per_hectare/20230315/')
cumul_gain_BGCO2_all_types_dir = os.path.join(s3_base_dir, 'gross_removals_BGCO2_all_forest_types/standard/per_hectare/20230815/')

# Gross aboveground and belowground removals for all forest types in all pixels
pattern_cumul_gain_AGCO2_BGCO2_all_types = f'gross_removals_AGCO2_BGCO2_Mg_ha_all_forest_types_2001_{loss_years}'
cumul_gain_AGCO2_BGCO2_all_types_dir = os.path.join(s3_base_dir, 'gross_removals_AGCO2_BGCO2_all_forest_types/standard/full_extent/per_hectare/20230315/')
cumul_gain_AGCO2_BGCO2_all_types_dir = os.path.join(s3_base_dir, 'gross_removals_AGCO2_BGCO2_all_forest_types/standard/full_extent/per_hectare/20230815/')

# Gross aboveground and belowground removals for all forest types in pixels within forest extent
pattern_cumul_gain_AGCO2_BGCO2_all_types_forest_extent = f'gross_removals_AGCO2_BGCO2_Mg_ha_all_forest_types_forest_extent_2001_{loss_years}'
cumul_gain_AGCO2_BGCO2_all_types_forest_extent_dir = os.path.join(s3_base_dir, 'gross_removals_AGCO2_BGCO2_all_forest_types/standard/forest_extent/per_hectare/20230407/')
cumul_gain_AGCO2_BGCO2_all_types_forest_extent_dir = os.path.join(s3_base_dir, 'gross_removals_AGCO2_BGCO2_all_forest_types/standard/forest_extent/per_hectare/20230815/')


######
Expand Down Expand Up @@ -492,7 +492,7 @@
## Carbon emitted_pools in loss year

# Date to include in the output directory for all emissions year carbon emitted_pools
emis_pool_run_date = '20230315'
emis_pool_run_date = '20230815'

# Aboveground carbon in the year of emission for all forest types in loss pixels
pattern_AGC_emis_year = "Mg_AGC_ha_emis_year"
Expand Down Expand Up @@ -568,7 +568,7 @@
### Emissions from biomass and soil (all carbon emitted_pools)

# Date to include in the output directory
emis_run_date_biomass_soil = '20230407'
emis_run_date_biomass_soil = '20230815'

# pattern_gross_emis_commod_biomass_soil = f'gross_emis_commodity_Mg_CO2e_ha_biomass_soil_2001_{loss_years}'
pattern_gross_emis_commod_biomass_soil = f'gross_emis_commodity_Mg_CO2e_ha_biomass_soil_2001_{loss_years}'
Expand Down Expand Up @@ -607,7 +607,7 @@
### Emissions from soil only

# Date to include in the output directory
emis_run_date_soil_only = '20230407'
emis_run_date_soil_only = '20230815'

pattern_gross_emis_commod_soil_only = f'gross_emis_commodity_Mg_CO2e_ha_soil_only_2001_{loss_years}'
gross_emis_commod_soil_only_dir = f'{s3_base_dir}gross_emissions/commodities/soil_only/standard/{emis_run_date_soil_only}/'
Expand Down Expand Up @@ -645,39 +645,39 @@

# Net emissions for all forest types and all carbon emitted_pools in all pixels
pattern_net_flux = f'net_flux_Mg_CO2e_ha_biomass_soil_2001_{loss_years}'
net_flux_dir = os.path.join(s3_base_dir, 'net_flux_all_forest_types_all_drivers/biomass_soil/standard/full_extent/per_hectare/20230407/')
net_flux_dir = os.path.join(s3_base_dir, 'net_flux_all_forest_types_all_drivers/biomass_soil/standard/full_extent/per_hectare/20230815/')

# Net emissions for all forest types and all carbon emitted_pools in forest extent
pattern_net_flux_forest_extent = f'net_flux_Mg_CO2e_ha_biomass_soil_forest_extent_2001_{loss_years}'
net_flux_forest_extent_dir = os.path.join(s3_base_dir, 'net_flux_all_forest_types_all_drivers/biomass_soil/standard/forest_extent/per_hectare/20230407/')
net_flux_forest_extent_dir = os.path.join(s3_base_dir, 'net_flux_all_forest_types_all_drivers/biomass_soil/standard/forest_extent/per_hectare/20230815/')


### Per pixel model outputs
######

# Gross removals per pixel in all pixels
pattern_cumul_gain_AGCO2_BGCO2_all_types_per_pixel_full_extent = f'gross_removals_AGCO2_BGCO2_Mg_pixel_all_forest_types_full_extent_2001_{loss_years}'
cumul_gain_AGCO2_BGCO2_all_types_per_pixel_full_extent_dir = os.path.join(s3_base_dir, 'gross_removals_AGCO2_BGCO2_all_forest_types/standard/full_extent/per_pixel/20230407/')
cumul_gain_AGCO2_BGCO2_all_types_per_pixel_full_extent_dir = os.path.join(s3_base_dir, 'gross_removals_AGCO2_BGCO2_all_forest_types/standard/full_extent/per_pixel/20230815/')

# Gross removals per pixel in forest extent
pattern_cumul_gain_AGCO2_BGCO2_all_types_per_pixel_forest_extent = f'gross_removals_AGCO2_BGCO2_Mg_pixel_all_forest_types_forest_extent_2001_{loss_years}'
cumul_gain_AGCO2_BGCO2_all_types_per_pixel_forest_extent_dir = os.path.join(s3_base_dir, 'gross_removals_AGCO2_BGCO2_all_forest_types/standard/forest_extent/per_pixel/20230407/')
cumul_gain_AGCO2_BGCO2_all_types_per_pixel_forest_extent_dir = os.path.join(s3_base_dir, 'gross_removals_AGCO2_BGCO2_all_forest_types/standard/forest_extent/per_pixel/20230815/')

# Gross emissions per pixel in all pixels
pattern_gross_emis_all_gases_all_drivers_biomass_soil_per_pixel_full_extent = f'gross_emis_all_gases_all_drivers_Mg_CO2e_pixel_biomass_soil_full_extent_2001_{loss_years}'
gross_emis_all_gases_all_drivers_biomass_soil_per_pixel_full_extent_dir = os.path.join(s3_base_dir, 'gross_emissions/all_drivers/all_gases/biomass_soil/standard/full_extent/per_pixel/20230407/')
gross_emis_all_gases_all_drivers_biomass_soil_per_pixel_full_extent_dir = os.path.join(s3_base_dir, 'gross_emissions/all_drivers/all_gases/biomass_soil/standard/full_extent/per_pixel/20230815/')

# Gross emissions per pixel in forest extent
pattern_gross_emis_all_gases_all_drivers_biomass_soil_per_pixel_forest_extent = f'gross_emis_all_gases_all_drivers_Mg_CO2e_pixel_biomass_soil_forest_extent_2001_{loss_years}'
gross_emis_all_gases_all_drivers_biomass_soil_per_pixel_forest_extent_dir = os.path.join(s3_base_dir, 'gross_emissions/all_drivers/all_gases/biomass_soil/standard/forest_extent/per_pixel/20230407/')
gross_emis_all_gases_all_drivers_biomass_soil_per_pixel_forest_extent_dir = os.path.join(s3_base_dir, 'gross_emissions/all_drivers/all_gases/biomass_soil/standard/forest_extent/per_pixel/20230815/')

# Net flux per pixel in all pixels
pattern_net_flux_per_pixel_full_extent = f'net_flux_Mg_CO2e_pixel_biomass_soil_full_extent_2001_{loss_years}'
net_flux_per_pixel_full_extent_dir = os.path.join(s3_base_dir, 'net_flux_all_forest_types_all_drivers/biomass_soil/standard/full_extent/per_pixel/20230407/')
net_flux_per_pixel_full_extent_dir = os.path.join(s3_base_dir, 'net_flux_all_forest_types_all_drivers/biomass_soil/standard/full_extent/per_pixel/20230815/')

# Net flux per pixel in forest extent
pattern_net_flux_per_pixel_forest_extent = f'net_flux_Mg_CO2e_pixel_biomass_soil_forest_extent_2001_{loss_years}'
net_flux_per_pixel_forest_extent_dir = os.path.join(s3_base_dir, 'net_flux_all_forest_types_all_drivers/biomass_soil/standard/forest_extent/per_pixel/20230407/')
net_flux_per_pixel_forest_extent_dir = os.path.join(s3_base_dir, 'net_flux_all_forest_types_all_drivers/biomass_soil/standard/forest_extent/per_pixel/20230815/')


### 4x4 km aggregation tiles for mapping
Expand All @@ -687,7 +687,7 @@
pattern_aggreg_sensit_perc_diff = f'net_flux_0_04deg_modelv{version_filename}_perc_diff_std'
pattern_aggreg_sensit_sign_change = f'net_flux_0_04deg_modelv{version_filename}_sign_change_std'

output_aggreg_dir = os.path.join(s3_base_dir, '0_04deg_output_aggregation/biomass_soil/standard/20230407/')
output_aggreg_dir = os.path.join(s3_base_dir, '0_04deg_output_aggregation/biomass_soil/standard/20230815/')



Expand Down Expand Up @@ -725,11 +725,11 @@

# Standard deviation for annual aboveground biomass removal factors using IPCC default removal rates
pattern_stdev_annual_gain_AGB_IPCC_defaults = 'annual_removal_factor_stdev_AGB_Mg_ha_IPCC_defaults_all_ages'
stdev_annual_gain_AGB_IPCC_defaults_dir = os.path.join(s3_base_dir, 'stdev_annual_removal_factor_AGB_IPCC_defaults_all_ages/standard/20230315/')
stdev_annual_gain_AGB_IPCC_defaults_dir = os.path.join(s3_base_dir, 'stdev_annual_removal_factor_AGB_IPCC_defaults_all_ages/standard/20230815/')

# Standard deviation for aboveground and belowground removal factors for all forest types
pattern_stdev_annual_gain_AGC_all_types = 'annual_removal_factor_stdev_AGC_Mg_ha_all_forest_types'
stdev_annual_gain_AGC_all_types_dir = os.path.join(s3_base_dir, 'stdev_annual_removal_factor_AGC_all_forest_types/standard/20230315/')
stdev_annual_gain_AGC_all_types_dir = os.path.join(s3_base_dir, 'stdev_annual_removal_factor_AGC_all_forest_types/standard/20230815/')


# Raw mineral soil C file site
Expand Down

0 comments on commit 9fea776

Please sign in to comment.