createSSP: Create Sound Speed Profiles

View source: R/createSSP.R

createSSPR Documentation

Create Sound Speed Profiles

Description

Creates sound speed profiles (Depth vs Sound Speed) using temperature and salinity data downloaded from HYCOM data servers

Usage

createSSP(
  x,
  f = 30000,
  nc = NULL,
  ncVars = c("salinity", "water_temp"),
  dropNA = TRUE,
  progress = TRUE,
  ...
)

Arguments

x

a data.frame with columns UTC, Longitude, and Latitude to create sound speed profiles for

f

the frequency (Hz) to generate the profile for

nc

netcdf file containing salinity and temperature data at depth, if NULL (default) these will be downloaded from HYCOM servers

ncVars

names of the salinity and temperature variables (in that order) in your netcdf file, only change these if you are providing your own file to nc

dropNA

logical flag to drop NA values from soundspeeed profile from outputs. SSP will be calculated up to the maximum depth at each coordinate, which can vary. Setting this option to FALSE ensures that outputs are the same length for each coordinate, which can be useful

progress

logical flag to show progress bar for SST download

...

additional arguments to pass to matchEnvData

Value

a list with one element for each row of x, each element is a list containing speed, the sound speed (m/s), and depth (m)

Author(s)

Taiki Sakai taiki.sakai@noaa.gov

Examples

## Not run: 
# examples not run because they require internet connection
coords <- data.frame(UTC=as.POSIXct('2014-07-15 01:00:00', tz='UTC'),
                     Longitude = -119, Latitude = 33)
ssp <- createSSP(coords)
plot(x=ssp[[1]]$speed, y=-ssp[[1]]$depth, type='l')

## End(Not run)


PAMmisc documentation built on June 22, 2024, 9:37 a.m.