GithubHelp home page GithubHelp logo

wri / carbon-budget Goto Github PK

View Code? Open in Web Editor NEW
75.0 75.0 30.0 5.85 MB

Calculate gross GHG emissions, gross carbon removals (sequestration), and net flux from forests globally

License: GNU General Public License v3.0

Python 76.45% C++ 21.18% Dockerfile 0.25% Shell 0.38% Batchfile 0.32% R 1.41%

carbon-budget's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

carbon-budget's Issues

Supplementary tables from Harris et al. 2021

Hi there,

Thanks for making all the code to run your model openly available (including Docker containers, really helpful). I have what I think is a much more basic question: do you have the code to make your supplementary tables in this repository (and if not, would you be willing to add it)? In particular it would be great to see how Table S6 compiles other data sources together.

Thanks!

Tile not found but it seems it should be

Subject of the issue

Running the run_full_model.py without S3 credentials, doesn't seem to be able to download data.

Your environment

Most recent clone of the repository with docker compose build, running the container locally.

Steps to reproduce

  • Clone the repo.
  • docker compose build
  • `docker compose run --rm carbon budget
  • compile the cpp stuff c++ /usr/local/app/emissions/cpp_util/calc_gross_emissions_generic.cpp -o /usr/local/app/emissions/cpp_util/calc_gross_emissions_generic.exe -lgdal
  • run one of sample commands python run_full_model.py -si -t std -s all -r -d 20220101 -l 30N_090E -ce loss -p biomass_soil -tcd 30 -ln "30N_090E test"

Expected behaviour

Model should download data (if I read the docs correctly)

Actual behaviour

Tile fails to download with following errors, I tried a few different options but errors are the same:

root@69f2299626d9:/usr/local/app# python run_full_model.py -si -t std -s all -r -d 20220101 -l 30N_090E -ce loss -p biomass_soil -tcd 30 -ln "30N_090E test"
LOG: s3 credentials not found. Uploading to s3 disabled but downloading enabled. 
LOG: Analysis stages to run: ['model_extent', 'forest_age_category_IPCC', 'annual_removals_IPCC', 'annual_removals_all_forest_types', 'gain_year_count', 'gross_removals_all_forest_types', 'carbon_pools', 'gross_emissions', 'net_flux', 'aggregate', 'create_supplementary_outputs'] 
LOG: Storage used: 0 ; Available storage: 7.8G ; Percent storage used: 0% 
LOG: C++ for generic emissions already compiled. 
LOG: :::::Creating tiles of model extent 
LOG: ['30N_090E'] 
LOG: There are 1 tiles to process
 
LOG: Option 1: Checking if 30N_090E_mangrove_agb_t_ha_2000.tif is already on spot machine... 
LOG:   Option 1 failure: 30N_090E_mangrove_agb_t_ha_2000.tif is not already on spot machine. 
LOG: Option 2: Checking for tile s3://gfw2-data/climate/carbon_model/mangrove_biomass/processed/standard/20190220/30N_090E_mangrove_agb_t_ha_2000.tif on s3... 
fatal error: Unable to locate credentials
LOG:   Option 2 failure: Tile s3://gfw2-data/climate/carbon_model/mangrove_biomass/processed/standard/20190220/30N_090E_mangrove_agb_t_ha_2000.tif not found on s3. Tile not found but it seems it should be. Check file paths and names. 
 
LOG: Option 1: Checking if Hansen_GFC2015_gain_30N_090E.tif is already on spot machine... 
LOG:   Option 1 failure: Hansen_GFC2015_gain_30N_090E.tif is not already on spot machine. 
LOG: Option 2: Checking for tile s3://gfw2-data/forest_change/tree_cover_gain/gaindata_2012/Hansen_GFC2015_gain_30N_090E.tif on s3... 
fatal error: Unable to locate credentials
LOG:   Option 2 failure: Tile s3://gfw2-data/forest_change/tree_cover_gain/gaindata_2012/Hansen_GFC2015_gain_30N_090E.tif not found on s3. Tile not found but it seems it should be. Check file paths and names. 
 
LOG: Option 1: Checking if 30N_090E_plantation_2000_or_earlier_processed.tif is already on spot machine... 
LOG:   Option 1 failure: 30N_090E_plantation_2000_or_earlier_processed.tif is not already on spot machine. 
LOG: Option 2: Checking for tile s3://gfw2-data/climate/carbon_model/other_emissions_inputs/IDN_MYS_plantation_pre_2000/processed/20200724/30N_090E_plantation_2000_or_earlier_processed.tif on s3... 
fatal error: Unable to locate credentials
LOG:   Option 2 failure: Tile s3://gfw2-data/climate/carbon_model/other_emissions_inputs/IDN_MYS_plantation_pre_2000/processed/20200724/30N_090E_plantation_2000_or_earlier_processed.tif not found on s3. Tile not found but it seems it should be. Check file paths and names. 
 
LOG: Option 1: Checking if Hansen_GFC2014_treecover2000_30N_090E.tif is already on spot machine... 
LOG:   Option 1 failure: Hansen_GFC2014_treecover2000_30N_090E.tif is not already on spot machine. 
LOG: Option 2: Checking for tile s3://gfw2-data/forest_cover/2000_treecover/Hansen_GFC2014_treecover2000_30N_090E.tif on s3... 
fatal error: Unable to locate credentials
LOG:   Option 2 failure: Tile s3://gfw2-data/forest_cover/2000_treecover/Hansen_GFC2014_treecover2000_30N_090E.tif not found on s3. Tile not found but it seems it should be. Check file paths and names. 
 
LOG: Option 1: Checking if 30N_090E_t_aboveground_biomass_ha_2000.tif is already on spot machine... 
LOG:   Option 1 failure: 30N_090E_t_aboveground_biomass_ha_2000.tif is not already on spot machine. 
LOG: Option 2: Checking for tile s3://gfw2-data/climate/WHRC_biomass/WHRC_V4/Processed/30N_090E_t_aboveground_biomass_ha_2000.tif on s3... 
fatal error: Unable to locate credentials
LOG:   Option 2 failure: Tile s3://gfw2-data/climate/WHRC_biomass/WHRC_V4/Processed/30N_090E_t_aboveground_biomass_ha_2000.tif not found on s3. Tile not found but it seems it should be. Check file paths and names. 
 
LOG: Changing output directory date based on date provided with model run-through 
LOG: ['s3://gfw2-data/climate/carbon_model/model_extent/standard/20220101/'] 
 
LOG: Model extent processors= 3 
LOG: Delineating model extent: 30N_090E 
LOG: Using Hansen tcd tile 30N_090E for std model run 
LOG: Using WHRC biomass tile 30N_090E for std model run 
multiprocessing.pool.RemoteTraceback: 
"""
Traceback (most recent call last):
  File "rasterio/_base.pyx", line 216, in rasterio._base.DatasetBase.__init__
  File "rasterio/_shim.pyx", line 67, in rasterio._shim.open_dataset
  File "rasterio/_err.pyx", line 213, in rasterio._err.exc_wrap_pointer
rasterio._err.CPLE_OpenFailedError: Hansen_GFC2014_treecover2000_30N_090E.tif: No such file or directory

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.6/multiprocessing/pool.py", line 119, in worker
    result = (True, func(*args, **kwds))
  File "/usr/lib/python3.6/multiprocessing/pool.py", line 44, in mapstar
    return list(map(*args))
  File "/usr/local/app/data_prep/model_extent.py", line 47, in model_extent
    with rasterio.open(tcd) as tcd_src:
  File "/usr/local/lib/python3.6/dist-packages/rasterio/env.py", line 433, in wrapper
    return f(*args, **kwds)
  File "/usr/local/lib/python3.6/dist-packages/rasterio/__init__.py", line 221, in open
    s = DatasetReader(path, driver=driver, sharing=sharing, **kwargs)
  File "rasterio/_base.pyx", line 218, in rasterio._base.DatasetBase.__init__
rasterio.errors.RasterioIOError: Hansen_GFC2014_treecover2000_30N_090E.tif: No such file or directory
"""

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "run_full_model.py", line 634, in <module>
    main()
  File "run_full_model.py", line 305, in main
    mp_model_extent(sensit_type, tile_id_list, run_date=run_date, no_upload=no_upload)
  File "/usr/local/app/data_prep/mp_model_extent.py", line 103, in mp_model_extent
    pool.map(partial(model_extent.model_extent, pattern=pattern, sensit_type=sensit_type, no_upload=no_upload), tile_id_list)
  File "/usr/lib/python3.6/multiprocessing/pool.py", line 266, in map
    return self._map_async(func, iterable, mapstar, chunksize).get()
  File "/usr/lib/python3.6/multiprocessing/pool.py", line 644, in get
    raise self._value
rasterio.errors.RasterioIOError: Hansen_GFC2014_treecover2000_30N_090E.tif: No such file or directory
root@69f2299626d9:/usr/local/app# 

Am I doing something wrong?
Any help would be much appreciated!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.