interpolate_TempDepthProfiles: interpolate daily temperature at depth profiles

View source: R/interpolate_TempDepthProfiles.r

interpolate_TempDepthProfilesR Documentation

interpolate daily temperature at depth profiles

Description

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).

Usage

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')

Arguments

ts, Temp_field, ID_key

ts is a data.frame with temperature at depth data. Required columns are Depth for the depth data and a column containing temperature data, whose name is defined by Temp_field. ID_key specifies the name of an optional column on which sampling stations or tags can be distinguished (by default Serial).

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 date and ID_key, should be indicated during the interpolation process.

Data_Source

a character string, defining the data source (by default station).

Value

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.

Author(s)

Robert K. Bauer

References

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")}

See Also

read_PDT, bin_TempTS, get_thermalstrat, image_TempDepthProfiles

Examples

#### 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)


RchivalTag documentation built on Nov. 10, 2023, 5:06 p.m.