Generating initial conditions for FATES
conda env create -f environment.yml
For MacOS M1/M2 users:
- It does not work with R arch arm64, so you will need to reinstall R arch x86_64, follow this guide here.
Library not loaded: /opt/X11/lib/libX11.6.dylib
: run this command:brew install xquartz --cask
- If you need to install
brew
, run this command:$ /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
- If you need to install
GDAL, OSR:
- To import GDAL, use:
from osgeo import gdal, osr
Cannot install leafR:
- sudo aptitude install libgdal-dev
conf/paths/paths.yaml
: you may need to update the path.
data_raw_inv_path
: where to save inventory data.data_raw_aop_path
: where to save raw NEON Airborne Observatory Platform (AOP) data.data_int_path
: where to save processed data.data_final_path
: where to save final-formatted data.
conf/sites/sites.yaml
: you may need to add other sites if you want to process those.
Data procesing workflow: Workflow diagram of functions
- For each site, download NEON data:
download_lidar
: discrete return lidardownload_hyperspectral
: tiles or flightlinesdownload_veg_structure_data
: woody veg datadownload_polygons
: polygons for woody veg plotsdownload_trait_table
: table of trait values for species
- For all sites at once,
generate_pft_reference
: generates table linking species - For one site at a time, process intermediate data products:
prep_veg_structure
: organize woody veg data into year and sampling effortprep_polygons
: identify subplot associated with woody veg datanormalize_laz
: normalize laz tilesclip_lidar_by_plots
: clip the laz/tif files given plots generated fromprep_polygons
prep_lad
: generate leaf area density profile stratified by size classprep_biomass
: calculate biomass for all invidivuals in NEON data- if using hyperspectral flightlines rather than tiles
correct_flightlines
: apply BRDF and topographic corrections and convert corrected flightlines into tiles
prep_manual_training_data
: clean manually delineated tree crowns with plant functional type (PFT) labelsprep_aop_imagery
: prepare NEON AOP-derived rasters for PFT classifierextract_spectra_from_polygon
: Extract features (remote sensing data) for each pixel within the specified shapefile (tree crown for training, plot for prediction)
- For all sites at once,
train_pft_classifier
: train PFT classifier - For a single target site and year,
generate_initial_conditions
: generate FATES initial conditions (cohort and patch files) by combining forest structure and composition
We generate FATES intital conditions in three types:
ic_type == field_inv_plots
: initialization from NEON forest inventory plotsic_type == rs_inv_plots
: initialization from remote sensing data over NEON forest inventory plotsic_type == rs_random_plots
: initialization from remote sensing data over plots randomly generated across entire NEON site
The final result is at data_final_path/site/year/ic_type
.
# run all sites with default params
python main.py
# force prep_biomass to rerun for all sites/years
python main.py sites.global_run_params.force_rerun.prep_biomass=True
# run only SJER
python main.py sites.global_run_params.run=SJER
# run SJER and SOAP
python main.py sites.global_run_params.run='[SJER, SOAP]'
# run only SJER, force to rerun prep_biomass on SJER
python main.py sites.global_run_params.run=SJER sites.SJER.2019.force_rerun.prep_biomass=True