InterPro: Hydrography interpolator

Description Usage Arguments Details Examples

Description

Function computes linear interpolation between two hydrographies.

Usage

1
InterPro(data, steps, opList = FALSE)

Arguments

data

list of two hydrography profiles.

steps

numeric, number of profiles to be interpolated.

opList

logical, if TRUE, returns list. If FALSE, returns array.

Details

To be written. Further details in 'Examples'.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
## Not run: 

#Example for two customized CTDs along south-to-north transect (20 nautical miles)
#Computation of linearly interpolated hydrographies for every nautical mile

#Generating two customized hydrographies
set.seed(12345)
hydNorth <- HydroGen(data.frame(Temperature = c(17, 10, 4, 7, 9),
                               Oxygen = c(6, 5, 3, 2, 0),
                               Salinity = c(7, 8, 9, 18, 20)), by = 20)

hydSouth <- HydroGen(data.frame(Temperature = c(20, 17, 3, 7, 8),
                                Oxygen = c(7, 6, 4, 1, 0),
                                Salinity = c(6, 8, 9, 16, 20)), by = 20)

#Generating list including hydNorth and hydSouth
dl  <- list(hydNorth, hydSouth)

#Calculating nineteen interpolated profiles
hydro <- InterPro(data = dl, steps = 19, opList = TRUE)

#Generating plot including temperature and salinity profiles from southern towards northern station 
par(mfrow = c(1,2))
for(j in c(1,3)){
  plot(x = 0, xlim = c(-20, 20), ylim = c(85,0), ylab = ifelse(j == 1, "Water depth", ""), xlab = "", xaxt='n', type = "n")
  points(c(-18, 18), c(84, 84), pch = 21, cex = 4)
  text(c(-18, 18), c(84, 84), c("S", "N"), cex = 1.5)
  title(main = c("Interpolated temperature profiles\nfrom one station to another", "", 
                 "Interpolated salinity profiles\nfrom one station to another")[j])
  
  for(i in 20:1){
    lines(hydro[[i]][,j]-i, c(1:80), col = c("red3", "", "green4")[j])
  }
 }

## End(Not run)

herrmannrobert/VerDi documentation built on June 10, 2019, 7:32 a.m.