View source: R/interpolate_TempDepthProfiles.r
interpolate_TempDepthProfiles | R Documentation |
interpolates depth-temperature data and returns daily average temperature at depth profiles on a user-specified resolution (Depth_res
).
Results are returned as a list containing the interpolated Temperature-matrix, and the corresponding date and depth values. Thus interpolated temperature at depth profiles can be visualized using function image_TempDepthProfiles and faciliates the analysis of temporal changes of temperature profiles, for instance, in relation to animal behaviour (e.g. diving behaviour).
interpolate_TempDepthProfiles(ts, Temp_field="Temperature", ID_key="Serial",
Depth_res=.5, verbose=TRUE, Data_Source='station')
interpolate_PDTs(ts, Temp_field="MeanPDT", ID_key="Serial", #return_as_matrix=FALSE,
Depth_res=.5, verbose=TRUE, Data_Source='station')
ts, Temp_field, ID_key |
|
Depth_res |
numeric value, defining the depth resolution at which the temperature data should be interpolated. |
verbose |
whether the sampling dates and ids of stations or tags, as defined by the columns |
Data_Source |
a character string, defining the data source (by default |
A list containing the interpolated temperature at depth profiles and their corresponding date and interpolated depth values as well as a summary table with the original depth values and their number per day:
$ Data_Source.ID_key:List of 4
..$ Temperature_matrix: num
..$ Depth : num
..$ Date :Date
..$ sm :data.frame
Please see the examples for further understaning.
Robert K. Bauer
Bauer, R., F. Forget and JM. Fromentin (2015) Optimizing PAT data transmission: assessing the accuracy of temperature summary data to estimate environmental conditions. Fisheries Oceanography, 24(6): 533-539, \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1111/fog.12127")}
read_PDT, bin_TempTS, get_thermalstrat, image_TempDepthProfiles
#### example 1) run on PDT file:
## step I) read sample PDT data file:
path <- system.file("example_files",package="RchivalTag")
PDT <- read_PDT("104659-PDTs.csv",folder=path)
head(PDT)
#
# ## step II) interpolate average temperature fields (MeanPDT) from PDT file:
# m <- interpolate_PDTs(PDT)
# str(m)
# m$sm
#
# ## step III) calculate thermal stratifcation indicators per day (and tag):
# get_thermalstrat(m, all_info = TRUE)
# get_thermalstrat(m, all_info = FALSE)
#
# ## step IV) plot interpolated profiles:
# image_TempDepthProfiles(m$station.1)
#
#
# #### example 2) run on time series data:
# ## step I) read sample time series data file:
# ts_file <- system.file("example_files/104659-Series.csv",package="RchivalTag")
# DepthTempTS <- read_TS(ts_file)
#
#
# ## step Ib) bin temperature data on 10m depth bins
# ## to increase later estimate accuracy (see Bauer et al. 2015):
# # DepthTempTS_binned <- bin_TempTS(DepthTempTS,res=10)
#
# ## step II) interpolate average temperature fields (MeanTemp) from binned data:
# m <- interpolate_TempDepthProfiles(DepthTempTS)
# # m <- interpolate_PDTs(DepthTempTS_binned)
# str(m)
# m$sm
#
# ## step III) calculate thermal stratifcation indicators per day (and tag):
# get_thermalstrat(m, all_info = TRUE)
# get_thermalstrat(m, all_info = FALSE)
#
# ## step IV) plot interpolated profiles:
# image_TempDepthProfiles(m$station.1)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.