/cfo-big-trees

Saving the big ones

Primary LanguageJupyter Notebook

cfo-big-trees

Humboldt Redwoods State Park

Saving the big ones.



Background

Landscapes throughout the western US are undergoing rapid changes in the face of global climate change and are impacting our reliance on the ecosystem services they provide.

Managers, collaboratives, and other stakeholders are faced with difficult decisions regarding how best to manage for multiple resource benefits while fostering the development of resilient landscapes, capable of enduring future disturbances and ongoing climate change.

Large trees, historically a common feature, formed the backbone of western landscapes and played a keystone role in terrestrial and aquatic processes. Their thick bark, decay resistant wood, and massive size buffered them against fire and drought disturbances, while locking in carbon reserves and providing important habitat. These properties also made them a target for logging and their abundance is now a fraction of their pre Euro-American era levels.

Currently, little information exists as to the distribution of large trees across the Sierran landscape, nor about the factors most associated with their persistence on the land.

The goals of this project are to:

  • Identify the locations of large trees
  • Quantify their functional value for carbon storage and wildlife
  • Use machine learning to model their biophysical environment and predict likely locations for large trees in the future, and
  • Use a landscape simulation model to determine the effects of treatments on the distribution of large trees across a 1 million hectare subregion and assess their variability under climate change.

This repository tracks our progress towards these goals.


Project partners

The Big Trees project is a collaboration between Blue Forest Conservation, USFS Region 5 & Salo Sciences.


Repository tools

This repository contains scripts, figures & documentation for the Big Trees project. You can clone the repository locally with:

git clone https://github.com/forestobservatory/cfo-big-trees.git

Because we're working with a mix of collaborators and an array of data types, we store code from multiple languages:

  • python/ - contains standalone python scripts, typically for raw data processing.
  • R/ - contains standalone R scripts, typically for modeling and making figures.
  • notebooks/ - contains jupyter notebooks, likewise for modeling and making figures.

To facilitate collaboration across the team, we manage project dependencies through conda.

conda

conda manages package, dependencies & environments for many languages. I recommend installing Miniconda, which is available for Windows, Linux & Mac.

You can create the custom big-trees conda environment from the base repository directory with:

conda env update

This will install all the project dependencies into a standalone environment, which can be activated with:

conda activate big-trees

R packages

conda only hosts a subset of the many packages available through CRAN. In order to consistently declare and manage the R packages we use that are not available through conda, we've set up a short package install script. From within your conda environment, run:

Rscript R/requirements.R

Make sure you update this file each time you add new R scripts with new packages.

pre-commit

pre-commit is tool for managing and maintaining multi-language code standards and git hygiene. These utilities will ensure that all code has been subjected to a series of automated checks - like consistently formatting code or preventing personal tokens from being uploaded - before any code gets committed to the repository.

Once you've created and activated the big-trees conda environment, you can install the project's pre-commit hooks from the base directory of the repository:

pre-commit install

Once you've installed these hooks, pre-commit will run the automated code checks every time you run git add {some-file.R} and git commit -m '{some message}'. If it fails - don't worry! Pre-commit will typically apply the required changes needed to get the code properly formatted. You'll just need to re-run the above commands to add/commit the file again.

The hooks used by this project are managed by the .pre-commit-config.yml file. This includes a set of pre-commit hooks for python and pre-commit hooks for R, which are mostly for linting and styling files.

Data

There are a series of data sets we work with in this project that are either too large to share (CFO geotiffs) or contain confidential information (FIA locations). The project partners have established a Google Drive directory that contains this data - at least some of it. But we still need to develop common scripts/workflows to consistently analyze these data

The workaround for this is for project parters to download the relevant datasets they need, and store them in data/. This directory is ignored via the repository's .gitignore file, which means that any file in that directory will not be committed to git. All paths to data files in code should point to data/.


Contact

  • Christopher Anderson (Salo Sciences) - email
  • Kim Quesnel (Blue Forest Conservation) - email
  • Nicholas Povak (USFS Region 5) - email