shelfSurveyInterpBarnes: Shelf survey barnes interpolation method

View source: R/calculations.R

shelfSurveyInterpBarnesR Documentation

Shelf survey barnes interpolation method

Description

This function applies the appropriate methodology decided on for interpolating shelf survey CTD measurements that has been tailored to the scotian shelf.

Usage

shelfSurveyInterpBarnes(
  ctd,
  fullgrid,
  grid,
  variable,
  xg,
  yg,
  xr,
  yr,
  iterations,
  gamma,
  averagingMethod,
  trimOutput,
  trimDistance,
  debug = FALSE
)

Arguments

ctd

a list of ctd objects

fullgrid

a data.frame containing the full original grid which contains columns, x which is the longitude, y which is the latitude, depth, and isBottom which indicates if the grid point is the bottom depth.

grid

a data.frame containing the grid points that data should be interpolated. This includes columns y which is the latitude, x, which is the longitude, depth, a positive value, tolerance, a positive value indicating a depth range used to get an average value at the given depth, isBottom, an optional column indicating if the grid point is a bottom depth point.

variable

a character value specifying which variable to extract from the ctd profiles.

xg, yg

vectors defining x and y grids, see interpBarnes for additional clarification.

xr, yr

lengths of the x and y grids for barnes interpolation, see interpBarnes for additional clarification.

iterations

number of iterations for barnes interpolation, see interpBarnes for additional clarification.

gamma

grid-focussing parameter for barnes interpolation, see interpBarnes for additional clarification.

averagingMethod

a character vector of length one indicating how to vertically average the data to input into the barnes interpolation. Current options include mean and triangleWeight.

trimOutput

a logical value indicating if the barnes output should trim the grid output based on the input data. If TRUE, any grid points which don't have any data within the value supplied to trimDistance.

trimDistance

a numeric value indicating the distance, in kilometers, where barnes interpolation output will be deemed valid if supplied data falls within the given distance. If not, the barnes output at that grid point will be assigned a value of NA.

debug

a logical value indicating if some debug messages should be displayed.

Value

a data.frame of the barnes interpolation output at each grid point defined in full grid, if the given depth value and or grid points are specified in grid. The data.frame includes x the longitude, y the latitude, depth the depth, and data the barnes output of the smoothed interpolated data for the given variable.

Author(s)

Chantelle Layton


clayton33/csasMarPhys documentation built on June 8, 2025, 3:10 a.m.