summaryrefslogtreecommitdiff
path: root/gen_sources.sh
blob: 7018d9d2c6129c6514ebcddcf459182e1921f17b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
#!/bin/bash

#Save bibliography location
if ! [ -s bibsources.tex ]
then
    echo "Specify path to bibtex file"
    read path
    echo "\\bibliography{$path}" > bibsources.tex
fi

#Make image directory if needed
if ! [ -d images ]
then 
    mkdir images 
fi

#Save image directory location if necessary (relative!)
if ! [ -s imagesources.tex ]
then
    echo "Specify path to source photos"
    read imgdir2
    echo "\\graphicspath{{$imgdir2/}{images/}}" > imagesources.tex
fi

#Save data source locations for R
if ! [ -s datasources.R ]
then
    echo "Specify path to mammal microsite data"
    read path
    echo "micromn <- read.csv(\"$path\",header=T)" > datasources.R
    echo "Specify path to bird abundance model"
    read path
    echo "load(\"$path\")" >> datasources.R
    echo "Specify path to SCTA abundance data"
    read path
    echo "birds <- read.csv(\"$path\",header=T)" >> datasources.R
    echo "Specify path to Rubus data"
    read path
    echo "veg <- read.csv(\"$path\",header=T)" >> datasources.R
    echo "Specify path to acorn dispersal model output"
    read path
    echo "load(\"$path\")" >> datasources.R
    echo "Specify path to SOEL predation output"
    read path
    echo "load(\"$path\")" >> datasources.R
fi

#List of images to include
cd images
wget https://upload.wikimedia.org/wikipedia/commons/9/9f/Controlled_burn_in_northern_Portugal.jpg -O fire.jpg
wget https://upload.wikimedia.org/wikipedia/commons/5/54/Mniotilta_varia_3.jpg -O blackandwhite_warbler.jpg
wget https://upload.wikimedia.org/wikipedia/commons/f/f3/Dendroica-cerulea-002.jpg -O cerulean_warbler.jpg
wget https://upload.wikimedia.org/wikipedia/commons/b/bb/Timber_Harvest.jpg -O timber_harvest.jpg
wget https://upload.wikimedia.org/wikipedia/commons/b/b5/Hooded_Warbler_%28Setophaga_citrina%29.jpg -O hooded_warbler.jpg
wget https://upload.wikimedia.org/wikipedia/commons/7/71/Worm-eating_Warbler.jpg -O worm_eating_warbler.jpg
wget https://upload.wikimedia.org/wikipedia/commons/2/22/Rubus_fructicosus_owoce_646.jpg -O rubus.jpg
wget https://upload.wikimedia.org/wikipedia/commons/e/e6/Tamias_striatus_juilllet_2011-CN.jpg -O each.jpg
wget 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 -O wfmo.jpg
wget https://upload.wikimedia.org/wikipedia/commons/thumb/0/07/Grey_squirrel_%28Sciurus_carolinensis%29_02.jpg/1280px-Grey_squirrel_%28Sciurus_carolinensis%29_02.jpg -O grsq.jpg
wget https://upload.wikimedia.org/wikipedia/commons/f/f7/Tamia_striatus_eating.jpg -O each_dispersal.jpg

convert rubus.jpg rubus.png
rm rubus.jpg
wget https://upload.wikimedia.org/wikipedia/commons/1/1b/Scarlet_Tanager_-_Texas-_USA_H8O9998_%2822882467759%29.jpg -O scarlet_tanager.jpg
convert scarlet_tanager.jpg scarlet_tanager.png
rm scarlet_tanager.jpg

cd ..

#Hardcoded bc windows...
convert $imgdir2/hee_shelterwood_spring2011.png -crop 25%x100%+0+0 images/shelterwood.png
convert $imgdir2/hee_clearcut_spring2009.png -crop 25%x100%+1000+0 images/clearcut.png
convert $imgdir2/hee_singletree_spring2011.jpg -crop 25%x100%+1000+0 images/singletree.png
convert $imgdir2/hee_patch_spring2011.jpg -crop 25%x100%+0+0 images/patch.png
convert $imgdir2/hee_clearcut_spring2011.png -crop 70%x100%+500+0 images/clearcut_long.png
convert -density 200 -background transparent $imgdir2/dispersal_methods.svg images/dispersal_methods.png
convert -density 200 -background transparent $imgdir2/clearcut_diagram.svg images/clearcut_diagram.png
convert -density 200 -background transparent $imgdir2/patchcut_diagram.svg images/patchcut_diagram.png
convert -density 200 -background transparent $imgdir2/shelterwood_diagram.svg images/shelterwood_diagram.png
convert -density 200 -background transparent $imgdir2/singletree_diagram.svg images/singletree_diagram.png
convert -density 200 -background transparent $imgdir2/soel_diagram.svg images/soel_diagram.png

if ! [ -d images/soel]
then
    mkdir images/soel
fi

gifsicle --unoptimize $imgdir2/animation_contextualforest.gif | convert - images/soel/frame-%d.png