| Title: | Sea Currents to Connectivity Transformation |
|---|---|
| Description: | Transformation of sea currents to connectivity data. Two files of horizontal and vertical currents flows are transformed into connectivity data in the form of 'sfnetwork', shapefile, edge list and adjacency matrix. An application example is shown at Nagkoulis et al. (2025) <doi:10.1016/j.dib.2024.111268>. |
| Authors: | Nikolaos Nagkoulis [aut] (ORCID: <https://orcid.org/0000-0002-1900-2634>), Christos Adam [aut, cre] (ORCID: <https://orcid.org/0009-0003-3244-7034>), Ioannis G. Mamoutos [aut] (ORCID: <https://orcid.org/0000-0002-2697-2620>), Antonios D. Mazaris [aut] (ORCID: <https://orcid.org/0000-0002-4961-5490>), Stelios Katsanevakis [aut] (ORCID: <https://orcid.org/0000-0002-5137-7540>) |
| Maintainer: | Christos Adam <[email protected]> |
| License: | GPL-3 |
| Version: | 0.1.3 |
| Built: | 2026-05-26 07:43:06 UTC |
| Source: | https://github.com/cadam00/seagraphs |
Antpath plot of connections
antpath_sfn(result, lowcut = NULL, uppcut = NULL)antpath_sfn(result, lowcut = NULL, uppcut = NULL)
result |
|
lowcut |
Optional percentile of threshold for not plotting connections below this value. |
uppcut |
Optional percentile of threshold for not plotting connections above this value. |
A leaflet antmap map output.
graph_result <- seagraph(component_u = get_component_u(), component_v = get_component_v(), mask_shapefile = NULL, k_neighbors = 7) antpath_sfn(graph_result) antpath_sfn(graph_result, lowcut = 0.1, uppcut = 0.9)graph_result <- seagraph(component_u = get_component_u(), component_v = get_component_v(), mask_shapefile = NULL, k_neighbors = 7) antpath_sfn(graph_result) antpath_sfn(graph_result, lowcut = 0.1, uppcut = 0.9)
Flow plot of connections
flows_sfn(result, lowcut = NULL, uppcut = NULL)flows_sfn(result, lowcut = NULL, uppcut = NULL)
result |
|
lowcut |
Optional percentile of threshold for not plotting connections below this value. |
uppcut |
Optional percentile of threshold for not plotting connections above this value. |
A leaflet flow map output.
graph_result <- seagraph(component_u = get_component_u(), component_v = get_component_v(), mask_shapefile = NULL, k_neighbors = 7) flows_sfn(graph_result) flows_sfn(graph_result, lowcut = 0.1, uppcut = 0.9)graph_result <- seagraph(component_u = get_component_u(), component_v = get_component_v(), mask_shapefile = NULL, k_neighbors = 7) flows_sfn(graph_result) flows_sfn(graph_result, lowcut = 0.1, uppcut = 0.9)
Example horizontal direction raster.
get_component_u()get_component_u()
Example of input component_u used for functions. It is a cropped area
of yearly aggregated and normalized horizontal component at Black Sea.
SpatRaster object.
Lima, L., Aydogdu, A., Escudier, R., Masina, S., Ciliberti, S. A., Azevedo, D., Peneva, E. L., Causio, S., Cipollone, A., Clementi, E., Cretí, S., Stefanizzi, L., Lecci, R., Palermo, F., Coppini, G., Pinardi, N., and Palazov, A. (2020). Black Sea Physical Reanalysis (CMEMS BS-Currents) (Version 1) [Data set]. Copernicus Monitoring Environment Marine Service (CMEMS). doi:10.25423/CMCC/BLKSEA_MULTIYEAR_PHY_007_004. Last Access: 07/11/2024.
Schulzweida, U. (2023). CDO User Guide (23.0). Zenodo. doi:10.5281/zenodo.10020800.
get_component_v,
get_mask_shapefile
component_u <- get_component_u() terra::plot(component_u)component_u <- get_component_u() terra::plot(component_u)
Example vertical direction raster.
get_component_v()get_component_v()
Example of input component_v used for functions. It is a cropped area
of yearly aggregated and normalized vertical component at Black Sea.
SpatRaster object.
Lima, L., Aydogdu, A., Escudier, R., Masina, S., Ciliberti, S. A., Azevedo, D., Peneva, E. L., Causio, S., Cipollone, A., Clementi, E., Cretí, S., Stefanizzi, L., Lecci, R., Palermo, F., Coppini, G., Pinardi, N., and Palazov, A. (2020). Black Sea Physical Reanalysis (CMEMS BS-Currents) (Version 1) [Data set]. Copernicus Monitoring Environment Marine Service (CMEMS). doi:10.25423/CMCC/BLKSEA_MULTIYEAR_PHY_007_004. Last Access: 07/11/2024.
Schulzweida, U. (2023). CDO User Guide (23.0). Zenodo. doi:10.5281/zenodo.10020800.
get_component_u,
get_mask_shapefile
component_v <- get_component_v() terra::plot(component_v)component_v <- get_component_v() terra::plot(component_v)
Example mask shapefile.
get_mask_shapefile()get_mask_shapefile()
Example of input mask_shapefile used for functions. It is a bounding box
subset of get_component_u and
get_component_v SpatRaster objects.
sf and data.frame object.
mask_shapefile <- get_mask_shapefile() plot(mask_shapefile)mask_shapefile <- get_mask_shapefile() plot(mask_shapefile)
Sea Currents To Connectivity Transformation
seagraph(component_u, component_v, mask_shapefile = NULL, k_neighbors = 7L)seagraph(component_u, component_v, mask_shapefile = NULL, k_neighbors = 7L)
component_u |
|
component_v |
|
mask_shapefile |
Optional |
k_neighbors |
|
Sea currents data of the input are transformed into weighted directed graph
connectivity data. Each centroid of component_u and component_v is
considered as a separate graph node. These connectivity data are provided in
sfnetwork, sf, edge list and adjacency matrix form. An additional
data.frame with correspondence between indices and coordinates for edge
list and adjacency matrix is returned as well. The weights in all outputs are
minmax-scaled in .
Extent, resolution and coordinate system of both must have the same for both
component_u and component_v; otherwise an error stops the
function's execution. In case that a mask_shapefile is provided, then it
is internally assured that it has the same resolution or coordinates with
component_u and a warning is prompted.
SeaGraph object, which is a list containing the following elements:
sfnetwork: sfnetwork object representing both graph and coordinates of the connectivity map.
sf: sf and data.frame object representing 'LINESTRING' rows
of connections between nodes.
edge_list: matrix object representing the edge list, where source
('from'), destination ('to') and weight ('weight') for each connection are
returned.
adj_mat: matrix object representing the weighted adjacency
matrix of the nodes.
ID_coords: data.frame object with the correspondence between
indices and coordinates for edge list (edge_list) and adjacency matrix
(adj_mat).
Nagkoulis, N., Adam, C., Mamoutos, I., Katsanevakis, S., and Mazaris, A. D. (2025). An ecological connectivity dataset for Black Sea obtained from sea currents. Data in Brief, 58, 111268. doi:10.1016/j.dib.2024.111268
graph_result <- seagraph(component_u = get_component_u(), component_v = get_component_v(), k_neighbors = 7) ## Example of mask usage masked_result <- seagraph(component_u = get_component_u(), component_v = get_component_v(), mask_shapefile = get_mask_shapefile(), k_neighbors = 7)graph_result <- seagraph(component_u = get_component_u(), component_v = get_component_v(), k_neighbors = 7) ## Example of mask usage masked_result <- seagraph(component_u = get_component_u(), component_v = get_component_v(), mask_shapefile = get_mask_shapefile(), k_neighbors = 7)