-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #14 from AtlanticR/ocearch
Ocearch
- Loading branch information
Showing
10 changed files
with
129 additions
and
69 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
|
||
copy_rdata_files <- function() { | ||
|
||
rDataDir <- "\\\\ent.dfo-mpo.ca\\ATLShares\\Science\\BIODataSvc\\IN\\MSP\\Data\\Rdata\\data" | ||
|
||
localDataDir <- here::here("app/data/") | ||
remoteInfo <- file.info(list.files(rDataDir, full.names = TRUE)) | ||
remoteInfo["filenames"] = list.files(rDataDir) | ||
localInfo <- file.info(list.files(localDataDir, full.names = TRUE)) | ||
localInfo["filenames"] = list.files(localDataDir) | ||
|
||
allInfo <- merge(remoteInfo, localInfo, by="filenames") | ||
updateList <- allInfo$mtime.x > allInfo$mtime.y | ||
if (any(updateList)) { | ||
updateFileList <- filter(allInfo, updateList)$filenames | ||
updateFilePath <- rownames(filter(remoteInfo, remoteInfo$filename %in% updateFileList)) | ||
copyResults <- file.copy(updateFilePath, localDataDir, overwrite = TRUE) | ||
} | ||
return("Data files up to date :)") | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -209,3 +209,42 @@ if (!is.null(outputList)) { | |
knitr::kable(table_obis1, align="l", caption="Quality Tier: Medium. Security level: none. Ocean Biodiversity Information System (OBIS) observation records of species contained within the search area and listed by the <i>Species At Risk Act</i> (SARA), or assessed by the Committee on the Status of Endangered Wildlife in Canada (COSEWIC). <b>The absence of a species in this figure should be interpreted as an absence of reporting, not necessarily as an absence of the species in the area.</b>", booktabs = T, escape = F, linesep="") %>% kable_styling(bootstrap_options = "striped", full_width = F, position = "left") | ||
} | ||
``` | ||
|
||
### **OCEARCH Shark Tracker** | ||
Contact: Bryan Franks ([email protected]) via Sean Butler ([email protected]) | ||
URL: <https://www.ocearch.org/tracker/> | ||
Last retrieved on: July 22 2021 by Sean Butler | ||
Quality Tier: High | ||
Search year: 2013-2020 | ||
Security level: none | ||
Data use constraints: DFO INTERNAL USE ONLY | ||
|
||
OCEARCH is a data-centric organization built to help scientists collect previously unattainable data in the ocean while open sourcing our research and explorations. Open sourcing and inclusion at every level, and in real-time, allows the world to participate in their projects while being aware of the developing science. OCEARCH shares the data, including samples collected and tracking data, with collaborating institutions and students who request them for their studies. The tracking data is also open-sourced to the public via the OCEARCH Tracker. The OCEARCH Tracker is a free app that lets you observe the navigational pattern of animals that have been tagged with satellite tracking technology. White Shark locations from satellite trackers are summarized in this section from 1 Jan 2013 to 31 Oct 2020. Locations were clipped to only include locations within the Canadian EEZ. A speed filter was run with 3 m/s as the maximum speed and 2.5 km as the potential error of locations. This filter removed approximately 100 locations out of of 2,000. Resulting points ere then visualized in ArcGIS to identify potential errors and remove locations that seemed implausible. Each shark location was individually plotted to do a second visual examination and to remove or flag errors/outliers. There is additional QA/QC that could still be performed to this dataset to capture additional issues (e.g. there may be single shark locations in Canadian waters during a period of time that the speed filter would not remove or that were not captured in the visual inspection). The absence of White Sharks in this section map should be interpreted as an absence of tracking data, not necessarily as an absence of the species in the area. | ||
|
||
#### ***Area-specific OCEARCH Shark Tracker search results*** | ||
* | ||
|
||
|
||
```{r ocearch-results, include=FALSE, cache=FALSE} | ||
ocearchOutputList <- master_intersect(ocearch_sf, mapDataList) | ||
``` | ||
|
||
|
||
```{r ocearch-check, echo=FALSE, results='asis',} | ||
Report_ocearch <- if (is.null(ocearchOutputList)) { | ||
"There are no relevant White Shark records in the OCEARCH Shark Tracker for this search area." | ||
} else { | ||
numRecords <- length(ocearchOutputList$studyData$geometry) | ||
distinctIndv <- dplyr::n_distinct(ocearchOutputList$studyData$ID) | ||
paste("There are", numRecords, "relevant White Shark records for", distinctIndv, "individuals in OCEARCH Shark Tracker search results for this search area.") | ||
} | ||
Report_obis<-noquote(Report_ocearch) | ||
writeLines(Report_ocearch) | ||
``` | ||
```{r ocearch-plot, fig.height=8, fig.width=11, fig.cap='Quality Tier: Medium. Security level: none. Map showing the search area defined by the user (red outline) was used to query information from OCEARCH Shark Tracker observation records, for White Shark. Dataset set has not yet been completely error-checked. The absence of a species in this figure should be interpreted as an absence of tracking data, not necessarily as an absence of the species in the area.'} | ||
if (!is.null(ocearchOutputList)) { | ||
plot_rr_sf(areaMap, ocearchOutputList$mapPoints) | ||
} | ||
``` | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,11 +5,11 @@ Cartes satellitaires de la végétation intertidale et des polygones de présenc | |
Personne-ressource : <[email protected]> | ||
Consulté le : 17 février 2021 | ||
Niveau de qualité : Moyennem | ||
Niveau de sécurité : Aucun. | ||
Niveau de sécurité : Aucun. | ||
|
||
Le fucus (Ascophyllum nodosum) est une algue brune intertidale d’eau froide commune dont les crampons de longue durée s’agrippent à des substrats rocheux. Il domine la zone intertidale rocheuse du Canada atlantique et fournit un habitat pour les poissons, les invertébrés et les oiseaux. Il y a peu d’information disponible sur la répartition spatiale du fucus et de la végétation intertidale dans la région des Maritimes. Les données d’enquête existantes de l’industrie sont considérées comme exclusives et ne sont pas disponibles. Par conséquent, des cartes satellitaires à l’échelle régionale ont été élaborées pour indiquer l’emplacement, la densité relative de la végétation intertidale et les polygones qui délimitent les zones probablement occupées par le fucus (Lazin et al., en préparation). | ||
|
||
Les cartes sont produites à l’aide de données satellitaires Sentinel-2 de ciel dégagé à une résolution au sol de 10 mètres, en appliquant un indice de végétation par différence normalisée (IVDN) bien établi pour détecter la végétation intertidale exposée à marée basse. Les parcelles de végétation sont délimitées à l’aide de seuils, et la probabilité de présence de fucus est attribuée en fonction de la classification du substrat riverain, des archives photographiques/vidéo aériennes et des données des bases de données sur la biodiversité en libre accès. Les produits finaux seront conservés sur le portail des données ouvertes du gouvernement du Canada et seront continuellement améliorés à mesure que de nouvelles données de terrain seront disponibles. | ||
Les cartes sont produites à l’aide de données satellitaires Sentinel-2 de ciel dégagé à une résolution au sol de 10 mètres, en appliquant un indice de végétation par différence normalisée (IVDN) bien établi pour détecter la végétation intertidale exposée à marée basse. Les parcelles de végétation sont délimitées à l’aide de seuils, et la probabilité de présence de fucus est attribuée en fonction de la classification du substrat riverain, des archives photographiques/vidéo aériennes et des données des bases de données sur la biodiversité en libre accès. Les produits finaux seront conservés sur le portail des données ouvertes du gouvernement du Canada et seront continuellement améliorés à mesure que de nouvelles données de terrain seront disponibles. | ||
|
||
Remarques sur les données : | ||
|
||
|
@@ -21,62 +21,37 @@ Remarques sur les données : | |
#### ***Résultats de la recherche sur la végétation intertidale et le fucus, par zone*** | ||
|
||
```{r overlap-rockweed, echo=FALSE, results='asis'} | ||
rockweed_intersect <- st_intersection(studyArea, st_make_valid(rockweed_sf)) | ||
rockweed_result <- as.numeric(nrow(rockweed_intersect)) | ||
# define polygon dataset and attribute to plot | ||
poly_sf <- rockweed_sf | ||
attribute <- "RWP" | ||
# intersect polyData with 3 polygons (region, map area, and study box) | ||
clipped <- master_intersect(poly_sf, mapDataList) | ||
``` | ||
* | ||
```{r overlap-rockweed-output, echo=FALSE, results='asis'} | ||
Query_output_rockweed <- if(rockweed_result < 1){"There are no relevant records of predicted intertidal vegetation for this search area." | ||
} else {"There are relevant records of predicted intertidal vegetation for this search area."} | ||
Query_output_rockweed<-noquote(Query_output_rockweed) | ||
writeLines(Query_output_rockweed) | ||
```{r overlap rockweed output, echo=FALSE, results='asis'} | ||
polyText<-if(is.null(clipped$studyData)){"Il n’existe aucun registre pertinent sur la végétation intertidale prévue pour cette zone de recherche." | ||
} else {"Il existe des registres pertinentes sur la végétation intertidale prévue pour cette zone de recherche."} | ||
polyText<-noquote(polyText) | ||
writeLines(polyText) | ||
``` | ||
|
||
```{r rockweed-plot, fig.height=8, fig.width=11, fig.cap='Quality Tier: Medium. Security level: none. Map showing the search area defined by the user: location of the proposed project/activity is highlighted in yellow (input polygon), surrounded by an exposure zone or user-defined buffer area in blue. Figure shows overlap between the search area and satellite-based maps of intertidal vegetation and rockweed presence polygons.'} | ||
plot_rockweed <- function(rockweed_sf, areaMap, bboxMap) { | ||
# crop rockweed layer to the map area to speed up plotting | ||
rockweed <- st_crop(st_make_valid(rockweed_sf), bboxMap) | ||
if (dim(rockweed)[1] == 0){ | ||
rockweedMap <- NULL | ||
}else{ | ||
# define axis limit | ||
axLim <-ggplot2::coord_sf(xlim = c(bboxMap["xmin"], bboxMap["xmax"]), | ||
ylim = c(bboxMap["ymin"], bboxMap["ymax"]), | ||
expand = FALSE) | ||
# replace codes with words | ||
rockweed$Rockweed <- "" | ||
rockweed$Rockweed[which(rockweed$RWP == 1)] <- "1-Present" | ||
rockweed$Rockweed[which(rockweed$RWP == 2)] <- "2-Likely Present" | ||
rockweed$Rockweed[which(rockweed$RWP == 5)] <- "5-Unknown" | ||
rockweed$Rockweed[which(rockweed$RWP == 0)] <- "Not Present" | ||
rockweedMap <- areaMap + | ||
geom_sf(data = rockweed, aes(fill = Rockweed), colour = NA) + | ||
scale_fill_manual(values = c("#009E73", "#E69F00", "#0072B2","#999999")) + | ||
studyBox_geom + | ||
axLim | ||
} | ||
return(rockweedMap) | ||
} | ||
if(rockweed_result > 1){print( | ||
plot_rockweed(rockweed_sf, areaMap, bboxMap))} | ||
```{r rockweed-plot, fig.height=8, fig.width=11, fig.cap='Niveau de qualité : Moyenne. Niveau de sécurité : Aucun. Carte montrant la zone de recherche définie par l’utilisateur : l’emplacement du projet ou de l’activité proposé est surligné en jaune (polygone d’entrée), entouré d’une zone exposée ou d’une zone tampon définie par l’utilisateur en bleu. La figure illustre le chevauchement entre la zone de recherche et les cartes satellitaires de la végétation intertidale et des polygones de présence de fucus.'} | ||
if(!is.null(clipped$studyData)){print( | ||
plot_rr_sf(areaMap, clipped$mapData, attribute))} | ||
``` | ||
|
||
```{r table-rockweed, echo=FALSE, cache=FALSE, include = FALSE} | ||
if(rockweed_result > 1){ | ||
rwTable <- rockweedStats(rockweed_sf, studyArea)} | ||
if(!is.null(clipped$studyData)){ | ||
rwTable <- rockweedStats(clipped$studyData, studyArea)} | ||
``` | ||
|
||
```{r rockweed-table} | ||
if(rockweed_result > 1){ | ||
knitr::kable(rwTable, align="l", | ||
caption = "Number of vegetation polygons and surface area occupied by each category for the study area. Total intertidal vegetations is a sum of all categories.", booktabs = T, escape = F, linesep = "") %>% | ||
if(!is.null(clipped$studyData)){ | ||
knitr::kable(rwTable,align="l", | ||
caption = "Nombre de polygones de végétation et la superficie occupée par chaque catégorie pour la zone d’étude. La végétation intertidale totale est la somme de tous les catégories.", booktabs = T, escape = F, linesep="") %>% | ||
kable_styling(bootstrap_options = "striped", full_width = T, position = "left") | ||
} | ||
} | ||
``` | ||
|
Oops, something went wrong.