Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (
Help us improve Python packaging - Donate today!

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.

# clone repo
# cd in to root directory
python install


# Import library
from virtualecologist import virtualecologist as ve
# instantiate virtualecologist
# requires 2 datasets...
example = ve.VirtualEcologist("virtualecologist/data/pilotdata.csv",
# uses pilot data to generate mean error rate
# match main data to the mean error rate
# if pilot data not given, you assume a 10% error rate for all groups
# print to console a table of groups and error rates
# execution here returns error rate
# 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
# get the probability density function for your selected lifeform


###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)


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


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

###Train your Virtual Ecolgist:
# find all cases that are not trained
# print mean square error for each life form

**Tabulated output:**
| 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
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).


###Produce probability density function
# This will produce one figure for each group of plants

Release History

This version
History Node


History Node


Download Files

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

File Name & Hash SHA256 Hash Help Version File Type Upload Date
(18.3 kB) Copy SHA256 Hash SHA256
2.7 Egg Jan 29, 2016
(16.3 kB) Copy SHA256 Hash SHA256
Source Jan 29, 2016

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting