Source Code for article "Attribution of Plastic Sources Using Bayesian Inference: Application to River-Sourced Floating Plastic in the South Atlantic Ocean"
This repository contains the code to reproduce the results shown in the article "Attribution of Plastic Sources Using Bayesian Inference: Application to River-Sourced Floating Plastic in the South Atlantic Ocean" doi: 10.3389/fmars.2022.925437. In general, you can find the scripts for running the simulation and the scripts for analyzing the output of the simulation.
This code uses Ocean Parcels to perform the simulations. We recommend creating and environment to run the code as explained here. For the analysis, make sure to install the packages on the requirements.txt
.
Here is a description of scripts according to it's function:
To run the following scripts download data from the simulations from the supplementary material. For the scripts to work make sure to save the Data from the supplementary material within this repository such as BayesianInference_SouthAtlantic/PierardBassottoMeirervanSebille_AttributionofPlastic
.
We recommend running the scripts in the following order:
-
python/article_plots.py
: plots the figures shown in the article. The analysis files that you get from step 1, 2, and 3 are in thePierardBassottoMeirervanSebille_AttributionofPlastic/analysis
. You can plot the plots without running the analysis -
python/compute_probability.py
: computes the probabilities in the domain. -
python/beached_probability.py
: computes the probabilities for beached particles. -
python/Bootstrapping.py
: computes the standard deviation by performing bootstrapping. This takes 1 day in a super computer. Avoid running it in the local computer.
To run the simulations you need to download the SMOC velocity fields from April 2016 to august 2020.
-
Run before simulation:
python/landmask.py
: creates the supporting fields that deal with the land-boundaries.python/release_positions.py
: creates the initial conditions for the particles.
-
Run Simulation:
parcels_simulations.py
: script that runs the Lagrangian simulation.local_kernels.py
: contains the kernels used in theparcels_simulations.py
. You don't need to run it.
The original contributions presented in the study are publicly available. This data can be found here: doi:10.24416/UU01-THF29M.