Skip to main content

Optimize transect length in ecological surveys.

Project description

===========
Virtual Ecologist
===========

A set of tools to optimize transect length in an ecological monitoring program.
The primary goal is to reduce transect length without losing the power to
detect a difference between surveys (e.g. seasonal surveys).

These tools assume that the data are collected from transects (which can be
variable in length), and each transect contains sequential data collection points.
E.g. A 50 meter transect with 1m2 plots spaced 4 meters apart.

It also assumes that you are assessing grouped data (e.g. functional groups,
lifeforms, guilds or a custom list of groupings used to cluster species) at an
individual location. For example, lifeforms (forbs, trees) in a remnant forest.


Installation
-----------
```bash
# clone repo
https://github.com/rayblick/Virtual-Ecologist.git
# cd in to root directory
python setup.py install
```

Usage
------------

```python
# Import library
from virtualecologist import virtualecologist as ve
# instantiate virtualecologist
# requires 2 datasets...
example = ve.VirtualEcologist("virtualecologist/data/pilotdata.csv",
"virtualecologist/data/fulldata.csv")
# uses pilot data to generate mean error rate
example.train_observer()
# match main data to the mean error rate
# if pilot data not given, you assume a 10% error rate for all groups
example.match_full_dataset()
# print to console a table of groups and error rates
# execution here returns error rate
example.print_table(example.mse_output)
# Main function
# isolate the location and the lifeform to investigate
# produces a figure showing number of plots to reduce
example.calc_mmd(site="swamp", lifeform="shrub")
# generates a stacked barchart for all sites and lifeforms in the dataset
example.create_barchart()
# get the probability density function for your selected lifeform
example.create_pdf_figure()
```

Example
==============

###Sampling design
--------------
Location: single wetland
Target habitat: hydrological gradient
Design: stratified-random transects (of variable length)
Sampling: 1m plots every 4m
Lifeform: damp tolerant terrestrial plants (Tda)

**Thresholds:**

+ Minimum detectable difference of 10%
+ All transects have to keep at least 4 plots each


![wc](https://raw.github.com/rayblick/Virtual-Ecologist/master/img/transects2014.jpg)


###Get started
-------------
```python
from virtualecologist import virtualecologist as ve
wc = ve.VirtualEcolgist("path/to/pilotdata.csv","path/to/fulldata.csv")
```

###Train your Virtual Ecolgist:
-------------
```python
wc.train_observer()
# find all cases that are not trained
wc.match_full_dataset()
# print mean square error for each life form
wc.print_table(wc.mse_output)
```

**Tabulated output:**
-------------
```markdown
+----+----------+---------+------------+
| ID | Lifeform | MSE | Pilot data |
+----+----------+---------+------------+
| 1 | ARp | 22.333 | yes |
| 2 | ATe | 315.452 | yes |
| 3 | ATl | 27.273 | yes |
| 4 | ATw | 306.5 | yes |
| 5 | Ate | 152.412 | no |
| 6 | T/ATe | 152.412 | no |
| 7 | T | 49.021 | yes |
| 8 | Tdr | 292.731 | yes |
| 9 | Tda | 53.576 | yes |
+----+----------+---------+------------+
```

###Calculate minimum detectable difference
--------------
```python
wc.calc_mmd(site="West Carne", lifeform="Tda")

# console printout
#>>> Max number of plots you can drop (if each transect still has 4 plots) is: 1.57
#>>> The trigger value was exceeded when the minimum number of plots per transect was less than: 17.0

```
The console print out summarizes the figure. In this example I can remove 1.57 plots
from each transect before the minimum detectable difference exceeds 10%. Importantly,
these results are associated with finding a minimum of 17 plots with at least
one species from the target group (Tda).

Note the dashed line in the figure which shows the number of plots with at least one species
from Tdr. Unsurprisingly, as I reduce plots from each transect, the minimum
detectable difference between my observations and the Virtual Ecologist increases
(and so does variability).

![mmd](https://raw.github.com/rayblick/Virtual-Ecologist/master/img/mdd.png)


###Produce probability density function
--------------
```python
# This will produce one figure for each group of plants
wc.create_pdf_figure()
```
![pdf](https://raw.github.com/rayblick/Virtual-Ecologist/master/img/pdf.png)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

virtualecologist-0.0.5.tar.gz (16.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

virtualecologist-0.0.5-py2.7.egg (18.3 kB view details)

Uploaded Egg

File details

Details for the file virtualecologist-0.0.5.tar.gz.

File metadata

File hashes

Hashes for virtualecologist-0.0.5.tar.gz
Algorithm Hash digest
SHA256 34ed8ef3fc75ee937526e28fab1bfed63f0ed724cf7eb9c9b6e51fc779b6dbb5
MD5 7098573c746c48dbceb3d9a9433c6c1b
BLAKE2b-256 06c202e51fd67c765fbd5f0a7a1d370d365342680f84052a32de9733f63801b7

See more details on using hashes here.

File details

Details for the file virtualecologist-0.0.5-py2.7.egg.

File metadata

File hashes

Hashes for virtualecologist-0.0.5-py2.7.egg
Algorithm Hash digest
SHA256 2410c260bfcbbe92a835f048100b0b0b3d88a497244fff11964d6afd45b09ee3
MD5 8f795cd1d76c5f650279a6af9fcd87ad
BLAKE2b-256 bb845442d7995191b491f912ae434f7ddf9da0c34523b3b4909df83f71ec49f6

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page