summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKen Kellner <ken@kenkellner.com>2018-08-31 12:23:41 (GMT)
committerKen Kellner <ken@kenkellner.com>2018-08-31 12:24:25 (GMT)
commit1904e1fa971f0d23a4a895f7c355bb8428e0e76b (patch)
tree5419f592781aabe8bab5d34a11a6d81b2023af28
parentbd9a1f8f6ef9d9e7a9c2e276c2add31fb154ecad (diff)
parentca25228ccbfb1ef525c949f25d0eb12aa827e642 (diff)
Merge talk repos
-rw-r--r--.gitignore7
-rwxr-xr-xcollect-images.sh35
-rw-r--r--common.tex8
-rw-r--r--content.md6
-rw-r--r--data-sources.R6
-rw-r--r--figures.R19
-rw-r--r--hee_map.R85
-rw-r--r--image-sources.txt23
-rw-r--r--makefile33
-rw-r--r--talk.tex2
10 files changed, 188 insertions, 36 deletions
diff --git a/.gitignore b/.gitignore
index f3b1d87..7ad78e5 100644
--- a/.gitignore
+++ b/.gitignore
@@ -8,8 +8,9 @@
*.toc
*.bbl
*.blg
-bibsources.tex
+*.bst
+*.bib
content.tex
datasources.R
-imagesources.tex
-images*
+images/*
+figures*
diff --git a/collect-images.sh b/collect-images.sh
new file mode 100755
index 0000000..f5e1e2b
--- /dev/null
+++ b/collect-images.sh
@@ -0,0 +1,35 @@
+#!/bin/bash
+
+while read location path filename command ;
+do
+ if [ "$location" == "remote" ]; then
+ wget -nc $path -O images/$filename
+ elif [ "$location" == "convert" ]; then
+ #needs librsvg2-bin for svg conversions
+ $command $HOME/$path images/$filename
+ else
+ cp -n $HOME/$path images/$filename
+ fi
+done < image-sources.txt
+
+#Manual image conversions
+inkscape -z $HOME/images/research/clearcut_diagram.svg -e=images/clearcut_diagram.png --export-dpi=300
+inkscape -z $HOME/images/research/patchcut_diagram.svg -e=images/patchcut_diagram.png --export-dpi=300
+inkscape -z $HOME/images/research/shelterwood_diagram.svg -e=images/shelterwood_diagram.png --export-dpi=300
+inkscape -z $HOME/images/research/singletree_diagram.svg -e=images/singletree_diagram.png --export-dpi=300
+inkscape -z $HOME/images/research/dispersal_methods.svg --export-eps images/dispersal_methods.eps
+inkscape -z $HOME/images/research/soel_diagram.svg -e=images/soel_diagram.png --export-dpi=300
+
+if ! [ -f images/rubus.png ]; then
+ convert images/rubus.jpg images/rubus.png
+fi
+if ! [ -f images/scarlet_tanager.png ]; then
+ convert images/scarlet_tanager.jpg images/scarlet_tanager.png
+fi
+
+#needs gifsicle package
+if ! [ -d images/soel ]; then
+ echo "Building SOEL animation..."
+ mkdir images/soel
+ gifsicle --unoptimize $HOME/images/research/animation_contextualforest.gif | convert - images/soel/frame-%d.png
+fi
diff --git a/common.tex b/common.tex
index f5cbcc5..d9779bc 100644
--- a/common.tex
+++ b/common.tex
@@ -1,18 +1,18 @@
\title{Wildlife in managed forests: \\ demographic patterns and trophic interactions}
-\date{19 September 2017}
+\date{31 January 2018}
\author{\textbf{Ken Kellner}}
-\institute{Forestry and Natural Resources, Purdue University}
+%\institute{Forestry and Natural Resources, Purdue University}
%\setbeamertemplate{frame footer}{Kellner - Demo Talk}
\usepackage{listings}
\usepackage{animate}
-\input{imagesources}
+\graphicspath{{images/}{figures/}}
\definecolor{firebrick}{HTML}{FF3030}
\definecolor{brickred}{HTML}{CB4154}
\usepackage[comma,sort]{natbib}
-\bibliographystyle{ecology}
+\bibliographystyle{style}
\renewcommand{\bibsection}{}
\lstset{
diff --git a/content.md b/content.md
index 34d9f1f..d6b5980 100644
--- a/content.md
+++ b/content.md
@@ -232,7 +232,7 @@ Worm-eating Warbler
\includegraphics[height=2.9in]{hl_rich.pdf}
## Habitat Factors
-\p \ftline{Ruhl et al. \textit{in prep}}
+\p \ftline{Ruhl et al. \textit{in review}}
\centering
\includegraphics[height=2.7in]{clearcut_fruit.pdf}
@@ -302,7 +302,7 @@ Do changes in habitat affect foraging behavior, and thus SDE?
## Measuring Acorn Fate
\centering
-\includegraphics[height=2.2in]{dispersal_methods.png}
+\includegraphics[height=2.2in]{dispersal_methods.eps}
## Seed Dispersal Effectiveness
\ftline{\cite{Kellner2016}}
@@ -378,5 +378,5 @@ Does this affect oak regeneration success?
## Questions
\LARGE
+kenneth.kellner@mail.wvu.edu
-kkellner@purdue.edu
diff --git a/data-sources.R b/data-sources.R
new file mode 100644
index 0000000..a4216ed
--- /dev/null
+++ b/data-sources.R
@@ -0,0 +1,6 @@
+micromn <- read.csv('~/research/archive/hee_small_mammals/data/hee_microsite_means.csv',header=T)
+load('~/research/archive/hee_bird_abundance/hl_bird_abun.Rdata')
+birds <- read.csv('~/research/archive/hee_bird_abundance/data/hee_mistnets_2015.csv',header=T)
+veg <- read.csv('~/research/archive/hee_bird_abundance/data/hee_mistnet_veg.csv',header=T)
+load('~/research/archive/hee_acorn_dispersal/output_dispersal.Rdata')
+load('~/research/archive/soel/casestudy_predation.Rdata')
diff --git a/figures.R b/figures.R
index 173ff7a..1b9c0c5 100644
--- a/figures.R
+++ b/figures.R
@@ -1,6 +1,6 @@
#Data sources
-source('datasources.R')
+source('data-sources.R')
#Load required packages
if(!'png'%in%installed.packages()[,'Package']){
@@ -17,7 +17,7 @@ set.seed(2016)
control <- rnorm(10,0.3,0.05)
treatment <- c(rnorm(3,0.3,0.05),rnorm(7,1,0.1))
-pdf("images/baci.pdf",width=5.7,height=4, pointsize=10)
+pdf("figures/baci.pdf",width=5.7,height=4, pointsize=10)
par(mgp=c(3,1,0),mar = c(4.5,4.5,1,1) + 0.1,oma=c(0,0,0,0))
structure <- c(1:10)
@@ -46,7 +46,7 @@ dev.off()
#Species response, harvest scale
source("https://raw.githubusercontent.com/kenkellner/hee-bird-abundance/master/figures/figure_resp_summary.R")
-pdf("images/hl_resp.pdf",width=6.5,height=4,pointsize=10)
+pdf("figures/hl_resp.pdf",width=6.5,height=4,pointsize=10)
resp.summary.figure('hl',c(-8.5,20.5),cols.hl[c(2,2,3,3)],text.cex=0.65,
highlight.shrubland=TRUE,lab.cex=1.3)
@@ -57,7 +57,7 @@ dev.off()
#Individual Species, Harvest Scale
source('https://raw.githubusercontent.com/kenkellner/hee-bird-abundance/master/figures/figure_birddens.R')
-pdf("images/focal_hl.pdf",width=6.5,height=4,pointsize=9)
+pdf("figures/focal_hl.pdf",width=6.5,height=4,pointsize=9)
par(fig=c(0,0.54,0.43,1),new=FALSE)
bird.figure('BAWW','hl',color=cols.hl,title=
@@ -83,7 +83,7 @@ dev.off()
# Harvest-level Bird Richness figure
source("https://raw.githubusercontent.com/kenkellner/hee-bird-abundance/master/figures/figure_richness.R")
-pdf("images/hl_rich.pdf",width=6,height=4,pointsize=10)
+pdf("figures/hl_rich.pdf",width=6,height=4,pointsize=10)
richness.figure(scale='hl',figmin=16.5,figmax=32,cols=cols.hl,
pchs=c(17,15,16,18,21),ltys=rep(1,5),xlab="",lab.cex=1.7,leg.cex=1.3)
dev.off()
@@ -108,7 +108,7 @@ scta.sum <- scta.sum[order(scta.sum$Date),]
veg$Date <- as.Date(as.character(veg$Date), "%m/%d/%Y")
veg.sort <- veg[order(veg$Date),]
-pdf("images/clearcut_fruit.pdf",width=6.5,height=4,pointsize=10)
+pdf("figures/clearcut_fruit.pdf",width=6.5,height=4,pointsize=10)
#Set up plot
par(mgp=c(3,1,0),mar = c(4.5,4.5,1,4.5) + 0.1,oma=c(0,0,0,0))
@@ -163,7 +163,7 @@ alldata[,,4] <- clearmean
#########################
#Microhabitat subset figure
-pdf("images/smam_microhab_subset.pdf",width=7,height=4,pointsize=10)
+pdf("figures/smam_microhab_subset.pdf",width=7,height=4,pointsize=10)
par(mfrow=c(2,3), oma = c(2,2,1,1), mar=c(2,2.5,2.5,1))
@@ -283,7 +283,7 @@ gen.sde.fig = function(year,xaxis=F,yaxt=TRUE,legend=F){
}
-pdf('images/sde.pdf',width=6.3,height=4,pointsize=10)
+pdf('figures/sde.pdf',width=6.3,height=4,pointsize=10)
par(mar = c(4.5,2.5,2,0.5) + 0.1,oma=c(1.5,2.5,0,0))
par(mfrow=c(1,3))
@@ -319,7 +319,7 @@ structure <- c(1,2)
cols <- rev(c(rgb(red=244,green=125,blue=66, maxColorValue=255),
rgb(red=141,green=213,blue=18, maxColorValue=255)))
-pdf("images/soel_predation.pdf",width=6.7,height=4, pointsize=10)
+pdf("figures/soel_predation.pdf",width=6.7,height=4, pointsize=10)
############################################################
par(mar = c(2.5,4.5,1,2) + 0.1)
@@ -386,4 +386,3 @@ points(structure,mns,cex=4,bg=cols,pch=21)
text(structure,(uplim+4),c('A','A'))
dev.off()
-
diff --git a/hee_map.R b/hee_map.R
new file mode 100644
index 0000000..eb61651
--- /dev/null
+++ b/hee_map.R
@@ -0,0 +1,85 @@
+suppressMesssages(library(ggplot2))
+suppressMessages(library(sf))
+options(tidyverse.quiet=TRUE)
+library(tidyverse)
+suppressMessages(library(ggsn))
+
+setwd('~/research/gis/boundaries')
+
+mmyf_bounds = st_read('mmsf_ysf_boundaries.shp',quiet=T) %>%
+ mutate(is_forest = 'State Forest')
+hee_bounds = st_read('hee_cores.shp',quiet=T)[1:9,] %>%
+ mutate(Treatment = factor(Treatment, levels=c('Even-aged','Uneven-aged',
+ 'Control')))
+harvest_bounds = st_read('hee_harvests_2008.shp',quiet=T) %>%
+ mutate(HarvestTyp = factor(HarvestTyp,levels=c('clearcut','shelter',
+ 'patch','single-tree','no harvest')),
+ HarvestTyp = fct_recode(HarvestTyp,Clearcut='clearcut',
+ Shelterwood ='shelter',`Patch Cut` = 'patch',
+ `Single-tree` = 'single-tree',
+ `No Harvest` = 'no harvest'))
+
+bird_points = st_read('../experiments/hee_bird_points_all.shp',quiet=T) %>%
+ filter(Unit %in% 1:3) %>%
+ mutate(label = 'Bird Point')
+
+hee_coords = st_coordinates(hee_bounds)
+
+hee_map = mmyf_bounds %>% ggplot() +
+ geom_sf(aes(fill=is_forest)) +
+ geom_sf(data=hee_bounds,aes(fill=Treatment)) +
+ scale_fill_manual(name=NULL,
+ values=c('gray','firebrick1','gray95','dodgerblue'),
+ breaks=c('State Forest','Even-aged','Uneven-aged',
+ 'Control')) +
+ coord_sf(xlim=range(hee_coords[,'X']),
+ ylim=range(hee_coords[,'Y'])) +
+ theme_void() +
+ theme(axis.title.x=element_blank(),
+ axis.title.y=element_blank(),
+ axis.text.x=element_blank(),
+ axis.text.y=element_blank(),
+ legend.position=c(0.8,0.9),
+ legend.text=element_text(size=9),
+ legend.title=NULL,
+ panel.grid.major = element_line(color = 'transparent')) +
+ scalebar(hee_bounds,dist=2,dd2km=F,st.size=3,location='bottomleft')
+
+hee_map
+
+##
+
+hee_sub = hee_bounds %>%
+ filter(UnitNumber %in% 1:3)
+
+sub_coords = st_coordinates(hee_sub)
+
+sub_map = mmyf_bounds %>% ggplot() +
+ geom_sf(aes(fill=is_forest)) +
+ geom_sf(data=hee_sub) +
+ geom_sf(data=harvest_bounds,aes(fill=HarvestTyp)) +
+ geom_sf(data=bird_points,aes(color=label),show.legend='point') +
+ scale_color_manual(name=NULL, values=c('Bird Point' = 'black'),
+ guide = guide_legend(order=1)) +
+ scale_fill_manual(name=NULL,
+ values=c('firebrick1','gray','orange','dodgerblue',
+ 'forestgreen','gray95'),
+ breaks=c('State Forest','Clearcut','Shelterwood',
+ 'Patch Cut','Single-tree','No Harvest'),
+ guide = guide_legend(override.aes =
+ list(shape = NA),order=2,
+ title.position='bottom')) +
+ coord_sf(xlim=range(sub_coords[,'X']),
+ ylim=range(sub_coords[,'Y'])) +
+ theme_void() +
+ theme(axis.title.x=element_blank(),
+ axis.title.y=element_blank(),
+ axis.text.x=element_blank(),
+ axis.text.y=element_blank(),
+ legend.position=c(0.8,0.36),
+ legend.text=element_text(size=9),
+ legend.title=NULL,
+ panel.grid.major = element_line(color = 'transparent')) +
+ scalebar(hee_sub,dist=0.5,dd2km=F,st.size=3,location='topleft')
+
+sub_map
diff --git a/image-sources.txt b/image-sources.txt
new file mode 100644
index 0000000..8e7e833
--- /dev/null
+++ b/image-sources.txt
@@ -0,0 +1,23 @@
+remote https://upload.wikimedia.org/wikipedia/commons/9/9f/Controlled_burn_in_northern_Portugal.jpg fire.jpg
+remote https://upload.wikimedia.org/wikipedia/commons/5/54/Mniotilta_varia_3.jpg blackandwhite_warbler.jpg
+remote https://upload.wikimedia.org/wikipedia/commons/f/f3/Dendroica-cerulea-002.jpg cerulean_warbler.jpg
+remote https://upload.wikimedia.org/wikipedia/commons/b/bb/Timber_Harvest.jpg timber_harvest.jpg
+remote https://upload.wikimedia.org/wikipedia/commons/b/b5/Hooded_Warbler_%28Setophaga_citrina%29.jpg hooded_warbler.jpg
+remote https://upload.wikimedia.org/wikipedia/commons/7/71/Worm-eating_Warbler.jpg worm_eating_warbler.jpg
+remote https://upload.wikimedia.org/wikipedia/commons/2/22/Rubus_fructicosus_owoce_646.jpg rubus.jpg
+remote https://upload.wikimedia.org/wikipedia/commons/e/e6/Tamias_striatus_juilllet_2011-CN.jpg each.jpg
+remote https://upload.wikimedia.org/wikipedia/commons/thumb/1/19/Deer_Mouse_%28Peromyscus_maniculatus%29_%289310532204%29.jpg/1024px-Deer_Mouse_%28Peromyscus_maniculatus%29_%289310532204%29.jpg wfmo.jpg
+remote https://upload.wikimedia.org/wikipedia/commons/thumb/0/07/Grey_squirrel_%28Sciurus_carolinensis%29_02.jpg/1280px-Grey_squirrel_%28Sciurus_carolinensis%29_02.jpg grsq.jpg
+remote https://upload.wikimedia.org/wikipedia/commons/f/f7/Tamia_striatus_eating.jpg each_dispersal.jpg
+remote https://upload.wikimedia.org/wikipedia/commons/1/1b/Scarlet_Tanager_-_Texas-_USA_H8O9998_%2822882467759%29.jpg scarlet_tanager.jpg
+local images/research/hee_logo.png hee_logo.png
+local images/research/hee_patch_spring2011.jpg hee_patch_spring2011.jpg
+local images/research/rightarrow.png rightarrow.png
+local images/research/hee_area_transparent.pdf hee_area_transparent.pdf
+local images/research/hee_cores_transparent.pdf hee_cores_transparent.pdf
+local images/research/oak_seedling.png oak_seedling.png
+convert images/research/hee_shelterwood_spring2011.png shelterwood.png convert -crop 25%x100%+0+0
+convert images/research/hee_clearcut_spring2009.png clearcut.png convert -crop 25%x100%+1000+0
+convert images/research/hee_singletree_spring2011.jpg singletree.png convert -crop 25%x100%+1000+0
+convert images/research/hee_patch_spring2011.jpg patch.png convert -crop 25%x100%+0+0
+convert images/research/hee_clearcut_spring2011.png clearcut_long.png convert -crop 70%x100%+500+0
diff --git a/makefile b/makefile
index 882bad9..bda67cd 100644
--- a/makefile
+++ b/makefile
@@ -1,28 +1,31 @@
-beamer:
+BIBSTYLE = https://schneider.ncifcrf.gov/ftp/ecology.bst
+
+talk-fnr-2018.pdf: content.md talk.tex common.tex references.bib style.bst images figures
pandoc content.md --slide-level 2 --listings -t beamer -o content.tex
xelatex talk.tex
bibtex talk
xelatex talk.tex
- bibtex talk
xelatex talk.tex
pdftk talk.pdf cat 1-36 output talk1.pdf
pdftk talk.pdf cat 37-end output talk2.pdf
gs -sDEVICE=pdfwrite -dMaxSubsetPct=100 -dPDFSETTINGS=/prepress -dEmbedAllFonts=true -dAutoFilterColorImages=false -dColorImageFilter=/FlateEncode -sOutputFile="talk1_small.pdf" -dNOPAUSE -dBATCH "talk1.pdf"
- pdftk talk1_small.pdf talk2.pdf cat output talk_small.pdf
+ pdftk talk1_small.pdf talk2.pdf cat output talk-fnr-2018.pdf
rm talk.pdf talk1_small.pdf talk1.pdf talk2.pdf
- firefox talk_small.pdf
-notes:
- pandoc content.md --listings -o content.tex
- xelatex notes.tex
- gs -sDEVICE=pdfwrite -dMaxSubsetPct=100 -dPDFSETTINGS=/prepress -dEmbedAllFonts=true -dAutoFilterColorImages=false -dColorImageFilter=/FlateEncode -sOutputFile="notes_small.pdf" -dNOPAUSE -dBATCH "notes.pdf"
- rm notes.pdf
- firefox notes_small.pdf
+ xdg-open talk-fnr-2018.pdf
-clean:
- rm -fv *.aux *.log *.toc *.blg *.bbl *.synctex.gz *.out *.snm *.nav *.vrb content.tex
+references.bib: content.md
+ pubs extract-tex content.md references.bib
-sources:
- bash ./gen_sources.sh
+style.bst:
+ wget -nc $(BIBSTYLE) -O style.bst
+
+images: collect-images.sh image-sources.txt
+ @mkdir -p images
+ bash collect-images.sh
-figures:
+figures: figures.R data-sources.R
+ @mkdir -p figures
Rscript figures.R
+
+clean:
+ rm -fv *.aux *.log *.toc *.blg *.bbl *.synctex.gz *.out *.snm *.nav *.vrb content.tex *.bib
diff --git a/talk.tex b/talk.tex
index 2d9d2a5..d1a0218 100644
--- a/talk.tex
+++ b/talk.tex
@@ -40,7 +40,7 @@
\begin{frame}{References}
\footnotesize
-\include{bibsources}
+\bibliography{references}
\end{frame}
\end{document}