R/rxtracto.R
rxtracto.Rd
rxtracto_new
uses the R program 'rerddap' to extract environmental
data from an 'ERDDAP' server along a (x,y,z, time) trajectory.
rxtracto(
dataInfo,
parameter = NULL,
xcoord = NULL,
ycoord = NULL,
zcoord = NULL,
tcoord = NULL,
xlen = 0,
ylen = 0,
zlen = 0,
xName = "longitude",
yName = "latitude",
zName = "altitude",
tName = "time",
interp = NULL,
verbose = FALSE,
progress_bar = FALSE
)
- the return from an 'rerddap::info' call to an 'ERDDAP' server
- character string containing the name of the parameter to extract
- a real array with the x-coordinates of the trajectory (if longitude in #' decimal degrees East, either 0-360 or -180 to 180)
- a real array with the y-coordinate of the trajectory (if latitude in decimal degrees N; -90 to 90)
-a real array with the z-coordinate of the trajectory (usually altitude or depth)
- a character array with the times of the trajectory in "YYYY-MM-DD" - for now restricted to be time.
- real array defining the longitude box around the given point (xlen/2 around the point)
- real array defining the latitude box around the given point (ylen/2 around the point)
- real array defining the depth or altitude box around the given point (zlen/2 around the point)
- character string with name of the xcoord in the 'ERDDAP' dataset (default "longitude")
- character string with name of the ycoord in the 'ERDDAP' dataset (default "latitude")
- character string with name of the zcoord in the 'ERDDAP' dataset (default "altitude")
- character string with name of the tcoord in the 'ERDDAP' dataset (default "time")
- array (size 2) of character strings - c(interpolation type, neighborhood) Uses the new ERDDAP interpoation option to get values See Vignette for details Default is Null, do not use the interpolation option
- logical variable (default FALSE) if the the URL request should be verbose
- logical variable (default FALSE) should a progress bar be displayed
If success a dataframe containing:
column 1 = mean of data within search radius
column 2 = standard deviation of data within search radius
column 3 = number of points found within search radius
column 4 = time of returned value
column 5 = min longitude of call (decimal degrees)
column 6 = max longitude of call (decimal degrees)
column 7 = min latitude of call (decimal degrees)
column 8 = max latitude of call (decimal degrees)
column 9 = requested time in tag
column 10 = median of data within search radius
column 11 = median absolute deviation of data within search radius
else an error string
## toy example to show use
## but keep execution time down
##
# dataInfo <- rerddap::info('erdHadISST')
##
parameter <- 'sst'
xcoord <- c(-130.5)
ycoord <- c(40.5)
tcoord <- c('2006-01-16')
# extract <- rxtracto(dataInfo, parameter = parameter, xcoord = xcoord,
# ycoord = ycoord, tcoord= tcoord
# )
##
## bathymetry example
## 2-D example getting bathymetry
dataInfo <- rerddap::info('etopo360')
#> Registered S3 method overwritten by 'hoardr':
#> method from
#> print.cache_info httr
parameter <- 'altitude'
# extract <- rxtracto(dataInfo, parameter, xcoord = xcoord, ycoord = ycoord)