Title: | Functions to calculate Swept area ratio and Surface and subsurface abrasion from VMS data |
---|---|
Description: | Functions to calculate Swept area ratio and Surface and subsurface abrasion from VMS data. The data is expected to conform to the ICES WGSFD data call format. |
Authors: | Colin Millar [aut, cre], Carlos Pinto [aut] |
Maintainer: | Colin Millar <[email protected]> |
License: | MIT + file LICENSE |
Version: | 1.0.0 |
Built: | 2024-11-01 11:16:36 UTC |
Source: | https://github.com/ices-tools-dev/sfdSAR |
Functions to calculate Swept area ratio and Surface and subsurface abrasion from VMS data. The data is expected to conform to the ICES WGSFD data call format.
Colin Millar, ICES WGSFD.
ICES Working Group on Spatial Fisheries Data: http://www.ices.dk/community/groups/Pages/WGSFD.aspx.
Extract the surface area, latitude or longitude of a 0.05 resolution C-Square.
csquare_area(csquare) csquare_lat(csquare) csquare_lon(csquare)
csquare_area(csquare) csquare_lat(csquare) csquare_lon(csquare)
csquare |
the name of a 0.05 resolution C-Square. |
A vector of numeric values: latitudes, longitudes or areas.
csquare_area("1501:370:370:1") csquare_lat("1501:370:370:1") csquare_lon("1501:370:370:1")
csquare_area("1501:370:370:1") csquare_lat("1501:370:370:1") csquare_lon("1501:370:370:1")
Predict the gear with of a fishing gear from its benthis classification.
linear(firstFactor, secondFactor, x) power(firstFactor, secondFactor, x)
linear(firstFactor, secondFactor, x) power(firstFactor, secondFactor, x)
firstFactor |
the 'first' parameter for the model |
secondFactor |
the 'second' parameter for the model |
x |
the covariate used in the model: avg_oal (average overall length) or avg_kw (average kilo-wats engine power) |
A vector of predicted gear widths.
linear(1, 1, 1)
linear(1, 1, 1)
Predict gear width using vessel length or engine size.
predict_gear_width(model, coefficient, data)
predict_gear_width(model, coefficient, data)
model |
vector of characters defining a model (see ?linear or ?power) |
coefficient |
coefficient names, must be columns names in data |
data |
a data.frame with the columns, a, b, model, . |
A vector of predicted gear widths.
# very simple example of how to apply this helper function predict_gear_width("power", "avg_aol", data.frame(firstFactor = 1, secondFactor = 1, avg_aol = 1)) # use the dummy vms dataset data(test_vms) # get gear widths and metier lookup from ICES DB library(icesVMS) metier_lookup <- get_metier_lookup() gear_widths <- get_benthis_parameters() # join widths and lookup library(dplyr) aux_lookup <- gear_widths %>% right_join(metier_lookup, by = c("benthisMet" = "benthisMetiers")) # add aux data to vms vms <- aux_lookup %>% right_join(test_vms, by = c("leMetLevel6" = "LE_MET_level6")) # calculate the gear width model vms$gearWidth_model <- predict_gear_width(vms$gearModel, vms$gearCoefficient, vms)
# very simple example of how to apply this helper function predict_gear_width("power", "avg_aol", data.frame(firstFactor = 1, secondFactor = 1, avg_aol = 1)) # use the dummy vms dataset data(test_vms) # get gear widths and metier lookup from ICES DB library(icesVMS) metier_lookup <- get_metier_lookup() gear_widths <- get_benthis_parameters() # join widths and lookup library(dplyr) aux_lookup <- gear_widths %>% right_join(metier_lookup, by = c("benthisMet" = "benthisMetiers")) # add aux data to vms vms <- aux_lookup %>% right_join(test_vms, by = c("leMetLevel6" = "LE_MET_level6")) # calculate the gear width model vms$gearWidth_model <- predict_gear_width(vms$gearModel, vms$gearCoefficient, vms)
Predict surface contact.
predict_surface_contact(model, fishing_hours, gear_width, fishing_speed)
predict_surface_contact(model, fishing_hours, gear_width, fishing_speed)
model |
vector of characters defining a model (see ?surface_contact_models) |
fishing_hours |
the total number of hours fished. |
gear_width |
the average gear width. |
fishing_speed |
the average fishing speed. |
A vector of predicted gear widths.
# compute surface contact for a trawl gear, fishing for 1 hour, with # a 85 metres trawl width, at 3 knots. predict_surface_contact("trawl_contact", 1, 85, 3)
# compute surface contact for a trawl gear, fishing for 1 hour, with # a 85 metres trawl width, at 3 knots. predict_surface_contact("trawl_contact", 1, 85, 3)
Predict the surface contact of a fishing gear
trawl_contact(fishing_hours, gear_width, fishing_speed) danish_seine_contact(fishing_hours, gear_width, fishing_speed) scottish_seine_contact(fishing_hours, gear_width, fishing_speed)
trawl_contact(fishing_hours, gear_width, fishing_speed) danish_seine_contact(fishing_hours, gear_width, fishing_speed) scottish_seine_contact(fishing_hours, gear_width, fishing_speed)
fishing_hours |
the number of hours of fishing |
gear_width |
(average) gear width in metres |
fishing_speed |
(average) fishing speed in knots |
A vector of predicted gear widths.
# compute surface contact for a trawl gear, fishing for 1 hour, with # a 85 metres trawl width, at 3 knots. trawl_contact(fishing_hours = 1, gear_width = 85, fishing_speed = 3)
# compute surface contact for a trawl gear, fishing for 1 hour, with # a 85 metres trawl width, at 3 knots. trawl_contact(fishing_hours = 1, gear_width = 85, fishing_speed = 3)
A table.
test_vms
test_vms
Data frame with containing 17 columns:
recordtype |
Metier level 6 gear code |
country |
Benthis metier used to define bottom fishing pressure |
year |
Metier level 5 gear codes |
month |
Metier level 5 gear codes |
c_square |
JNCC gear groupings |
vessel_length_category |
Vessel length category |
gear_code |
Text description of the gear code |
LE_MET_level6 |
Metier level 6 gear code |
avg_fishing_speed |
description ... |
fishing_hours |
description ... |
avg_oal |
description ... |
avg_kw |
description ... |
kw_fishinghours |
description ... |
totweight |
description ... |
totvalue |
description ... |
ICES_avg_fishing_speed |
description ... |
avg_gearWidth |
description ... |
Copmletely made up VMS data to allow SAR functions to be demonstrated.
Reference to ices data call and format?
sfdSAR-package
gives an overview of the package.
head(test_vms)
head(test_vms)