readBiomass: Read a NORWECOM file.

Description Usage Arguments

Description

readNorwecomBiomass Reads a NORWECOM biomass file, with biomass on a irregular grid Long, Latt.

readNorwecomSuperind Reads a NORWECOM super individual file.

readNcVarsAndAttrs Extracts variables with long names as attributes.

getBiomassXY Converts to Cartesian coordinates for the biomass data.

getSuperindXY Converts to Cartesian coordinates for the superindividual data.

interpolateBiomassToTransects Interpolate NORWECOM biomass onto log distances.

Usage

 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
readNcVarsAndAttrs(ncfile, vars, rename = NULL)

readNorwecomBiomass(
  ncfile,
  centroid,
  vars = c("Biom", "Long", "Latt"),
  rename = list(Biom = "biomass", Long = "longitude", Latt = "latitude")
)

readNorwecomSuperind(
  ncfile,
  centroid,
  vars = c("xpos", "ypos", "Long", "Latt", "female", "age", "length", "pweight",
    "inumb", "site", "stage"),
  rename = list(pweight = "weight"),
  na.rm = TRUE,
  maxValue = 1e+10,
  excludeSite4 = TRUE,
  stagesToRemove = c(0, 1, 2)
)

getNorwecomSuperindLonLat(superind)

projLonLat2XY(
  x,
  centroid,
  proj = "aeqd",
  units = "kmi",
  x_0 = 0,
  y_0 = 0,
  ellps = "WGS84",
  datum = "WGS84"
)

interpolateBiomassToTransects(
  biomass,
  superind,
  transects,
  centroid,
  logDays,
  lonlatmargin = 0.05,
  superindFilter = NULL,
  m = 20,
  TS0 = -71.9,
  b = NULL,
  insideRange = NULL,
  condPar = NULL,
  LcmMean = NULL
)

Arguments

ncfile

The input NetCDF4 file with a (possibly irregular) grid of biomass in gram per square meters, and geographical positions (see the input vars).

vars

A string vector of the variables to read from the ncfile.

rename

A list of variableNameInNCfile = newVariableName, renaming the variables read from the ncfile to the variables required by the function biomass2tsb ("Biom", "Long", "Latt", for output from readNorwecomBiomass, and "gridLongInd", "gridLattInd", "gridLong", "gridLatt", "age", "inumb", "length", "sweight", "pweight", for output from readNorwecomSuperind).

centroid

The geographical position in decimal degrees (longitude, latitude) used as centoid in the conversion to Cartesian positions.

na.rm

Logical: If TRUE, remove superindividuals which are initially NA (thus born within the time period of the file). This

maxValue

The value above which variables are identified as NA.

x

The output from readNcVarsAndAttrs.

proj, units, x_0, y_0, ellps, datum

The proj4 parameters used in the projection from geographical to Cartesian coordinates centered at centroid.

biomass, superind

The biomass and superind data read from readNcVarsAndAttrs (used in readNorwecomBiomass and readNorwecomSuperind).

transects

The output from surveyPlanner.

logDays

A vector of the days in the biomass data at which the log distances in transects are timed.

lonlatmargin

The margin to expand the ranges of longitude and latitude when interpolating each stratum. A large value demands more CPU time and memory.

superindFilter

An optional function acting on the superind data, such as longitude or latitude, e.g., superindFilter <- function(x) x$longitude < 20.

m, TS0

The parameters of the target strength-length relationship TS = m * log10(Lcm) + TS0, typically m = 20 and TS0 = -71.9 (herring, from Foote, K. G. 1987. Fish target strengths for use in echo integrator surveys. Journal of the Acoustical Society of America, 82: 981 - 987.)


Sea2Data/pelfoss documentation built on Dec. 7, 2020, 12:31 a.m.