Skip to content

Commit

Permalink
Merge branch 'master' of github.com:weecology/portalPredictions into …
Browse files Browse the repository at this point in the history
…adjust_report
  • Loading branch information
sdtaylor committed Sep 27, 2017
2 parents b5b7c0a + a3acf21 commit 8252723
Show file tree
Hide file tree
Showing 48 changed files with 121,462 additions and 250 deletions.
37 changes: 28 additions & 9 deletions PortalHindcasts.R
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,31 @@ forecast_date = Sys.Date()
#Hindcast will set the time based on these NewMoonNumbers. For each one
#a hindcast will be made which pretends that sampleing period had just happened.
#403 to 490 is Jan,2010 - Jan,2017.
initial_time_NewMoons=403:490
initial_time_newmoons=403:490

for(this_NewMoon in initial_time_NewMoons){
trappings = read.csv(FullPath('PortalData/Rodents/Portal_rodent_trapping.csv', '~'))
incomplete_samples = portalr::find_incomplete_censuses(trappings)

for(this_newmoon in initial_time_newmoons){

moons = get_moon_data()

this_newmoon_sampling_date = moons %>%
filter(newmoonnumber == this_newmoon) %>%
pull(censusdate)

this_newmoon_period = moons %>%
filter(newmoonnumber == this_newmoon) %>%
pull(period)

#Don't do hindcasting from newmoons that had incomplete samplings
#or were not sampled at all
if(this_newmoon_period %in% incomplete_samples$period | is.na(this_newmoon_sampling_date)){
next
}

moons = get_moon_data() %>%
filter(newmoonnumber<=this_NewMoon)
filter(newmoonnumber<=this_newmoon)

#Beginning and end of the forecast timeperiod
most_recent_newmoon = moons$newmoonnumber[which.max(moons$period)]
Expand All @@ -33,12 +52,12 @@ for(this_NewMoon in initial_time_NewMoons){

rodent_data = get_rodent_data(moons, forecast_date, filename_suffix)
rodent_data$all = rodent_data$all %>%
filter(newmoonnumber <= this_NewMoon)
filter(newmoonnumber <= this_newmoon)
rodent_data$controls = rodent_data$controls %>%
filter(newmoonnumber <= this_NewMoon)
filter(newmoonnumber <= this_newmoon)

weather_data = get_weather_data(moons, rodent_data$all, first_forecast_newmoon, last_forecast_newmoon) %>%
filter(newmoonnumber <= this_NewMoon)
filter(newmoonnumber <= this_newmoon)

#Get only relevent columns now that this is isn't needed to subset weather.
rodent_data$all = rodent_data$all %>%
Expand All @@ -49,7 +68,7 @@ for(this_NewMoon in initial_time_NewMoons){
zero_abund_forecast = list(pred=rep(0,12), interval=matrix(rep(0,24), ncol=2))
colnames(zero_abund_forecast$interval) = c('lower','upper')

allforecasts=forecastall(rodent_data$all,"All",weather_data,weathermeans, forecast_date, forecast_newmoons, forecast_months, forecast_years)
controlsforecasts=forecastall(rodent_data$controls,"Controls",weather_data,weathermeans, forecast_date, forecast_newmoons, forecast_months, forecast_years)
allforecasts=try(forecastall(rodent_data$all,"All",weather_data,weathermeans, forecast_date, forecast_newmoons, forecast_months, forecast_years))
controlsforecasts=try(forecastall(rodent_data$controls,"Controls",weather_data,weathermeans, forecast_date, forecast_newmoons, forecast_months, forecast_years))

}
}
Empty file modified Rodent_silhouettes/2-MerriamsKangarooRat.png
100755 → 100644
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified Rodent_silhouettes/20-HispidCottonRat.png
100755 → 100644
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified Rodent_silhouettes/22-HarrisAntellopeSquirrel.png
100755 → 100644
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified Rodent_silhouettes/4-Banner-Tailed-KangarooRat.png
100755 → 100644
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified Rodent_silhouettes/8-BaileysPocketMouse.png
100755 → 100644
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
18 changes: 14 additions & 4 deletions about.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,20 @@
---
title: "About Portal Forecasts"
---
<br>

# Who we are
# The Portal Project

# What is Portal?
[The Portal project](http://portal.weecology.org/), located in the Chihuahuan desert of southern Arizona, is a long-term experimental monitoring project in desert ecology. There are over 40 years of data on rodents, plants, ants, and weather at the site. Rodent data are collected approximately monthly, an ideal scenario for short-term forecasts of rodent abundance.

#What is this?
There is a need for short term iterative forecasts in Ecology. To this end we are forecasting rodent abundances for our monthly sampling
<br>

# Ecological Forecasting

There is a need for short term iterative forecasts in ecology. We are using our monthly rodent trapping to create a platform for automated and validated forecasting.

<br>

# [Weecology](http://weecology.org/)

We are a group of ecologists at the University of Florida, interested in collaborative approaches to ecology, open science, and open data.
19 changes: 12 additions & 7 deletions docs/about.html
Original file line number Diff line number Diff line change
Expand Up @@ -204,15 +204,20 @@ <h1 class="title toc-ignore">About Portal Forecasts</h1>
</div>


<div id="who-we-are" class="section level1">
<h1>Who we are</h1>
<p><br></p>
<div id="the-portal-project" class="section level1">
<h1>The Portal Project</h1>
<p><a href="http://portal.weecology.org/">The Portal project</a>, located in the Chihuahuan desert of southern Arizona, is a long-term experimental monitoring project in desert ecology. There are over 40 years of data on rodents, plants, ants, and weather at the site. Rodent data are collected approximately monthly, an ideal scenario for short-term forecasts of rodent abundance.</p>
<p><br></p>
</div>
<div id="what-is-portal" class="section level1">
<h1>What is Portal?</h1>
<div id="ecological-forecasting" class="section level1">
<h1>Ecological Forecasting</h1>
<p>There is a need for short term iterative forecasts in ecology. We are using our monthly rodent trapping to create a platform for automated and validated forecasting.</p>
<p><br></p>
</div>
<div id="what-is-this" class="section level1">
<h1>What is this?</h1>
<p>There is a need for short term iterative forecasts in Ecology. To this end we are forecasting rodent abundances for our monthly sampling</p>
<div id="weecology" class="section level1">
<h1><a href="http://weecology.org/">Weecology</a></h1>
<p>We are a group of ecologists at the University of Florida, interested in collaborative approaches to ecology, open science, and open data.</p>
</div>


Expand Down
Binary file modified docs/index_files/figure-html/highabund_ts_forecasts-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/index_files/figure-html/highabund_ts_forecasts-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/index_files/figure-html/highabund_ts_forecasts-3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/index_files/figure-html/speciesforecasts-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/index_files/figure-html/unnamed-chunk-1-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 8252723

Please sign in to comment.