forked from hansenjohnson/WhaleMap
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
160 lines (134 loc) · 3.48 KB
/
Makefile
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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
## DEFINE VARIABLES
report_error = @bash src/report_error.sh $<
remove_error = @bash src/remove_error.sh $<
## ALL ##
.PHONY : all
all : obs latest wi dma map
## OBSERVATIONS ##
.PHONY : obs
obs : data/processed/observations.rds
# Combine all sightings
data/processed/observations.rds : R/combine.R \
data/interim/ccs_*.rds \
data/interim/dcs_archived_*.rds \
data/interim/dcs_live_*.rds \
data/interim/narwc_*.rds \
data/interim/neaq_aerial_*.rds \
data/interim/neaq_vessel_*.rds \
data/interim/neaq_sne_*.rds \
data/interim/nefsc_archived_*.rds \
data/interim/nefsc_vessel_*.rds \
data/interim/nerw_*.rds \
data/interim/serw_*.rds \
data/interim/wi_*.rds \
data/interim/wm_*.rds
$(report_error)
Rscript $<
$(remove_error)
# CCS
data/interim/ccs_*.rds : R/proc_ccs.R data/raw/ccs/*
$(report_error)
Rscript $<
$(remove_error)
# DCS archived tracks
data/interim/dcs_archived_*.rds : R/proc_archived_dcs.R data/raw/dcs/archived/*/*
$(report_error)
Rscript $<
$(remove_error)
# DCS live tracks
data/interim/dcs_live_*.rds : R/proc_live_dcs.R data/raw/dcs/live/*/*
$(report_error)
Rscript $<
$(remove_error)
# NARWC
data/interim/narwc_*.rds : R/proc_narwc.R data/raw/narwc/*
$(report_error)
Rscript $<
$(remove_error)
# NEAq aerial
data/interim/neaq_aerial_*.rds : R/proc_neaq_aerial.R data/raw/neaq/aerial/*
$(report_error)
Rscript $<
$(remove_error)
# NEAq vessel
data/interim/neaq_vessel_*.rds : R/proc_neaq_vessel.R data/raw/neaq/vessel/*
$(report_error)
Rscript $<
$(remove_error)
# NEAq SNE
data/interim/neaq_sne_*.rds : R/proc_neaq_sne.R data/raw/neaq/sne/*
$(report_error)
Rscript $<
$(remove_error)
# NEFSC archived
data/interim/nefsc_archived_*.rds : R/proc_nefsc_archived.R data/raw/wm/*
$(report_error)
Rscript $<
$(remove_error)
# NEFSC vessel
data/interim/nefsc_vessel_*.rds : R/proc_nefsc_vessel.R data/raw/nefsc_vessel/*
$(report_error)
Rscript $<
$(remove_error)
# NERW
data/interim/nerw_*.rds : R/proc_nerw.R data/raw/nerw/*
$(report_error)
Rscript $<
$(remove_error)
# SERW
data/interim/serw_*.rds : R/proc_serw.R data/raw/serw/*/*.csv
$(report_error)
Rscript $<
$(remove_error)
# SAS sightings
# data/interim/sas_obs.rds : R/share_sas.R data/raw/sas/*
# $(report_error)
# Rscript $<
# $(remove_error)
# WhaleInsight
data/interim/wi_*.rds : R/proc_wi.R data/raw/wi/*
$(report_error)
Rscript $<
$(remove_error)
# WhaleMap (old)
data/interim/wm_*.rds : R/proc_wm.R data/raw/wm/*
$(report_error)
Rscript $<
$(remove_error)
## DCS latest positions ##
.PHONY : latest
latest : data/processed/dcs_live_latest_position.rds
# Process dcs positions
data/processed/dcs_live_latest_position.rds : R/proc_dcs_latest_position.R \
data/interim/dcs_live_eff.rds
$(report_error)
Rscript $<
$(remove_error)
## WI ##
.PHONY : wi
wi : shared/dfo-whalemap/*.csv
# Share data with DFO
shared/dfo-whalemap/*.csv : src/share_wi.sh R/share_wi.R data/processed/effort.rds data/processed/observations.rds
src/share_wi.sh
## DMA ##
.PHONY : dma
dma : data/processed/dma.rda
# Process dma
data/processed/dma.rda : R/map_dma.R
$(report_error)
Rscript $<
$(remove_error)
## MAP ##
.PHONY : map
map : ./static_map/whalemap.html
# Build map
./static_map/whalemap.html : R/build_static_map.R data/processed/*
$(report_error)
Rscript $<
cp -r static_map/* ../server_index/
$(remove_error)
## CLEAN ##
.PHONY : clean
clean :
rm -f data/interim/*.*
rm -f data/processed/*.*