-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.qmd
990 lines (883 loc) · 33 KB
/
index.qmd
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
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
---
title: "Movement Ecology and Behavior of Ribbon and Spotted Seals in the Bering Sea, 2024 "
execute:
echo: false
warning: false
message: false
format:
html:
fig-width: 8
fig-height: 6
search: false
author:
- id: jml
name:
literal: Josh M. London
email: josh.london@noaa.gov
orcid: 0000-0002-3647-5046
attributes:
corresponding: true
affiliations:
- ref: mml
- id: hlz
name:
literal: Heather L. Ziel
email: heather.ziel@noaa.gov
affiliations:
- ref: mml
- id: skh
name:
literal: Stacie M. Koslovsky
email: stacie.koslovsky@noaa.gov
affiliations:
- ref: mml
- id: mfc
name:
literal: Michael F. Cameron
email: michael.cameron@noaa.gov
affiliations:
- ref: mml
affiliations:
- id: mml
name: AFSC Marine Mammal Laboratory, NOAA Fisheries
address: 7600 Sand Point Way NE
city: Seattle
region: Washington
country: United States
postal-code: 98115
url: https://www.fisheries.noaa.gov/about/marine-mammal-laboratory
---
```{r}
#| include: false
library(dplyr)
library(purrr)
library(fs)
library(tidyr)
library(lubridate)
library(stringr)
library(ggplot2)
library(janitor)
library(readr)
library(googlesheets4)
library(wcUtils)
library(scam)
library(sf)
library(googlesheets4)
library(rdeck)
library(aniMotum)
library(rcartocolor)
library(gt)
library(ggdist)
r_files <- fs::dir_ls(here::here('R'), glob = "*.R")
purrr::map(r_files, source)
deploy_tbl <- readr::read_rds(here::here('data/deploy_tbl.rds')) |>
dplyr::mutate(deploy_end_date_time_gmt = lubridate::as_date('2025-12-31'))
```
```{r}
#| include: false
#data_list <- get_wc_data(deploy_tbl$deployid[!deploy_tbl$deployid %in% c('PL2024_1023_18U1318','HF2024_1021_19U2627','HF2024_1019_19U2623')])
data_list <- get_wc_data(deploy_tbl$deployid)
```
::: callout-warning
The information on this page is automatically updated every hour and without any
significant quality checks. Errors may be present and are likely. We are
providing access to the information in a public forum in the spirit of open
science and to provide easy access to updated information for the authors and
interested researchers.
**The information provided here should not be cited or referenced in any form**
:::
::: column-margin
Disclaimer
The scientific results and conclusions, as well as any views or opinions
expressed herein, are those of the author(s) and do not necessarily reflect the
views of NMFS, NOAA, or the Department of Commerce.
:::
## Sampling and Deployment Summary
```{r}
#| include: false
summary_tbl <- readr::read_rds(here::here('data/summary_tbl.rds'))
```
```{r}
gt(summary_tbl) |>
cols_label(
speno = "SPENO",
date = "Date",
species = "Species",
sex = "Sex",
age = "Age",
molt_status = "Molt Status",
mass = "Mass (kg)",
splash = "SPLASH",
spot6 = "SPOT6"
) |>
tab_spanner(
label = md('Bio-logger Type & Location'),
columns = 8:9
) |>
opt_stylize(style = 6, color = 'gray') |>
tab_options(
table.font.size = px(12)
)
```
## Predicted Movements
Each seal is released with a bio-logger that provides regular updates on
movement and behavior. For each seal, the observed locations are used to fit a
predicted path. Both the predicted track (line) and the observed bio-logger
locations (points) are shown on the map. The ship track of the _R/V Norseman II_
is shown in black and can be toggled on/off using the layer selector in the
upper left corner.
**Because some of the tracks span the 180 anti-meridian, you may need to re-center
and zoom the map to the Bering Sea region.**
```{r}
#| include: false
map_proj <- "+proj=laea +lat_0=90 +lon_0=180 +x_0=0 +y_0=0 +datum=WGS84 +units=m +no_defs +type=crs"
locs <- sf::st_as_sf(data_list$locs,
coords = c("longitude","latitude"),
crs = 4326) %>%
left_join(deploy_tbl) %>%
dplyr::filter(between(date_time,
deploy_date_time_gmt,
deploy_end_date_time_gmt)) %>%
dplyr::rename(datetime=date_time)
locs <- locs %>%
group_by(speno) %>%
arrange(datetime, error_radius) %>%
mutate(
rank = 1L,
rank = case_when(duplicated(datetime, fromLast = FALSE) ~
lag(rank) + 1L, TRUE ~ rank)) %>%
dplyr::filter(rank == 1) %>%
arrange(speno,datetime) %>%
ungroup()
locs <- locs |>
dplyr::mutate(
quality = case_when(
type == 'FastGPS' ~ 'G',
type == 'User' ~ 'G',
.default = quality
)
) |>
dplyr::filter(!quality %in% c('Z')) |>
sf::st_transform(map_proj)
locs_fit <- fit_ssm(
x = locs,
vmax = 8,
model = "crw",
time.step = 0.25,
id = "speno",
date = "datetime",
lc = "quality",
epar = c(
"error_semi_major_axis",
"error_semi_minor_axis",
"error_ellipse_orientation"
),
tz = "UTC"
)
predict_pts_sf <-
grab(locs_fit,
what = "predicted",
as_sf = TRUE,
group = TRUE) |>
rename(speno = id,
datetime = date) |>
left_join(deploy_tbl)
predict_lines_sf <- predict_pts_sf %>%
group_by(speno) %>%
summarise(do_union = FALSE) %>%
st_cast("LINESTRING") %>%
left_join(deploy_tbl)
map_lines <- predict_lines_sf |>
st_transform(4326)
bbox_center <- st_bbox(predict_lines_sf) %>%
st_as_sfc() |>
st_transform(4326) |>
st_break_antimeridian(lon_0=180)
map_last_loc <- predict_pts_sf %>%
sf::st_transform(4326) %>%
group_by(speno) %>%
arrange(speno,datetime) %>%
group_map(~ tail(.x, 1L), .keep=TRUE) %>%
bind_rows()
map_locs <- locs %>%
sf::st_transform(4326) %>%
group_by(speno)
map_locs_adult <- map_locs |>
dplyr::filter(age == 'adult')
map_locs_subadult <- map_locs |>
dplyr::filter(age == 'sub-adult')
map_locs_yoy <- map_locs |>
dplyr::filter(age == 'young-of-year')
map_lines_adult <- map_lines |>
dplyr::filter(age == 'adult')
map_lines_subadult <- map_lines |>
dplyr::filter(age == 'sub-adult')
map_lines_yoy <- map_lines |>
dplyr::filter(age == 'young-of-year')
map_last_loc_adult <- map_last_loc |>
dplyr::filter(age == 'adult')
map_last_loc_subadult <- map_last_loc |>
dplyr::filter(age == 'sub-adult')
map_last_loc_yoy <- map_last_loc |>
dplyr::filter(age == 'young-of-year')
ship_track <- readr::read_rds(here::here('data/ship_track.rds'))
mapbox_map <- rdeck(map_style = "mapbox://styles/jmlondon/cl9kktfl2000v16pooqw5p2wz",
initial_bounds = bbox_center[1],
theme = "light",
controller = TRUE) %>%
add_path_layer(data = ship_track,
name = "Ship Track",
wrap_longitude = TRUE,
position_format = "XY",
width_min_pixels = 1.5,
get_color = "#000000",
opacity = 0.25,
get_path = geometry) |>
add_path_layer(data = map_lines,
name = "Predicted Movements",
opacity = 0.8,
get_color = scale_color_category(
col = speno,
palette = rcartocolor::carto_pal(name = "Pastel")
),
wrap_longitude = TRUE,
position_format = "XY",
width_min_pixels = 1.5,
get_path = geometry) %>%
add_scatterplot_layer(data = map_locs,
name = "Observed Locations",
opacity = 0.35,
get_fill_color = scale_color_category(
col = speno,
palette = rcartocolor::carto_pal(name = "Pastel"),
legend = FALSE
),
wrap_longitude = TRUE,
position_format = "XY",
radius_min_pixels = 2,
get_position = geometry,
pickable = TRUE,
tooltip = c(speno,datetime)) %>%
add_scatterplot_layer(data = map_last_loc,
name = "Latest Location",
opacity = 1,
get_fill_color = scale_color_category(
col = speno,
palette = rcartocolor::carto_pal(name = "Pastel"),
legend = FALSE
),
wrap_longitude = TRUE,
position_format = "XY",
radius_min_pixels = 4,
get_position = geometry,
pickable = TRUE,
tooltip = c(speno,datetime))
mapbox_map_adult <- rdeck(map_style = "mapbox://styles/jmlondon/cl9kktfl2000v16pooqw5p2wz",
initial_bounds = bbox_center[1],
theme = "light",
controller = TRUE) %>%
add_path_layer(data = ship_track,
name = "Ship Track",
wrap_longitude = TRUE,
position_format = "XY",
width_min_pixels = 1.5,
get_color = "#000000",
opacity = 0.25,
get_path = geometry) |>
add_path_layer(data = map_lines_adult,
name = "Predicted Movements of Adults",
opacity = 0.8,
get_color = scale_color_category(
col = speno,
palette = rcartocolor::carto_pal(name = "Pastel")
),
wrap_longitude = TRUE,
position_format = "XY",
width_min_pixels = 1.5,
get_path = geometry) %>%
add_scatterplot_layer(data = map_locs_adult,
name = "Observed Location",
opacity = 0.35,
get_fill_color = scale_color_category(
col = speno,
palette = rcartocolor::carto_pal(name = "Pastel"),
legend = FALSE
),
wrap_longitude = TRUE,
position_format = "XY",
radius_min_pixels = 2,
get_position = geometry,
pickable = TRUE,
tooltip = c(speno,datetime)) %>%
add_scatterplot_layer(data = map_last_loc_adult,
name = "Latest Location",
opacity = 1,
get_fill_color = scale_color_category(
col = speno,
palette = rcartocolor::carto_pal(name = "Pastel"),
legend = FALSE
),
wrap_longitude = TRUE,
position_format = "XY",
radius_min_pixels = 4,
get_position = geometry,
pickable = TRUE,
tooltip = c(speno,datetime))
mapbox_map_subadult <- rdeck(map_style = "mapbox://styles/jmlondon/cl9kktfl2000v16pooqw5p2wz",
initial_bounds = bbox_center[1],
theme = "light",
controller = TRUE) %>%
add_path_layer(data = ship_track,
name = "Ship Track",
wrap_longitude = TRUE,
position_format = "XY",
width_min_pixels = 1.5,
get_color = "#000000",
opacity = 0.25,
get_path = geometry) |>
add_path_layer(data = map_lines_subadult,
name = "Predicted Movements of Sub-adults",
opacity = 0.8,
get_color = scale_color_category(
col = speno,
palette = rcartocolor::carto_pal(name = "Pastel")
),
wrap_longitude = TRUE,
position_format = "XY",
width_min_pixels = 1.5,
get_path = geometry) %>%
add_scatterplot_layer(data = map_locs_subadult,
name = "Observed Location",
opacity = 0.35,
get_fill_color = scale_color_category(
col = speno,
palette = rcartocolor::carto_pal(name = "Pastel"),
legend = FALSE
),
wrap_longitude = TRUE,
position_format = "XY",
radius_min_pixels = 2,
get_position = geometry,
pickable = TRUE,
tooltip = c(speno,datetime)) %>%
add_scatterplot_layer(data = map_last_loc_subadult,
name = "Latest Location",
opacity = 1,
get_fill_color = scale_color_category(
col = speno,
palette = rcartocolor::carto_pal(name = "Pastel"),
legend = FALSE
),
wrap_longitude = TRUE,
position_format = "XY",
radius_min_pixels = 4,
get_position = geometry,
pickable = TRUE,
tooltip = c(speno,datetime))
mapbox_map_yoy <- rdeck(map_style = "mapbox://styles/jmlondon/cl9kktfl2000v16pooqw5p2wz",
initial_bounds = bbox_center[1],
theme = "light",
controller = TRUE) %>%
add_path_layer(data = ship_track,
name = "Ship Track",
wrap_longitude = TRUE,
position_format = "XY",
width_min_pixels = 1.5,
get_color = "#000000",
opacity = 0.25,
get_path = geometry) |>
add_path_layer(data = map_lines_yoy,
name = "Predicted Movements of Young-of-Year",
opacity = 0.8,
get_color = scale_color_category(
col = speno,
palette = rcartocolor::carto_pal(name = "Pastel")
),
wrap_longitude = TRUE,
position_format = "XY",
width_min_pixels = 1.5,
get_path = geometry) %>%
add_scatterplot_layer(data = map_locs_yoy,
name = "Observed Location",
opacity = 0.35,
get_fill_color = scale_color_category(
col = speno,
palette = rcartocolor::carto_pal(name = "Pastel"),
legend = FALSE
),
wrap_longitude = TRUE,
position_format = "XY",
radius_min_pixels = 2,
get_position = geometry,
pickable = TRUE,
tooltip = c(speno,datetime)) %>%
add_scatterplot_layer(data = map_last_loc_yoy,
name = "Latest Location",
opacity = 1,
get_fill_color = scale_color_category(
col = speno,
palette = rcartocolor::carto_pal(name = "Pastel"),
legend = FALSE
),
wrap_longitude = TRUE,
position_format = "XY",
radius_min_pixels = 4,
get_position = geometry,
pickable = TRUE,
tooltip = c(speno,datetime))
```
::: column-page
::: {.panel-tabset}
### All Age Classes
```{r}
mapbox_map
```
### Adults
```{r}
mapbox_map_adult
```
### Sub-adults
```{r}
mapbox_map_subadult
```
### Young-of-Year
```{r}
mapbox_map_yoy
```
:::
:::
## Haul-out Behavior
Each of the bio-loggers are programmed to report the percentage of time the
device was dry for each hour. For example, a seal that was hauled out for an
entire hour would report as 100% dry. The hours are shown as UTC hours. To
adjust for apparent solar noon, subtract approximately 12 hours.
::: {.panel-tabset}
```{r}
ho_data <- data_list$haul_out |>
left_join(deploy_tbl) |>
dplyr::filter(between(timeline_start_dt,
deploy_date_time_gmt,
deploy_end_date_time_gmt)) |>
dplyr::rename(haulout_dt=timeline_start_dt) |>
dplyr::select(species = common_name, speno, haulout_dt, percent_dry) |>
dplyr::mutate(percent_dry = mean(percent_dry,na.rm=TRUE),
.by = c(speno, haulout_dt)) |>
arrange(speno,haulout_dt) |>
mutate(year = lubridate::year(haulout_dt),
month = lubridate::month(haulout_dt,label=TRUE),
day = lubridate::day(haulout_dt),
hour = lubridate::hour(haulout_dt))
```
### Ribbon seals
```{r}
#| fig-asp: 1.3
p <- ggplot(ho_data |> dplyr::filter(species == 'ribbon seal'),aes(day,hour,fill=percent_dry))+
geom_tile(linewidth = 0.1, color = "grey75") +
scico::scale_fill_scico(palette = "nuuk", direction = 1,
labels = scales::percent_format(scale=1),
aesthetics = "fill",
guide = guide_colorbar(title.position = "top", barwidth = 15,
barheight = 0.5, title.hjust = 0)
) +
coord_cartesian(clip = "off")
p <- p + facet_grid(speno~month)
p <- p + scale_x_continuous(breaks = c(5,15,25), expand = c(0,0)) +
scale_y_continuous(breaks = c(4,12,20), labels = c("04:00","12:00","20:00"))
p <- p + theme_minimal() +
theme(legend.position = "top", legend.justification = "left") +
theme(strip.background = element_rect(colour="white")) +
theme(axis.ticks=element_blank()) +
xlab("day of month") + ylab("hour (UTC)")
p
```
### Spotted seals
```{r}
#| fig-asp: 1.3
p <- ggplot(ho_data |> dplyr::filter(species == 'spotted seal'),
aes(day,hour,fill=percent_dry))+
geom_tile(linewidth = 0.1, color = "grey75") +
scico::scale_fill_scico(palette = "nuuk", direction = 1,
labels = scales::percent_format(scale=1),
aesthetics = "fill",
guide = guide_colorbar(title.position = "top", barwidth = 15,
barheight = 0.5, title.hjust = 0)
) +
coord_cartesian(clip = "off")
p <- p + facet_grid(speno~month)
p <- p + scale_x_continuous(breaks = c(5,15,25), expand = c(0,0)) +
scale_y_continuous(breaks = c(4,12,20), labels = c("04:00","12:00","20:00"))
p <- p + theme_minimal() +
theme(legend.position = "top", legend.justification = "left") +
theme(strip.background = element_rect(colour="white")) +
theme(axis.ticks=element_blank()) +
xlab("day of month") + ylab("hour (UTC)")
p
```
:::
## Dive Behavior
The bio-loggers that are attached to the hair of the nape or head of seals are
capable of determining depth through a pressure transducer. This allows for a
variety of data products that describe the dive behavior of seals.
### Time At Depth from Cumulative Distribution
Here, dive behavior is described as proportion of time at given depths. This
relatively new data product transmits a cumulative distribution of time at depth
for each 2 hour summary period. The distribution adjusts to accomodate different
maximum depths and darker red areas indicate depths where the seal is choosing
to spend more time. The grey blocks above indicate proportion of time dry within
the summary period.
::: {.panel-tabset}
```{r}
ecd_data <- data_list$ecdf %>%
dplyr::rename(deployid = deploy_id) %>%
dplyr::arrange(deployid, start) %>%
left_join(deploy_tbl) %>%
rowwise() %>%
dplyr::mutate(spline_interp = list(spline_ecdf(full_ecdf, bin.width=5)),
depth50pct = x_pct_depth(full_ecdf,pct_tad = 0.5),
n_dives = if_else(all(is.na(n_dives_shallow),is.na(n_dives_deep)),
NA, mean(c(n_dives_shallow,n_dives_deep), na.rm=TRUE))
) %>%
dplyr::select(c(species = common_name,speno,deployid,deploy_date_time_gmt,deploy_end_date_time_gmt,start:percent_dry,shallow_ecdf,
deep_ecdf,full_ecdf,spline_interp,depth50pct, n_dives)) %>%
unnest(spline_interp, keep_empty = TRUE) %>%
group_by(deployid, start, end, kind, percent_dry) %>%
dplyr::arrange(deployid, start, depth_break) %>%
dplyr::mutate(propTAD = c(0,diff(ecd_prop)),
minTAD = 120*(1-0.01*percent_dry) * propTAD) %>%
# determine the next depth value
dplyr::mutate(next_depth = dplyr::lead(depth_break)) %>%
# determine previous depth for plotting
dplyr::mutate(prev_depth = dplyr::lag(depth_break)) %>%
dplyr::select(-next_depth) %>%
# transform depths to negative values
dplyr::mutate(depth_break = depth_break * -1,
prev_depth = prev_depth * -1)
ecd_data <- ecd_data %>%
group_by(deployid) %>%
arrange(start)
```
#### Ribbon seals
```{r}
#| fig-asp: 1.3
ecd_data %>%
dplyr::filter(species == 'ribbon seal',
between(end,
deploy_date_time_gmt,
deploy_end_date_time_gmt)) %>%
ggplot() +
geom_rect(aes(xmin = start, xmax = end,
ymin = 0, ymax = percent_dry/10),
fill = "seashell3") +
geom_rect(aes(xmin = start, xmax = end,
ymin = depth_break, ymax = prev_depth,
fill = propTAD),
color = NA) +
scale_fill_distiller(palette = "Reds",
direction = 1, trans = "log10",
guide = guide_colorbar(
title = 'proportion of time submerged',
title.position = 'bottom',
title.hjust = 0.5,
barwidth = unit(75, units = "mm"),
barheight = unit(2, units = "mm"))) +
scale_x_datetime() +
facet_wrap(speno ~ ., ncol=1) +
ylab("depth (meters)") +
labs(title = "Ribbon Seals (HF), 2024",
subtitle = "each bar represents 2 hours binned at 5m depth increments",
caption = stringr::str_wrap("data derived from the Emperical Cumulative
Distribution (ECD) of time at depth
transmitted via the Argos satellite network")) +
theme_minimal() +
theme(strip.text = element_text(hjust = 1),
legend.position = "bottom")
```
#### Spotted seals
```{r}
#| fig-asp: 1.3
ecd_data %>%
left_join(deploy_tbl) %>%
dplyr::filter(species == 'spotted seal',
between(end,
deploy_date_time_gmt,
deploy_end_date_time_gmt)) %>%
ggplot() +
geom_rect(aes(xmin = start, xmax = end,
ymin = 0, ymax = percent_dry/10),
fill = "seashell3") +
geom_rect(aes(xmin = start, xmax = end,
ymin = depth_break, ymax = prev_depth,
fill = propTAD),
color = NA) +
scale_fill_distiller(palette = "Reds",
direction = 1, trans = "log10",
guide = guide_colorbar(
title = 'proportion of time submerged',
title.position = 'bottom',
title.hjust = 0.5,
barwidth = unit(75, units = "mm"),
barheight = unit(2, units = "mm"))) +
scale_x_datetime() +
facet_wrap(speno ~ ., ncol=1) +
ylab("depth (meters)") +
labs(title = "Spotted Seals (PL), 2024",
subtitle = "each bar represents 2 hours binned at 5m depth increments",
caption = stringr::str_wrap("data derived from the Emperical Cumulative
Distribution (ECD) of time at depth
transmitted via the Argos satellite network")) +
theme_minimal() +
theme(strip.text = element_text(hjust = 1),
legend.position = "bottom")
```
:::
### Time At Depth from Histogram Bins
Two bio-loggers deployed on sub-adult spotted seals (SPENO: PL2024_1003,
PL2024_1017) were programmed to collect time at depth information based on
pre-defined histogram bins. The depth range encompassed by each bin is courser
than with the above cumulative distribution data.
```{r}
#| fig-asp: 0.618
data_list$tad %>%
left_join(deploy_tbl) %>%
dplyr::rename(start = tad_start_dt,
depth_break = bin_upper_limit) |>
dplyr::arrange(deployid, start) |>
dplyr::mutate(end = start + lubridate::hours(2)) |>
dplyr::filter(between(end,deploy_date_time_gmt,deploy_end_date_time_gmt)) %>%
dplyr::filter(bin != 'bin14') |>
dplyr::mutate(depth_break = as.numeric(depth_break),
pct_tad = pct_tad*0.01) |>
group_by(deployid, start, end) |>
# determine the next depth value
dplyr::mutate(next_depth = dplyr::lead(depth_break)) %>%
# determine previous depth for plotting
dplyr::mutate(prev_depth = dplyr::lag(depth_break)) %>%
dplyr::select(-next_depth) %>%
dplyr::mutate(prev_depth = ifelse(is.na(prev_depth),0,prev_depth)) |>
# transform depths to negative values
dplyr::mutate(depth_break = depth_break * -1,
prev_depth = prev_depth * -1) |>
dplyr::filter(!is.na(pct_tad) & pct_tad > 0) |>
ggplot() +
geom_rect(aes(xmin = start, xmax = end,
ymin = depth_break, ymax = prev_depth,
fill = pct_tad),
color = NA) +
scale_fill_distiller(palette = "Reds",
direction = 1, trans = "log10",
guide = guide_colorbar(
title = 'proportion of time submerged',
title.position = 'bottom',
title.hjust = 0.5,
barwidth = unit(75, units = "mm"),
barheight = unit(2, units = "mm"))) +
scale_x_datetime() +
facet_wrap(speno ~ ., ncol=1) +
ylab("depth (meters)") +
labs(title = "Spotted Seal (PL2024_1003) Time at Depth",
subtitle = "each bar represents 2 hours binned at set depth increments",
caption = stringr::str_wrap("histograms of time at depth
transmitted via the Argos satellite network")) +
theme_minimal() +
theme(legend.position = "bottom",
strip.text = element_text(hjust = 1))
```
### Dive Behavior Records
The two sub-adult spotted seals (SPENO: PL2024_1003, PL2024_1017) were also
programmed to provide more detailed information regarding individual dives. For
each dive, the start time, end time, and maximum depth are recorded. The
subsequent post-dive interval at the surface is also recorded. This is bundled
into 5 consecutive dive + post-dive intervals. In addition to providing
information on dive depths and dive frequency we can also explore the overall
distribution of dive duration.
```{r}
#| fig-asp: 0.618
data_list$behav |>
left_join(deploy_tbl) |>
ggplot() +
geom_rect(aes(xmin=start,
xmax=end,
ymin=0,
ymax=-1*depth_min),
linetype=0,
fill = rcartocolor::carto_pal(3,"Bold")[1]) +
scale_x_datetime() +
facet_wrap(speno ~ ., ncol=1) +
ylab("depth (meters)") +
labs(title = "Spotted Seal Dive Behavior",
subtitle = "each bar represents a single dive",
caption = stringr::str_wrap("dive behavior details
transmitted via the Argos satellite network")) +
theme_minimal() +
theme(axis.title = element_text(),
strip.text = element_text(hjust = 1))
```
```{r}
#| fig-asp: 0.618
data_list$behav |>
left_join(deploy_tbl) |>
dplyr::filter(what == "Dive") |>
dplyr::select(speno,what,depth_max,duration_max) |>
ggplot(aes(x = duration_max, y = what)) +
geom_boxplot(width = 0.05,
color = rcartocolor::carto_pal(3,"Bold")[1]) +
geom_point(shape = "|",
size = 8,
alpha = 0.15,
position = position_nudge(y = -0.15),
color = rcartocolor::carto_pal(3,"Bold")[1]
) +
stat_slab(height = 0.75,
position = position_nudge(y = 0.1),
fill = rcartocolor::carto_pal(3,"Bold")[1]
) +
facet_wrap(speno ~ ., ncol=1) +
xlab("dive duration (seconds)") +
labs(title = "Spotted Seal Dive Duration",
subtitle = "rain cloud plot showing distribution of dive durations") +
theme_minimal() +
theme(
strip.text = element_text(hjust = 1),
axis.title.y = element_blank(),
axis.text.y = element_blank(),
axis.ticks.y = element_blank()
) +
theme(axis.title = element_text())
```
## Oceanographic Temperature Profiles
Approximately two times per day, the bio-loggers will record a temperature
profile upcast from the deepest dive during a two hour summary period. This
provides unique insight into the oceanography and structure of the water these
seals are foraging in.
::: {.panel-tabset}
```{r}
pdt_data <- data_list$pdt %>%
group_by(deploy_id,date) %>%
mutate(data_hr = lubridate::round_date(date,unit="hour"),
x1 = data_hr - minutes(90),
x2 = data_hr + minutes(90)) %>%
dplyr::mutate(next_depth = dplyr::lead(depth)) %>%
# determine previous depth for plotting
dplyr::mutate(prev_depth = dplyr::lag(depth)) %>%
dplyr::select(-next_depth) %>%
# transform depths to negative values
dplyr::mutate(depth = depth * -1,
prev_depth = prev_depth * -1) %>%
ungroup() %>%
left_join(deploy_tbl, by=c("deploy_id" = "deployid")) %>%
dplyr::rename(species = common_name) |>
dplyr::filter(between(data_hr,deploy_date_time_gmt,deploy_end_date_time_gmt))
```
### Ribbon seals
```{r}
#| fig-asp: 1.3
pdt_data %>%
filter(depth<0,
species == 'ribbon seal') %>%
ggplot() +
geom_rect(aes(xmin = x1, xmax = x2,
ymin = prev_depth, ymax=depth,
fill=min_te), colour=NA) +
scale_fill_distiller(palette = "Spectral",
direction = -1,
guide = guide_colorbar(
title = 'temperature (C)',
title.position = 'bottom',
title.hjust = 0.5,
barwidth = unit(75, units = "mm"),
barheight = unit(2, units = "mm"))) +
scale_x_datetime() +
facet_wrap(speno ~ ., ncol=1) +
ylab("depth (meters)") +
labs(title = "Temperature at Depth (transmitted)",
subtitle = "each bar depicts data from a single upcast as a 3-hour window") +
theme_minimal() +
theme(legend.position = "bottom",
strip.text = element_text(hjust = 1),)
```
### Spotted seals
```{r}
#| fig-asp: 1.3
pdt_data %>%
filter(depth<0,speno != 'PL2024_1017',
species == 'spotted seal') %>%
ggplot() +
geom_rect(aes(xmin = x1, xmax = x2,
ymin = prev_depth, ymax=depth,
fill=min_te), colour=NA) +
scale_fill_distiller(palette = "Spectral",
direction = -1,
guide = guide_colorbar(
title = 'temperature (C)',
title.position = 'bottom',
title.hjust = 0.5,
barwidth = unit(75, units = "mm"),
barheight = unit(2, units = "mm"))) +
scale_x_datetime() +
facet_wrap(speno ~ .,ncol=1) +
ylab("depth (meters)") +
labs(title = "Temperature at Depth (transmitted)",
subtitle = "each bar depicts data from a single upcast as a 3-hour window") +
theme_minimal() +
theme(strip.text = element_text(hjust = 1),
legend.position = "bottom")
```
:::
## Satellite Transmissions
This figure provides some diagnostic and performance insights to tag deployments
and attachment locations.
::: {.panel-tabset}
### Ribbon seals
```{r}
#| fig.asp: 1.3
cols <- carto_pal(n=4,'Vivid')[1:3]
attachment <- c("Flipper","Head","Nape")
cols <- setNames(cols,attachment)
msg_data <- data_list$messages |>
left_join(deploy_tbl) |>
dplyr::filter(between(msg_date,
deploy_date_time_gmt,
deploy_end_date_time_gmt)) |>
dplyr::filter(common_name == 'ribbon seal') |>
dplyr::select(species=common_name,speno,attachment,msg_date,msg_count=msg) |>
dplyr::mutate(msg_day = lubridate::date(msg_date)) |>
dplyr::group_by(speno,attachment,msg_day) |>
dplyr::summarise(total_count = sum(msg_count))
ggplot(data = msg_data) +
geom_col(aes(x=msg_day,y=total_count,fill = attachment)) +
scale_fill_manual(values = cols) +
facet_wrap(speno ~ ., ncol = 1) +
ylab("date") +
labs(title = "Satellite Messages Recieved by Attachment Type",
subtitle = "each bar the total number of messages recieved each day",) +
theme_minimal() +
theme(strip.text = element_text(hjust = 1),
legend.position = "top",
legend.title=element_blank())
```
### Spotted seals
```{r}
#| fig.asp: 1.3
msg_data <- data_list$messages |>
left_join(deploy_tbl) |>
dplyr::filter(between(msg_date,
deploy_date_time_gmt,
deploy_end_date_time_gmt)) |>
dplyr::filter(common_name == 'spotted seal') |>
dplyr::select(species=common_name,speno,attachment,msg_date,msg_count=msg) |>
dplyr::mutate(msg_day = lubridate::date(msg_date)) |>
dplyr::group_by(speno,attachment,msg_day) |>
dplyr::summarise(total_count = sum(msg_count))
ggplot(data = msg_data) +
geom_col(aes(x=msg_day,y=total_count,fill = attachment)) +
scale_fill_manual(values = cols) +
facet_wrap(speno ~ .,ncol=1) +
ylab("date") +
labs(title = "Satellite Messages Recieved by Attachment Type",
subtitle = "each bar the total number of messages recieved each day",) +
theme_minimal() +
theme(strip.text = element_text(hjust = 1),
legend.position = "top",
legend.title=element_blank())
```
:::