Coder Social home page Coder Social logo

mairindeith / deithbrodie2020_predictingdefaunationborneo Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 4.85 MB

Contains code used to generate a circuit-theoretic accessibility map for the Malaysian states of Borneo, and code used to fit N-mixture models of hunter site usage from camera traps in the region.

Shell 7.08% Python 43.47% R 49.45%

deithbrodie2020_predictingdefaunationborneo's Introduction

How to use this repo

This repo contains all code from Deith and Brodie, 2020 - "Predicting defaunation โ€“ accurately mapping bushmeat hunting pressure over large areas". The code was used to create the following map of Malaysian Borneo's accessibility to wild meat hunters:

Figure 1: Circuit-theoretic accessibility map of Malaysian Borneo

Script files are organized into folders based on their function.

  1. Creation of a resistance surface
  • ResistanceMapGeneration.py - using geospatial data layers with the same extent and resolution, performs calculations based on a. landcover, b. slope (from a digital elevation model), c. roadways, and d. rivers and stream order (from a digital elevation model).
  1. Circuit-theory based simulations across the resistance surface (using GFLOW software by Leonard et al.)
  • GRASS_IsochroneSampler.py - using settlement location geospatial data layer (as a .shp file), create GFLOW-specific source and sink node files (in .txt and .tsv format) to use as input to GFLOW simulations. This Python script must be run within an interactive GRASS session's terminal.
  • CircuitTheoreticMapCreation_GFLOW.sh - modification of script from GFLOW to loop iteratively over the source-sink pairs created with GRASS_IsochroneSampler.py. Output maps are created and modified according to local population density (inserted into the file names of the .txt and .tsv files created in the GRASS_IsochroneSampler.py).
  • GFLOWOutput_Summation.py - this script iterates through output files created with CircuitTheoreticMapCreation_GFLOW.sh, modifies the outputs of these files based on population density at each source village, and sums these into a final cumulative .tif map of circuit-theoretic accessibility for all source-sink pairings. This may need to be modified if the ouputs of CircuitTheoreticMapCreation_GFLOW.sh are modified within the shell script.
  1. N-mixture model creation and assessment
  • NMixtureModel_Workflow.R - an R file which contains all steps of the N-mixture model creation process (broken down into individual files in the subfolder NMixModel_Steps):
    • main.R - identical to the workflow script, this will run all stages of analysis by sourcing the following scripts:
    • functions.R - helper functions that are used later in the
    • load.R - load the raw data for covariates in the N-mixture models
    • clean.R - cleans input data and prepares it in the correct format for N-mixture model fitting
    • modelfitting.R - given a list of covariates, automatically creates formulae for N-mixture model and fits these models (designed to run on a cluster).

deithbrodie2020_predictingdefaunationborneo's People

Watchers

 avatar

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.